Copilot commented on code in PR #6846:
URL: https://github.com/apache/hive/pull/6846#discussion_r4186986954


##########
llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapRecordReader.java:
##########
@@ -23,7 +23,6 @@
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.HashMap;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;

Review Comment:
   `ArrayList` is used later in this diff but no `java.util.ArrayList` import 
is shown (and `LinkedList` import was removed). If `ArrayList` isn’t imported 
elsewhere in the file, this will fail compilation; add `import 
java.util.ArrayList;`.



##########
llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapRecordReader.java:
##########
@@ -228,6 +227,8 @@ private LlapRecordReader(MapWork mapWork, JobConf job, 
FileSplit split,
     // Create the consumer of encoded data; it will coordinate decoding to 
CVBs.
     feedback = rp = cvp.createReadPipeline(this, split, includes, sarg, 
counters, includes,
         sourceInputFormat, sourceSerDe, reporter, job, 
mapWork.getPathToPartitionInfo());
+    missingColIndices = includes.getReaderLogicalColumnIds().stream()
+        .filter(idx -> 
!includes.getLogicalOrderedColumnIds().contains(idx)).toList();

Review Comment:
   `Stream.toList()` requires newer Java versions (added after Java 11). If 
this module targets Java 8/11 (common for Hive), this will not compile. Use 
`collect(Collectors.toList())` (and import `java.util.stream.Collectors`) or 
keep the prior `collect(toList())` approach.



##########
llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapRecordReader.java:
##########
@@ -228,6 +227,8 @@ private LlapRecordReader(MapWork mapWork, JobConf job, 
FileSplit split,
     // Create the consumer of encoded data; it will coordinate decoding to 
CVBs.
     feedback = rp = cvp.createReadPipeline(this, split, includes, sarg, 
counters, includes,
         sourceInputFormat, sourceSerDe, reporter, job, 
mapWork.getPathToPartitionInfo());
+    missingColIndices = includes.getReaderLogicalColumnIds().stream()
+        .filter(idx -> 
!includes.getLogicalOrderedColumnIds().contains(idx)).toList();

Review Comment:
   This still does `List.contains` inside a stream filter, which remains O(n*m) 
in number of projected columns vs. ordered columns (just moved to 
constructor-time). Consider building a `Set<Integer>` from 
`getLogicalOrderedColumnIds()` once, then filter using `set.contains(idx)` to 
make membership checks O(1).



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