Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-14200

Temporal Table Function Joins do not work on Tables (only TableSources) on the query side

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    Description

      This only affects the Blink planner. The legacy planner works fine.

      With Orders as a TableSource, and Orders2 as a Table with the same content:

      tEnv.registerTableSource("Orders", new FooSource(new String[] {"o_currency", "o_amount", "o_proctime"}));
      Table orders2 = tEnv.sqlQuery("SELECT * FROM Orders");
      tEnv.registerTable("Orders2", orders2);

      This works (TableSource on the query side):

      SELECT 
       o_amount * r_amount AS amount 
      FROM Orders  
       , LATERAL TABLE (Rates(o_proctime)) 
      WHERE r_currency = o_currency

      While this does not (Table on the query side):

      SELECT 
       o_amount * r_amount AS amount 
      FROM Orders2 
       , LATERAL TABLE (Rates(o_proctime)) 
      WHERE r_currency = o_currency

      Throwing an NPE in FlinkRelBuilder, called from LogicalCorrelateToJoinFromTemporalTableFunctionRule. Attached is Java code for reproduction, along with the full log and stacktrace, and a pom.xml.

      EDIT: This may not be Table vs TableSource, maybe more a projection or a decorrelate issue? Don't know how the planner works well enough to characterize it better.

       

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            jark Jark Wu
            BenoitParis Benoît Paris
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m

                Slack

                  Issue deployment