Github user arina-ielchiieva commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1138#discussion_r172600066
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroDrillTable.java
 ---
    @@ -58,16 +65,31 @@ public AvroDrillTable(String storageEngineName,
     
       @Override
       public RelDataType getRowType(RelDataTypeFactory typeFactory) {
    -    List<RelDataType> typeList = Lists.newArrayList();
    -    List<String> fieldNameList = Lists.newArrayList();
    +    // ExtendableRelDataTypeHolder is reused to preserve previously added 
implicit columns
    +    if (holder == null) {
    +      List<RelDataType> typeList = Lists.newArrayList();
    +      List<String> fieldNameList = Lists.newArrayList();
     
    -    Schema schema = reader.getSchema();
    -    for (Field field : schema.getFields()) {
    -      fieldNameList.add(field.name());
    -      typeList.add(getNullableRelDataTypeFromAvroType(typeFactory, 
field.schema()));
    +      // adds partition columns to RowType
    +      List<String> partitions = 
ColumnExplorer.getPartitions(((FormatSelection) getSelection()).getSelection(), 
schemaConfig);
    --- End diff --
    
    1. Is it safe to cast to `FormatSelection` without checking?
    2. Please update the comment - `adds partition columns to RowType` -> `adds 
partition columns to RowType since they always present in star queries`.


---

Reply via email to