zhangbutao commented on code in PR #4417:
URL: https://github.com/apache/hive/pull/4417#discussion_r1229810018


##########
serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/TypeInfoUtils.java:
##########
@@ -489,7 +489,7 @@ private TypeInfo parseType() {
           } else if (params.length == 2) {
             // New metadata always have two parameters.
             precision = Integer.parseInt(params[0]);
-            scale = Integer.parseInt(params[1]);
+            scale = Integer.parseInt(params[1].trim());

Review Comment:
   Thanks for fixing this issue. IMO, we can fix it in upstream invoking code, 
then we can avoid other potential type problems caused by the  blank character. 
Like this:
   
   ```
   diff --git 
a/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/TypeInfoUtils.java 
b/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/TypeInfoUtils.java
   index b23e3cfc44..4788558d4b 100644
   --- 
a/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/TypeInfoUtils.java
   +++ 
b/serde/src/java/org/apache/hadoop/hive/serde2/typeinfo/TypeInfoUtils.java
   @@ -334,7 +334,7 @@ private static boolean isTypeChar(char c) {
                || !isTypeChar(typeInfoString.charAt(end))) {
              Token t = new Token();
              t.position = begin;
   -          t.text = typeInfoString.substring(begin, end);
   +          t.text = typeInfoString.substring(begin, end).trim();
              t.isType = isTypeChar(typeInfoString.charAt(begin));
              tokens.add(t);
              begin = end;
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to