lszskye commented on code in PR #238:
URL: https://github.com/apache/paimon-cpp/pull/238#discussion_r3869586998


##########
src/paimon/common/reader/prefetch_file_batch_reader_impl.cpp:
##########
@@ -469,12 +473,17 @@ Status PrefetchFileBatchReaderImpl::HandleReadResult(
         } else if (slice_end < c_array->length) {
             // partially out of range, data before read_range.second has been 
effectively consumed
             readers_pos_[reader_idx]->store(read_range.second);
-            PAIMON_ASSIGN_OR_RAISE_FROM_ARROW(std::shared_ptr<arrow::Array> 
src_array,
-                                              
arrow::ImportArray(c_array.get(), c_schema.get()));
-            auto array = src_array->Slice(0, slice_end);
+            PAIMON_ASSIGN_OR_RAISE_FROM_ARROW(
+                std::shared_ptr<arrow::RecordBatch> record_batch,
+                arrow::ImportRecordBatch(c_array.get(), c_schema.get()));
+            std::shared_ptr<arrow::RecordBatch> sliced_batch =
+                record_batch->Slice(/*offset=*/0, slice_end);
+            PAIMON_ASSIGN_OR_RAISE(
+                std::shared_ptr<arrow::RecordBatch> normalized_batch,
+                ArrowUtils::NormalizeRecordBatchOffsets(sliced_batch, 
arrow_pool_.get()));

Review Comment:
   (1) please add this fix in title or conversation
   (2) adapt new api `NormalizeArrowArrayOffsets`



-- 
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]

Reply via email to