Copilot commented on code in PR #5637:
URL: https://github.com/apache/hive/pull/5637#discussion_r2160797501


##########
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java:
##########
@@ -923,15 +923,15 @@ private static ColStatistics estimateColStats(long 
numRows, String colName, Hive
       cs.setAvgColLen(JavaDataModel.get().primitive1());
       cs.setRange(-128,127);
     }
-    else if(colTypeLowerCase.equals(serdeConstants.SMALLINT_TYPE_NAME)){
+    else if (colTypeLowerCase.equals(serdeConstants.SMALLINT_TYPE_NAME)){
       cs.setAvgColLen(JavaDataModel.get().primitive1());
       cs.setRange(-32768, 32767);
-    } else if(colTypeLowerCase.equals(serdeConstants.INT_TYPE_NAME)) {
+    } else if (colTypeLowerCase.equals(serdeConstants.INT_TYPE_NAME)) {
       cs.setAvgColLen(JavaDataModel.get().primitive1());
-      cs.setRange(Long.MIN_VALUE, Long.MAX_VALUE);
+      cs.setRange(Integer.MIN_VALUE, Integer.MAX_VALUE);
     } else if (colTypeLowerCase.equals(serdeConstants.BIGINT_TYPE_NAME)) {
       cs.setAvgColLen(JavaDataModel.get().primitive2());
-      cs.setRange(Integer.MIN_VALUE, Integer.MAX_VALUE);
+      cs.setRange(Long.MIN_VALUE, Long.MAX_VALUE);

Review Comment:
   For the BIGINT type, the range is now properly set using Long.MIN_VALUE and 
Long.MAX_VALUE instead of the 32-bit integer bounds.



##########
ql/src/java/org/apache/hadoop/hive/ql/stats/StatsUtils.java:
##########
@@ -923,15 +923,15 @@ private static ColStatistics estimateColStats(long 
numRows, String colName, Hive
       cs.setAvgColLen(JavaDataModel.get().primitive1());
       cs.setRange(-128,127);
     }
-    else if(colTypeLowerCase.equals(serdeConstants.SMALLINT_TYPE_NAME)){
+    else if (colTypeLowerCase.equals(serdeConstants.SMALLINT_TYPE_NAME)){
       cs.setAvgColLen(JavaDataModel.get().primitive1());
       cs.setRange(-32768, 32767);
-    } else if(colTypeLowerCase.equals(serdeConstants.INT_TYPE_NAME)) {
+    } else if (colTypeLowerCase.equals(serdeConstants.INT_TYPE_NAME)) {
       cs.setAvgColLen(JavaDataModel.get().primitive1());
-      cs.setRange(Long.MIN_VALUE, Long.MAX_VALUE);
+      cs.setRange(Integer.MIN_VALUE, Integer.MAX_VALUE);

Review Comment:
   For the INT type, the range is now correctly set using Integer.MIN_VALUE and 
Integer.MAX_VALUE instead of the full 64-bit long bounds.



-- 
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-unsubscr...@hive.apache.org

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


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

Reply via email to