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

    https://github.com/apache/drill/pull/789#discussion_r108561492
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/columnreaders/ParquetRecordReader.java
 ---
    @@ -307,164 +231,49 @@ public FragmentContext getFragmentContext() {
         return fragmentContext;
       }
     
    -  /**
    -   * Returns data type length for a given {@see ColumnDescriptor} and it's 
corresponding
    -   * {@see SchemaElement}. Neither is enough information alone as the max
    -   * repetition level (indicating if it is an array type) is in the 
ColumnDescriptor and
    -   * the length of a fixed width field is stored at the schema level.
    -   *
    -   * @return the length if fixed width, else -1
    -   */
    -  private int getDataTypeLength(ColumnDescriptor column, SchemaElement se) 
{
    -    if (column.getType() != PrimitiveType.PrimitiveTypeName.BINARY) {
    -      if (column.getMaxRepetitionLevel() > 0) {
    -        return -1;
    -      }
    -      if (column.getType() == 
PrimitiveType.PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY) {
    -        return se.getType_length() * 8;
    -      } else {
    -        return getTypeLengthInBits(column.getType());
    -      }
    -    } else {
    -      return -1;
    -    }
    -  }
    -
    -  @SuppressWarnings({ "resource", "unchecked" })
       @Override
       public void setup(OperatorContext operatorContext, OutputMutator output) 
throws ExecutionSetupException {
         this.operatorContext = operatorContext;
    -    if (!isStarQuery()) {
    -      columnsFound = new boolean[getColumns().size()];
    -      nullFilledVectors = new ArrayList<>();
    +    if (isStarQuery()) {
    +      schema = new ParquetSchema(fragmentContext.getOptions(), 
rowGroupIndex);
    +    } else {
    +      schema = new ParquetSchema(fragmentContext.getOptions(), 
getColumns());
    --- End diff --
    
    why do we need to pass rowGroupIndex in one case and not other ? can we add 
comments here ? Is it possible to have a single constructor for ParquetSchema ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to