Manya0407 commented on code in PR #6746:
URL: https://github.com/apache/hive/pull/6746#discussion_r4122149287


##########
ql/src/test/org/apache/hadoop/hive/ql/optimizer/calcite/stats/TestFilterSelectivityEstimator.java:
##########
@@ -1202,4 +1208,185 @@ private static long timestampMillis(String timestamp) {
   private static long timestamp(String timestamp) {
     return timestampMillis(timestamp) / 1000;
   }
+
+  private static final int INTEGER_FIELD_INDEX = 6; // f_integer
+  private static final int DATE_FIELD_INDEX = 9; // f_date
+
+  private void setupMinMaxNoHistogram(float min, float max) {
+    setupMinMaxNoHistogram(min, max, 0);
+  }
+
+  private void setupMinMaxNoHistogram(float min, float max, long numNulls) {
+    stats = new ColStatistics();
+    stats.setHistogram(null);
+    stats.setRange(min, max);
+    stats.setNumNulls(numNulls);
+    currentInputRef = REX_BUILDER.makeInputRef(scan, INTEGER_FIELD_INDEX);
+    doReturn(Collections.singletonList(stats)).when(tableMock)
+        .getColStat(Collections.singletonList(INTEGER_FIELD_INDEX));
+  }

Review Comment:
   Removed the helpers and extended useFieldWithValues to accept a null sketch 
(no histogram) and optional numNulls. Min/max tests now go through that path.



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