[ 
https://issues.apache.org/jira/browse/FLINK-30830?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Danny Cranmer resolved FLINK-30830.
-----------------------------------
    Resolution: Fixed

> Temporal Table Function Samples for Java Do Not Work As-Is, And Some 
> Functions Are Deprecated
> ---------------------------------------------------------------------------------------------
>
>                 Key: FLINK-30830
>                 URL: https://issues.apache.org/jira/browse/FLINK-30830
>             Project: Flink
>          Issue Type: Improvement
>          Components: Table SQL / API
>    Affects Versions: 1.16.1
>            Reporter: Jeremy Ber
>            Assignee: Jeremy Ber
>            Priority: Minor
>              Labels: developer-experience, pull-request-available
>             Fix For: 1.17.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In the java documentation for the [Temporal Table 
> Function|https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/concepts/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:}}
>  * 
> {{[https://nightlies.apache.org/flink/flink-docs-release-1.11/api/java/org/apache/flink/table/api/TableEnvironment.html#registerFunction-java.lang.String-org.apache.flink.table.functions.ScalarFunction-]}}
>  * 
> {{{}[https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/tableapi/#join-with-temporal-table]{}}}{{{{}}{}}}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to