Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CH-199] Fix bug of "select cos(0)" returning no rows #200

Merged
merged 1 commit into from
Nov 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions utils/local-engine/Parser/SparkRowToCHColumn.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,23 @@ class SparkRowToCHColumn
auto * rows_buf_ptr = static_cast<char*>(env->GetDirectBufferAddress(rows_buf));
int len = *(reinterpret_cast<int*>(rows_buf_ptr));

// when len = -1, reach the buf's end.
while (len > 0)
// len = -1 means reaching the buf's end.
while (len >= 0)
{
rows_buf_ptr += 4;
appendSparkRowToCHColumn(helper, rows_buf_ptr, len);
rows_buf_ptr += len;
len = *(reinterpret_cast<int*>(rows_buf_ptr));

if (len > 0)
{
rows_buf_ptr += len;
len = *(reinterpret_cast<int *>(rows_buf_ptr));
}
else
{
len = -1;
}
}

// Try to release reference.
env->DeleteLocalRef(rows_buf);
}
Expand Down