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

    https://github.com/apache/drill/pull/637#discussion_r86018491
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/store/parquet/Metadata.java 
---
    @@ -329,79 +330,118 @@ private OriginalType getOriginalType(Type type, 
String[] path, int depth) {
         return getOriginalType(t, path, depth + 1);
       }
     
    +  private ColTypeInfo getColTypeInfo(MessageType schema, Type type, 
String[] path, int depth) {
    +    if (type.isPrimitive()) {
    +      PrimitiveType primitiveType = (PrimitiveType) type;
    +      int precision = 0;
    +      int scale = 0;
    +      if (primitiveType.getDecimalMetadata() != null) {
    +        precision = primitiveType.getDecimalMetadata().getPrecision();
    +        scale = primitiveType.getDecimalMetadata().getScale();
    +      }
    +
    +      int repetitionLevel = schema.getMaxRepetitionLevel(path);
    +
    +      return new ColTypeInfo(type.getOriginalType(), precision, scale, 
repetitionLevel);
    +    }
    +    Type t = ((GroupType) type).getType(path[depth]);
    +    return getColTypeInfo(schema, t, path, depth + 1);
    +  }
    +
    +  private class ColTypeInfo {
    +    public OriginalType originalType;
    +    public int precision;
    +    public int scale;
    +    public int repetitionLevel;
    --- End diff --
    
    Should we include definition level as well (for future use?)


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to