You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by GitBox <gi...@apache.org> on 2021/05/21 15:06:13 UTC

[GitHub] [hive] tarak271 opened a new pull request #2308: HIVE-25150 : Tab characters are not removed before decimal conversion similar to space character which is fixed as part of HIVE-24378

tarak271 opened a new pull request #2308:
URL: https://github.com/apache/hive/pull/2308


   
   
   ### What changes were proposed in this pull request?
   Skipping tab characters before decimal conversion in decimal type column values
   
   ### Why are the changes needed?
   Comply with other Relational Databases like MySQL
   
   
   ### Does this PR introduce _any_ user-facing change?
   Yes, if decimal value contains tab character, then it will be trimmed and actual value is returned instead of returning NULL
   
   
   ### How was this patch tested?
   Qtest added in this PR
   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] maheshk114 commented on pull request #2308: HIVE-25150 : Tab characters are not removed before decimal conversion similar to space character which is fixed as part of HIVE-24378

Posted by GitBox <gi...@apache.org>.
maheshk114 commented on pull request #2308:
URL: https://github.com/apache/hive/pull/2308#issuecomment-855597524


   LGTM +1


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] maheshk114 commented on a change in pull request #2308: HIVE-25150 : Tab characters are not removed before decimal conversion similar to space character which is fixed as part of HIVE-24378

Posted by GitBox <gi...@apache.org>.
maheshk114 commented on a change in pull request #2308:
URL: https://github.com/apache/hive/pull/2308#discussion_r638695764



##########
File path: storage-api/src/java/org/apache/hadoop/hive/common/type/FastHiveDecimalImpl.java
##########
@@ -273,7 +269,8 @@ public static boolean fastSetFromBytes(byte[] bytes, int offset, int length, boo
     int index = offset;
 
     if (trimBlanks) {
-      while (bytes[index] == BYTE_BLANK) {
+      //Character.isWhitespace handles both space and tab character

Review comment:
       isWhitespace covers many more things like PARAGRAPH_SEPARATOR, LINE_SEPARATOR. How is the behaviour of other databases like postgres for that?




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] tarak271 commented on a change in pull request #2308: HIVE-25150 : Tab characters are not removed before decimal conversion similar to space character which is fixed as part of HIVE-24378

Posted by GitBox <gi...@apache.org>.
tarak271 commented on a change in pull request #2308:
URL: https://github.com/apache/hive/pull/2308#discussion_r643326657



##########
File path: storage-api/src/java/org/apache/hadoop/hive/common/type/FastHiveDecimalImpl.java
##########
@@ -273,7 +269,8 @@ public static boolean fastSetFromBytes(byte[] bytes, int offset, int length, boo
     int index = offset;
 
     if (trimBlanks) {
-      while (bytes[index] == BYTE_BLANK) {
+      //Character.isWhitespace handles both space and tab character

Review comment:
       @maheshk114 
   Added a new function to validate more characters supported by Mysql, postgres like HORIZONTAL_TABULATION, VERTICAL_TABULATION, FORM_FEED & SPACE_SEPARATOR




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] belugabehr commented on pull request #2308: HIVE-25150 : Tab characters are not removed before decimal conversion similar to space character which is fixed as part of HIVE-24378

Posted by GitBox <gi...@apache.org>.
belugabehr commented on pull request #2308:
URL: https://github.com/apache/hive/pull/2308#issuecomment-846126110


   Why not just use `Character#isWhitespace` ?


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] tarak271 commented on pull request #2308: HIVE-25150 : Tab characters are not removed before decimal conversion similar to space character which is fixed as part of HIVE-24378

Posted by GitBox <gi...@apache.org>.
tarak271 commented on pull request #2308:
URL: https://github.com/apache/hive/pull/2308#issuecomment-847024654


   @belugabehr changed logic with Character#isWhitespace 


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org


[GitHub] [hive] maheshk114 merged pull request #2308: HIVE-25150 : Tab characters are not removed before decimal conversion similar to space character which is fixed as part of HIVE-24378

Posted by GitBox <gi...@apache.org>.
maheshk114 merged pull request #2308:
URL: https://github.com/apache/hive/pull/2308


   


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org