paul-rogers commented on a change in pull request #1870: DRILL-7359: Add 
support for DICT type in RowSet Framework
URL: https://github.com/apache/drill/pull/1870#discussion_r361604989
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/physical/resultSet/impl/ColumnBuilder.java
 ##########
 @@ -179,6 +189,19 @@ private ColumnState buildPrimitive(ContainerState parent, 
ColumnReadProjection c
         vectorState);
   }
 
+  /**
+   * Check if this is a special case when vector, writer and column state 
should be
+   * created for a primitive field though the field itself is not projected. 
This is
+   * needed because {@code DICT}'s {@code keys} field is not projected but is 
needed
+   * to be initialized to ensure the dict vector is constructed properly.
 
 Review comment:
   We have something similar with arrays:
   
   ```
   SELECT a[1], a[3] FROM ...
   ```
   
   In this case, only two (of possibly many) array positions are indexed.
   
   The rule adopted in the code is that if *any* index is projected, then the 
entire array is projected in the Scan operator. The Project operator will 
fiddle around with the array and pick out the two needed indexes.
   
   So, can we do the same here? If the user refers to any DICT entry, the Scan 
projects the entire DICT and some other operator worries about the details.
   
   This *seems* to make sense because I can't see of any reasonable way that 
within-array or within-DICT selection could be done in the Scan.
   
   (That said, I do hope, at some point, we can emulate Impala: push the filter 
into the scan. The ResultSetLoader is designed for this, but only at the row 
level. I suppose we could do it at the array element level with a bit of work.)

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


With regards,
Apache Git Services

Reply via email to