YuvalItzchakov commented on pull request #15307:
URL: https://github.com/apache/flink/pull/15307#issuecomment-814038105


   @fsk119 Sorry for all the comments, I'm just braindumping as I work. ATM I'm 
failing on a test that's related to filter pushdown with no watermark assigner 
(meaning using the existing `PushFilterIntoTableSourceScanRule`). 
   
   Test:
   
   ```scala
     @Test def testFullPushdownWithoutWatermarkAssigner(): Unit = {
       val ddl3 =
         """
           |CREATE TABLE NoWatermark (
           |  name STRING,
           |  event_time TIMESTAMP(3)
           |) WITH (
           |  'connector' = 'values',
           |  'filterable-fields' = 'name',
           |  'bounded' = 'false',
           |  'disable-lookup' = 'true'
           |)
           |""".stripMargin
   
       util.tableEnv.executeSql(ddl3)
       util.verifyExecPlan("SELECT * FROM NoWatermark WHERE LOWER(name) = 'foo' 
AND UPPER(name) = 'FOO'")
     }
   ```
   
   During optimization, it fails with the following error:
   
       java.lang.AssertionError: Relational expression 
rel#203:HepRelVertex(rel#198:FlinkLogicalTableSourceScan.LOGICAL.any.None: 
0.[NONE].[NONE](table=[default_catalog, default_database, NoWatermark, 
filter=[and(equals(lower(name), 'foo'), equals(upper(name), 
'FOO'))]],fields=name, event_time)) has calling-convention LOGICAL but does not 
implement the required interface 'interface 
org.apache.flink.table.planner.plan.nodes.logical.FlinkLogicalRel' of that 
convention
   
       at 
org.apache.calcite.plan.volcano.VolcanoPlanner.registerImpl(VolcanoPlanner.java:1123)
            at 
org.apache.calcite.plan.volcano.VolcanoPlanner.register(VolcanoPlanner.java:589)
            at 
org.apache.calcite.plan.volcano.VolcanoPlanner.ensureRegistered(VolcanoPlanner.java:604)
            at 
org.apache.calcite.plan.volcano.VolcanoPlanner.changeTraits(VolcanoPlanner.java:486)
            at org.apache.calcite.plan.RelOptRule.convert(RelOptRule.java:622)
            at 
org.apache.calcite.rel.rules.ProjectRemoveRule.onMatch(ProjectRemoveRule.java:66)
            at 
org.apache.calcite.plan.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:333)
            at 
org.apache.calcite.plan.hep.HepPlanner.applyRule(HepPlanner.java:542)
            at 
org.apache.calcite.plan.hep.HepPlanner.applyRules(HepPlanner.java:407)
            at 
org.apache.calcite.plan.hep.HepPlanner.executeInstruction(HepPlanner.java:271)
            at 
org.apache.calcite.plan.hep.HepInstruction$RuleCollection.execute(HepInstruction.java:74)
            at 
org.apache.calcite.plan.hep.HepPlanner.executeProgram(HepPlanner.java:202)
            at 
org.apache.calcite.plan.hep.HepPlanner.findBestExp(HepPlanner.java:189)
            at 
org.apache.flink.table.planner.plan.optimize.program.FlinkHepProgram.optimize(FlinkHepProgram.scala:69)
   
   Debugging this, I'm not sure why a `HepRelVertex` is being pushed in to 
`registerImpl` instead of the underlying `FlinkLogicalTableSourceScan`.


-- 
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to