flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wuchong <...@git.apache.org>
Subject [GitHub] flink issue #2102: [FLINK-4068] [tableAPI] Move constant computations out of...
Date Thu, 16 Jun 2016 15:26:42 GMT
Github user wuchong commented on the issue:

    https://github.com/apache/flink/pull/2102
  
    After introducing `RexExecutor` which make `ReduceExpressionRules` taking effect ,  many
errors occurred.  
    
    1. The `cannot translate call AS($t0, $t1)` is a Calcite bug I think, and I created a
related issue : [CALCITE-1295](https://issues.apache.org/jira/browse/CALCITE-1295).
    
    2. We should replace [L69&L73](https://github.com/apache/flink/blob/master/flink-libraries/flink-table/src/main/scala/org/apache/flink/api/table/expressions/arithmetic.scala#L69-L73)
to `relBuilder.call(SqlStdOperatorTable.CONCAT, l, cast)` otherwise will throw the following
exception. Because calcite have no plus(String, String) method. 
    
        ```
    java.lang.RuntimeException: while resolving method 'plus[class java.lang.String, class
java.lang.String]' in class class org.apache.calcite.runtime.SqlFunctions
    
    	at org.apache.calcite.linq4j.tree.Types.lookupMethod(Types.java:345)
    	at org.apache.calcite.linq4j.tree.Expressions.call(Expressions.java:442)
    	at org.apache.calcite.adapter.enumerable.RexImpTable$BinaryImplementor.implement(RexImpTable.java:1640)
    	at org.apache.calcite.adapter.enumerable.RexImpTable.implementCall(RexImpTable.java:854)
    	at org.apache.calcite.adapter.enumerable.RexImpTable.implementNullSemantics(RexImpTable.java:843)
    	at org.apache.calcite.adapter.enumerable.RexImpTable.implementNullSemantics0(RexImpTable.java:756)
    	at org.apache.calcite.adapter.enumerable.RexImpTable.access$900(RexImpTable.java:181)
    	at org.apache.calcite.adapter.enumerable.RexImpTable$3.implement(RexImpTable.java:411)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateCall(RexToLixTranslator.java:535)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate0(RexToLixTranslator.java:507)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:222)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate0(RexToLixTranslator.java:472)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:222)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:217)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateList(RexToLixTranslator.java:700)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateProjects(RexToLixTranslator.java:192)
    	at org.apache.calcite.rex.RexExecutorImpl.compile(RexExecutorImpl.java:80)
    	at org.apache.calcite.rex.RexExecutorImpl.compile(RexExecutorImpl.java:59)
    	at org.apache.calcite.rex.RexExecutorImpl.reduce(RexExecutorImpl.java:118)
    	at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressionsInternal(ReduceExpressionsRule.java:544)
    	at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:455)
    	at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:438)
    	at org.apache.calcite.rel.rules.ReduceExpressionsRule$CalcReduceExpressionsRule.onMatch(ReduceExpressionsRule.java:350)
    	at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:213)
    	at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:838)
    	at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:334)
    	at org.apache.flink.api.table.BatchTableEnvironment.translate(BatchTableEnvironment.scala:250)
    	at org.apache.flink.api.java.table.BatchTableEnvironment.toDataSet(BatchTableEnvironment.scala:146)
    	at org.apache.flink.api.java.batch.table.ExpressionsITCase.testCom
    ````
    
    3. The following error is when we convert `Trim` to `RexNode`, we use a Integer to represent
"LEADING", "TRAILING", "BOTH". Instead we should use `SqlTrimFunction.Flag`. But I haven't
found how to write SqlTrimFunction.Flag into a `RexNode`.
    
         ```
    java.lang.ClassCastException: java.lang.Integer cannot be cast to org.apache.calcite.sql.fun.SqlTrimFunction$Flag
    
    	at org.apache.calcite.adapter.enumerable.RexImpTable$TrimImplementor.implement(RexImpTable.java:1448)
    	at org.apache.calcite.adapter.enumerable.RexImpTable.implementCall(RexImpTable.java:854)
    	at org.apache.calcite.adapter.enumerable.RexImpTable.implementNullSemantics(RexImpTable.java:843)
    	at org.apache.calcite.adapter.enumerable.RexImpTable.implementNullSemantics0(RexImpTable.java:756)
    	at org.apache.calcite.adapter.enumerable.RexImpTable.access$900(RexImpTable.java:181)
    	at org.apache.calcite.adapter.enumerable.RexImpTable$3.implement(RexImpTable.java:411)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateCall(RexToLixTranslator.java:535)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate0(RexToLixTranslator.java:507)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:222)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate0(RexToLixTranslator.java:472)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:222)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translate(RexToLixTranslator.java:217)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateList(RexToLixTranslator.java:700)
    	at org.apache.calcite.adapter.enumerable.RexToLixTranslator.translateProjects(RexToLixTranslator.java:192)
    	at org.apache.calcite.rex.RexExecutorImpl.compile(RexExecutorImpl.java:80)
    	at org.apache.calcite.rex.RexExecutorImpl.compile(RexExecutorImpl.java:59)
    	at org.apache.calcite.rex.RexExecutorImpl.reduce(RexExecutorImpl.java:118)
    	at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressionsInternal(ReduceExpressionsRule.java:544)
    	at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:455)
    	at org.apache.calcite.rel.rules.ReduceExpressionsRule.reduceExpressions(ReduceExpressionsRule.java:438)
    	at org.apache.calcite.rel.rules.ReduceExpressionsRule$CalcReduceExpressionsRule.onMatch(ReduceExpressionsRule.java:350)
    	at org.apache.calcite.plan.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:213)
    	at org.apache.calcite.plan.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:838)
    	at org.apache.calcite.tools.Programs$RuleSetProgram.run(Programs.java:334)
    	at org.apache.flink.api.table.BatchTableEnvironment.translate(BatchTableEnvironment.scala:250)
    	at org.apache.flink.api.java.table.BatchTableEnvironment.toDataSet(BatchTableEnvironment.scala:146)
    	at org.apache.flink.api.java.batch.table.ExpressionsITCase.testComplexExpression(ExpressionsITCase.java:197)
    ```
    
    4. And some other errors I didn't figure out , looks like calcite bugs.
    
    
    



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message