exmy commented on code in PR #6722:
URL: https://github.com/apache/incubator-gluten/pull/6722#discussion_r1705200362


##########
cpp-ch/local-engine/Parser/CHColumnToSparkRow.cpp:
##########
@@ -702,6 +701,12 @@ int64_t VariableLengthDataWriter::writeArray(size_t 
row_idx, const DB::Array & a
                     auto v = elem.get<Float64>();
                     writer.unsafeWrite(reinterpret_cast<const char *>(&v), 
buffer_address + offset + start + 8 + len_null_bitmap + i * elem_size);
                 }
+                else if (writer.getWhichDataType().isDecimal32())
+                {
+                  // We can not use get<char>() directly here to process 
Decimal32 field,
+                  // because it will get 4 byte data, but Decimal32 is 8 byte 
in Spark, which will cause error conversion.
+                  writer.write(elem, buffer_address + offset + start + 8 + 
len_null_bitmap + i * elem_size);

Review Comment:
   Does `VariableLengthDataWriter::writeStruct` also need to be changed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to