HappenLee commented on code in PR #56181:
URL: https://github.com/apache/doris/pull/56181#discussion_r2361860254
##########
be/src/vec/exec/jni_connector.cpp:
##########
@@ -386,16 +386,32 @@ Status JniConnector::_fill_column(TableMetaAddress&
address, ColumnPtr& doris_co
Status JniConnector::_fill_varbinary_column(TableMetaAddress& address,
MutableColumnPtr& doris_column,
size_t num_rows) {
+ // Java side writes per-row metadata as 16 bytes: [len: long][addr: long]
+ // Example in Java:
+ // long addr = OffHeap.allocateMemory(src.length);
+ // OffHeap.copyMemory(src, OffHeap.BYTE_ARRAY_OFFSET, null, addr,
src.length);
+ // OffHeap.putLong(null, data + 16L * rowIndex, src.length);
+ // OffHeap.putLong(null, data + 16L * rowIndex + 8, addr);
+ // Here we read back that buffer and insert into ColumnVarbinary.
+
auto& varbinary_col = assert_cast<ColumnVarbinary&>(*doris_column);
- int* offsets = reinterpret_cast<int*>(address.next_meta_as_ptr());
- char* chars = reinterpret_cast<char*>(address.next_meta_as_ptr());
+ char* meta_base = reinterpret_cast<char*>(address.next_meta_as_ptr());
if (num_rows == 0) {
Review Comment:
check the logic before do other cast or check
--
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]