pavibhai commented on a change in pull request #635:
URL: https://github.com/apache/orc/pull/635#discussion_r574102411



##########
File path: 
java/mapreduce/src/java/org/apache/orc/mapred/OrcMapredRecordReader.java
##########
@@ -98,16 +101,22 @@ public boolean next(NullWritable key, V value) throws 
IOException {
     if (!ensureBatch()) {
       return false;
     }
+    int rowIdx = batch.selectedInUse ? batch.selected[rowInBatch] : rowInBatch;
     if (schema.getCategory() == TypeDescription.Category.STRUCT) {
       OrcStruct result = (OrcStruct) value;
       List<TypeDescription> children = schema.getChildren();
       int numberOfChildren = children.size();
       for(int i=0; i < numberOfChildren; ++i) {
-        result.setFieldValue(i, nextValue(batch.cols[i], rowInBatch,
-            children.get(i), result.getFieldValue(i)));
+        TypeDescription child = children.get(i);
+        if (included == null || included[child.getId()]) {
+          result.setFieldValue(i, nextValue(batch.cols[i], rowIdx, child,
+                                            result.getFieldValue(i)));
+        } else {
+          result.setFieldValue(i, null);
+        }

Review comment:
       Yes, we could. I need some guidance now on which changes can be combined 
or not.
   
   So far we seem to have the following changes that are requested that we pull 
out separately:
   1. Code changes like making a variable final or using the UTF8 Character Set
   2. Changes to MapReduce classes
   3. Findbugs exclude update
   
   Can I create one PR that includes all of this or do you want separate PRs 
for each item that you requested a separate PR for?




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to