[
https://issues.apache.org/jira/browse/HIVE-10616?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14608893#comment-14608893
]
Thomas Friedrich commented on HIVE-10616:
-----------------------------------------
The TypeInfoUtils class is documented as part of the public APIs
https://hive.apache.org/javadocs/r1.2.1/api/index.html. I don't see where the
class is marked as internal.
The ParseUtils class, method getDecimalTypeTypeInfo handles the case correctly:
int precision = HiveDecimal.USER_DEFAULT_PRECISION;
int scale = HiveDecimal.USER_DEFAULT_SCALE;
if (node.getChildCount() >= 1) {
String precStr = node.getChild(0).getText();
precision = Integer.valueOf(precStr);
}
if (node.getChildCount() == 2) {
String scaleStr = node.getChild(1).getText();
scale = Integer.valueOf(scaleStr);
}
Why can't the TypeInfoUtils have the same behavior instead of returning the
wrong values.
> TypeInfoUtils doesn't handle DECIMAL with just precision specified
> ------------------------------------------------------------------
>
> Key: HIVE-10616
> URL: https://issues.apache.org/jira/browse/HIVE-10616
> Project: Hive
> Issue Type: Bug
> Components: Serializers/Deserializers
> Affects Versions: 1.0.0
> Reporter: Thomas Friedrich
> Assignee: Thomas Friedrich
> Priority: Minor
> Attachments: HIVE-10616.1.patch
>
>
> The parseType method in TypeInfoUtils doesn't handle decimal types with just
> precision specified although that's a valid type definition.
> As a result, TypeInfoUtils.getTypeInfoFromTypeString will always return
> decimal(10,0) for any decimal(<precision>) string.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)