Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1138#discussion_r171606330
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/avro/AvroRecordReader.java
 ---
    @@ -154,6 +156,12 @@ public int next() {
     
           writer.setValueCount(recordCount);
     
    +      // adds fields which don't exist in the table but should be present 
in the schema
    +      if (recordCount > 0) {
    +        JsonReaderUtils.ensureAtLeastOneField(writer, getColumns(), false,
    --- End diff --
    
    In general, this is a bad idea, though existing code does this. If we find 
an empty file in one scanner, but a real file in another, we create an 
unnecessary schema change by making up a column.
    
    Jinfeng's changes last year are supposed to handle the "fast none" case of 
a reader with no rows. There should be no reason to add a dummy column. Old 
code that adds such a column should be fixed. IMHO, code that does not add 
dummy columns should not begin to do so.


---

Reply via email to