zabetak commented on code in PR #5196: URL: https://github.com/apache/hive/pull/5196#discussion_r2048602840
########## ql/src/test/org/apache/hadoop/hive/ql/optimizer/calcite/stats/TestFilterSelectivityEstimator.java: ########## @@ -508,8 +485,16 @@ public void testComputeRangePredicateSelectivityBetweenWithNULLS() { public void testComputeRangePredicateSelectivityNotBetweenWithNULLS() { doReturn((double) 20).when(tableMock).getRowCount(); doReturn(Collections.singletonList(stats)).when(tableMock).getColStat(Collections.singletonList(0)); - RexNode filter = REX_BUILDER.makeCall(SqlStdOperatorTable.BETWEEN, boolTrue, inputRef0, int1, int3); + RexNode filter = makeNotBetween(inputRef0, int1, int3); FilterSelectivityEstimator estimator = new FilterSelectivityEstimator(scan, mq); Assert.assertEquals(0.55, estimator.estimateSelectivity(filter), DELTA); } + + private RexNode makeNotBetween(RexNode inputRef, RexNode left, RexNode right) { + RexNode notBetween = REX_BUILDER + .makeCall(SqlStdOperatorTable.NOT, REX_BUILDER.makeBetween(inputRef, left, right)); + RexSimplify simplify = new RexSimplify(REX_BUILDER, RelOptPredicateList.EMPTY, RexUtil.EXECUTOR); + + return simplify.simplify(notBetween); Review Comment: The simplification was removed by latest commits. -- 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