deniskuzZ commented on code in PR #5195:
URL: https://github.com/apache/hive/pull/5195#discussion_r1615312714


##########
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java:
##########
@@ -1725,35 +1725,22 @@ private void populateAndCacheStripeDetails() throws 
IOException {
     }
 
     private long computeProjectionSize(List<OrcProto.Type> fileTypes,
-        List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) throws 
FileFormatException {
-      List<Integer> internalColIds = Lists.newArrayList();
+          List<OrcProto.ColumnStatistics> stats, boolean[] fileIncluded) 
throws FileFormatException {
+      final List<Integer> internalColIds;
+      // exclude ORC `Root` and ACID `Row` struct elements to avoid full 
schema size estimation   
       if (fileIncluded == null) {
-        // Add all.
-        for (int i = 0; i < fileTypes.size(); i++) {
-          internalColIds.add(i);
-        }
+        internalColIds = IntStream.range(1, fileTypes.size())
+          .boxed().collect(Collectors.toList());
       } else {
-        for (int i = 0; i < fileIncluded.length; i++) {
-          if (fileIncluded[i]) {
-            internalColIds.add(i);
-          }
-        }
+        internalColIds = IntStream.range(1, fileTypes.size())
+          .filter(i -> fileIncluded[i])
+          .filter(i -> isOriginal || i != OrcRecordUpdater.ROW + 1) 

Review Comment:
   this is not a root column, that Is an ACID <row> column. we should exclude 
`0` always + <row> struct id in case of non original ACID



-- 
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: gitbox-unsubscr...@hive.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to