JiajunBernoulli commented on code in PR #3316:
URL: https://github.com/apache/calcite/pull/3316#discussion_r1278526027
##########
core/src/test/java/org/apache/calcite/rex/RexProgramTest.java:
##########
@@ -801,6 +808,40 @@ private void checkExponentialCnf(int n) {
and(eRef,
or(fRef,
and(gRef, or(trueLiteral, falseLiteral)))))))));
+
+ // In order to test the pullFactors RexNode operands in deterministic order
+ checkPullFactors(
+ or(
+ and(eq(aRef, bRef), eq(jRef, literal("Brand#12")), ge(hRef,
literal(1)),
+ le(hRef, literal(11)), cRef, rexBuilder.makeIn(
+ iRef, ImmutableList.of(literal("AIR"), literal("AIR
REG"))),
+ rexBuilder.makeIn(
+ kRef, ImmutableList.of(literal("SM BOX"),
+ literal("SM CASE"), literal("SM PACK"), literal("SM
PKG")))),
+
+ and(eq(aRef, bRef), eq(jRef, literal("Brand#13")), ge(hRef,
literal(10)),
+ le(hRef, literal(20)), cRef, rexBuilder.makeIn(
+ iRef, ImmutableList.of(literal("AIR"), literal("AIR
REG"))),
+ rexBuilder.makeIn(
+ kRef, ImmutableList.of(literal("MED BOX"),
+ literal("MED CASE"), literal("MED PACK"), literal("MED
PKG")))),
+
+ and(eq(aRef, bRef), eq(jRef, literal("Brand#14")), ge(hRef,
literal(20)),
+ le(hRef, literal(30)), cRef, rexBuilder.makeIn(
+ iRef, ImmutableList.of(literal("AIR"), literal("AIR
REG"))),
+ rexBuilder.makeIn(
+ kRef, ImmutableList.of(literal("LG BOX"),
+ literal("LG CASE"), literal("LG PACK"), literal("LG
PKG"))))),
+
+ "AND(=(?0.a, ?0.b), ?0.c, "
+ + "SEARCH(?0.i, Sarg['AIR':CHAR(7), 'AIR REG']:CHAR(7)), "
+ + "OR(AND(=(?0.j, 'Brand#12'), >=(?0.h, 1), <=(?0.h, 11),"
Review Comment:
The PR looks good.
@LakeShen I have a small question.
If it's out of order, what might it look like?
--
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]