You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by "mihaibudiu (via GitHub)" <gi...@apache.org> on 2024/07/08 19:49:02 UTC
Re: [PR] [CALCITE-6448] FilterReduceExpressionsRule returns empty RelNode for R… [calcite]
mihaibudiu commented on code in PR #3849:
URL: https://github.com/apache/calcite/pull/3849#discussion_r1669201362
##########
piglet/src/test/java/org/apache/calcite/test/PigRelExTest.java:
##########
@@ -145,76 +145,76 @@ public void testMatch() {
}
@Test void testAdd() {
- checkTranslation("b + 3", inTree("+($1, 3)"));
+ checkTranslation("(boolean)(b + 3)", inTree("+($1, 3)"));
Review Comment:
what is the meaning of this expression?
##########
core/src/main/java/org/apache/calcite/rel/core/Filter.java:
##########
@@ -85,6 +86,8 @@ protected Filter(
RexNode condition) {
super(cluster, traits, child);
this.condition = requireNonNull(condition, "condition");
+ assert SqlTypeName.BOOLEAN == condition.getType().getSqlTypeName()
Review Comment:
I am not sure this is always true; for example, before validation where casts are introduced this may not hold.
Also, Calcite does not always represent SQL implicit casts explicitly, so the cast to Boolean which is implied here may not be in the program.
##########
core/src/test/java/org/apache/calcite/test/RelBuilderTest.java:
##########
@@ -2650,19 +2650,17 @@ private static RelBuilder assertSize(RelBuilder b,
b.scan("EMP")
.scan("DEPT")
.join(JoinRelType.INNER,
- b.or(b.literal(null),
- b.and(b.equals(b.field(2, 0, "DEPTNO"), b.literal(1)),
- b.equals(b.field(2, 0, "DEPTNO"), b.literal(2)),
- b.equals(b.field(2, 1, "DEPTNO"),
- b.field(2, 0, "DEPTNO")))))
+ b.and(b.equals(b.field(2, 0, "DEPTNO"), b.literal(1)),
Review Comment:
why are you modifying this test?
--
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: commits-unsubscribe@calcite.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org