Skip to content

Commit

Permalink
[GLUTEN-5009][CH] Fix TPCDS q9 failed with debug build (#5015)
Browse files Browse the repository at this point in the history
  • Loading branch information
exmy authored Mar 20, 2024
1 parent 01cce51 commit 8dbca6c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cpp-ch/local-engine/Parser/CHColumnToSparkRow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,12 @@ int64_t VariableLengthDataWriter::writeArray(size_t row_idx, const DB::Array & a
writer.unsafeWrite(
reinterpret_cast<const char *>(&v), buffer_address + offset + start + 8 + len_null_bitmap + i * elem_size);
}
else if (writer.getWhichDataType().isFloat64())
{
// Fix 'Invalid Field get from type Float64 to type Int64' in debug build.
auto v = elem.get<Float64>();
writer.unsafeWrite(reinterpret_cast<const char *>(&v), buffer_address + offset + start + 8 + len_null_bitmap + i * elem_size);
}
else
writer.unsafeWrite(
reinterpret_cast<const char *>(&elem.get<char>()),
Expand Down Expand Up @@ -808,6 +814,12 @@ int64_t VariableLengthDataWriter::writeStruct(size_t row_idx, const DB::Tuple &
auto v = static_cast<Float32>(field_value.get<Float32>());
writer.unsafeWrite(reinterpret_cast<const char *>(&v), buffer_address + offset + start + len_null_bitmap + i * 8);
}
else if (writer.getWhichDataType().isFloat64())
{
// Fix 'Invalid Field get from type Float64 to type Int64' in debug build.
auto v = field_value.get<Float64>();
writer.unsafeWrite(reinterpret_cast<const char *>(&v), buffer_address + offset + start + len_null_bitmap + i * 8);
}
else
writer.unsafeWrite(
reinterpret_cast<const char *>(&field_value.get<char>()), buffer_address + offset + start + len_null_bitmap + i * 8);
Expand Down

0 comments on commit 8dbca6c

Please sign in to comment.