KazydubB commented on a change in pull request #1954: DRILL-7509: Incorrect 
TupleSchema is created for DICT column when querying Parquet files
URL: https://github.com/apache/drill/pull/1954#discussion_r366851158
 
 

 ##########
 File path: 
metastore/metastore-api/src/main/java/org/apache/drill/metastore/util/SchemaPathUtils.java
 ##########
 @@ -50,7 +51,7 @@ public static ColumnMetadata getColumnMetadata(SchemaPath 
schemaPath, TupleMetad
     while (!colPath.isLastPath() && colMetadata != null) {
       if (colMetadata.isDict()) {
         // get dict's value field metadata
-        colMetadata = 
colMetadata.tupleSchema().metadata(0).tupleSchema().metadata(1);
+        colMetadata = colMetadata.tupleSchema().metadata(1);
 
 Review comment:
   That's a good point, a `keyMetadata()` and `valueMetadata()` can be defined 
in `DictColumnMetadata` (as an another to what you've suggested; but that'd 
require casting).
   
   I don't see a strong need to have a static mapping of `key` and `value` for 
`DICT`, as the existing mechanism does the work and suits well for the case (at 
least, to my understanding). But I do agree that hiding this implementation 
details is better practice. Will introduce a new method.

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