Skip to content

Commit db48ed9

Browse files
authored
[CH-422] Fix NPE caused by CHColumnToSparkRow when converting map field (#423)
1 parent bceffb1 commit db48ed9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

utils/local-engine/Parser/CHColumnToSparkRow.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,10 +714,8 @@ int64_t VariableLengthDataWriter::writeMap(size_t row_idx, const DB::Map & map,
714714
const auto start = cursor;
715715
cursor += 8;
716716

717-
/// If Map is empty, return in advance
717+
/// Even if Map is empty, still write as [unsafe key array numBytes] [unsafe key array] [unsafe value array]
718718
const auto num_pairs = map.size();
719-
if (num_pairs == 0)
720-
return BackingDataLengthCalculator::getOffsetAndSize(start - parent_offset, 8);
721719

722720
/// Construct array of keys and array of values from map
723721
auto key_array = Array();

0 commit comments

Comments
 (0)