zanmato1984 commented on code in PR #39585:
URL: https://github.com/apache/arrow/pull/39585#discussion_r1455662290


##########
cpp/src/arrow/compute/light_array.cc:
##########
@@ -383,27 +383,22 @@ int ExecBatchBuilder::NumRowsToSkip(const 
std::shared_ptr<ArrayData>& column,
 
   KeyColumnMetadata column_metadata =
       ColumnMetadataFromDataType(column->type).ValueOrDie();
+  ARROW_DCHECK(!column_metadata.is_fixed_length || 
column_metadata.fixed_length > 0);
 
   int num_rows_left = num_rows;
   int num_bytes_skipped = 0;
   while (num_rows_left > 0 && num_bytes_skipped < num_tail_bytes_to_skip) {
+    --num_rows_left;
+    int row_id_removed = row_ids[num_rows_left];
     if (column_metadata.is_fixed_length) {
-      if (column_metadata.fixed_length == 0) {
-        num_rows_left = std::max(num_rows_left, 8) - 8;
-        ++num_bytes_skipped;

Review Comment:
   Yes. Fixed size types of length `0/1/2/4/8` are using element-wise copying, 
i.e., no "word-wise then tail-bytes" copying. They don't go to this method:
   
https://github.com/apache/arrow/blob/3acc2eab739bfcc89bd39c3242dad154a980acb7/cpp/src/arrow/compute/light_array.cc#L513-L546
   
   So I think we can simplify this method by not specially dealing with boolean 
type, thus the added `ARROW_DCHECK` several lines above.



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