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

    https://github.com/apache/drill/pull/819#discussion_r113606842
  
    --- Diff: 
contrib/storage-hive/core/src/main/java/org/apache/drill/exec/store/hive/HiveUtilities.java
 ---
    @@ -294,10 +296,21 @@ public static MajorType 
getMajorTypeFromHiveTypeInfo(final TypeInfo typeInfo, fi
             MajorType.Builder typeBuilder = 
MajorType.newBuilder().setMinorType(minorType)
                 .setMode(DataMode.OPTIONAL); // Hive columns (both regular and 
partition) could have null values
     
    -        if (primitiveTypeInfo.getPrimitiveCategory() == 
PrimitiveCategory.DECIMAL) {
    -          DecimalTypeInfo decimalTypeInfo = (DecimalTypeInfo) 
primitiveTypeInfo;
    -          typeBuilder.setPrecision(decimalTypeInfo.precision())
    -              .setScale(decimalTypeInfo.scale()).build();
    +        switch (primitiveTypeInfo.getPrimitiveCategory()) {
    +          case CHAR:
    +          case VARCHAR:
    +            BaseCharTypeInfo baseCharTypeInfo = (BaseCharTypeInfo) 
primitiveTypeInfo;
    +            typeBuilder.setPrecision(baseCharTypeInfo.getLength());
    +            break;
    +          case STRING:
    +            typeBuilder.setPrecision(HiveVarchar.MAX_VARCHAR_LENGTH);
    +            break;
    +          case DECIMAL:
    +            DecimalTypeInfo decimalTypeInfo = (DecimalTypeInfo) 
primitiveTypeInfo;
    +            
typeBuilder.setPrecision(decimalTypeInfo.getPrecision()).setScale(decimalTypeInfo.getScale());
    --- End diff --
    
    We are now considering decimal precision and scale. The precision 
determines which Decimal minor type must be used. Shouldn't the Hive-to-Drill 
type conversion consider the precision and scale earlier?


---
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