You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by GitBox <gi...@apache.org> on 2019/02/19 16:46:56 UTC
[GitHub] kgyrtkirk commented on a change in pull request #1053:
[CALCITE-2852] Simplification: traverse calculations and unknown UDFs
kgyrtkirk commented on a change in pull request #1053: [CALCITE-2852] Simplification: traverse calculations and unknown UDFs
URL: https://github.com/apache/calcite/pull/1053#discussion_r258129176
##########
File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
##########
@@ -284,8 +284,24 @@ RexNode simplify(RexNode e, RexUnknownAs unknownAs) {
case NOT_EQUALS:
return simplifyComparison((RexCall) e, unknownAs);
default:
+ if (e.getClass() == RexCall.class) {
+ return simplifyGenericNode((RexCall) e);
Review comment:
`simplifyGenericNode` runs simplification only on the call operands.
on the following testcase the code does 2047 rexnode visits ; tree is composed from 2047 nodes
```
@Test public void testSimplifyRecurseIntoArithmetics2() {
RexNode n = literal(3);
for (int i = 0; i < 10; i++) {
n = plus(n, n);
}
checkSimplify(
n,
"+(1, 2)");
}
```
...or is there something I miss here?
Do you have a testcase for this?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services