Skip to content

Commit

Permalink
Merge pull request #2904 from kuzudb/parquet-null-fix
Browse files Browse the repository at this point in the history
Fix parquet null
  • Loading branch information
acquamarin committed Feb 16, 2024
2 parents abf48f5 + 7055328 commit 851a6e7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ class ColumnReader {
result->setNull(i + resultOffset, true);
continue;
}
result->setNull(i + resultOffset, false);
if (filter[i + resultOffset]) {
VALUE_TYPE val = CONVERSION::plainRead(*plainData, *this);
result->setValue(i + resultOffset, val);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ uint64_t ListColumnReader::read(uint64_t numValues, parquet_filter_t& /*filter*/
break;
}
if (childDefinesPtr[childIdx] >= maxDefine) {
resultOut->setNull(resultOffset, false);
// value has been defined down the stack, hence its NOT NULL
resultPtr[resultOffset].offset = childIdx + currentChunkOffset;
resultPtr[resultOffset].size = 1;
} else if (childDefinesPtr[childIdx] == maxDefine - 1) {
resultOut->setNull(resultOffset, false);
resultPtr[resultOffset].offset = childIdx + currentChunkOffset;
resultPtr[resultOffset].size = 0;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ uint64_t StructColumnReader::read(uint64_t numValuesToRead, parquet_filter_t& fi
}
}
for (auto i = 0u; i < numValuesRead; i++) {
if (define_out[i] < maxDefine) {
result->setNull(i, true);
}
result->setNull(i, define_out[i] < maxDefine);
}

return numValuesRead;
Expand Down

0 comments on commit 851a6e7

Please sign in to comment.