You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "jfsii (via GitHub)" <gi...@apache.org> on 2023/03/10 22:23:26 UTC

[GitHub] [hive] jfsii commented on a diff in pull request #4110: HIVE-27133: Round off limit value greater than int_max to int_max

jfsii commented on code in PR #4110:
URL: https://github.com/apache/hive/pull/4110#discussion_r1132934825


##########
ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java:
##########
@@ -309,6 +309,7 @@
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.ReflectionUtils;
 
+

Review Comment:
   remove random line



##########
ql/src/test/queries/clientpositive/limit_max_int.q:
##########
@@ -0,0 +1,6 @@
+--! qt:dataset:src
+select key from src limit 214748364700;
+select key from src where key = '238' limit 214748364700;
+select * from src where key = '238' limit 214748364700;
+select src.key, count(src.value) from src group by src.key limit 214748364700;
+select * from ( select key from src limit 3) sq1 limit 214748364700;

Review Comment:
   is it possible to test underflow?



##########
common/src/java/org/apache/hive/common/util/HiveStringUtils.java:
##########
@@ -1174,4 +1175,25 @@ private static boolean isComment(String line) {
     return lineTrimmed.startsWith("#") || lineTrimmed.startsWith("--");
   }
 
+  /**
+   * Returns integer value of a string. If the string value exceeds max int, returns Integer.MAX_VALUE
+   * else if the string value is less than min int, returns Integer.MAX_VALUE

Review Comment:
   Likely meant MIN_VALUE rather than MAX_VALUE



-- 
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: gitbox-unsubscribe@hive.apache.org

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