Github user vvysotskyi commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1138#discussion_r172620291
  
    --- 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. Yes, it is safe, since we are using the same `FormatSelection` instance 
as we passed to the parent constructor.
    2. Thanks, done.


---

Reply via email to