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

Temporal Table Function Samples for Java Do Not Work As-Is, And Some Functions Are Deprecated

    XMLWordPrintableJSON

Details

    Description

      In the java documentation for the Temporal Table Function, there are two issues with the APIs as-is.

      • Defining the temporal table calls `tEnv.registerFunction` which is a deprecated API since v1.11, favoring `createTemporarySystemFunction` instead.
      • In the Temporal Table Function Join syntax, calling `joinLateral($("rates(order_time)")` elicits the following error:

       

      Cannot resolve field [rates(order_time)] 

       

       

      For point 1, I am proposing we replace `tEnv.registerFunction()` with `tEnv.createTemporarySystemFunction`.

       

      For point 2, I am proposing we replace:

       

       

      Table result = orders.joinLateral($("rates(order_time)"), $("orders.currency = rates.currency")).select($("(o_amount * r_rate).sum as amount"));

       

      with

       

      Table result = orders.joinLateral(call("rates", $("o_proctime")), $("o_currency").isEqual($("r_currency"))).select($("(o_amount").times($("r_rate")).sum().as("amount")); 

       

      Sources for corrections:

      Attachments

        Issue Links

          Activity

            People

              jeremyber Jeremy Ber
              jeremyber Jeremy Ber
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 24h
                  24h
                  Remaining:
                  Remaining Estimate - 24h
                  24h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified