This is an automated email from the ASF dual-hosted git repository.

MartijnVisser pushed a commit to branch release-1.20
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.20 by this push:
     new cd6bb6fd44a [hotfix][docs] Fix temporal table function examples 
(#29717)
cd6bb6fd44a is described below

commit cd6bb6fd44ab0a04bed73b33a196acb6d7b1aaba
Author: Martijn Visser <[email protected]>
AuthorDate: Sat Oct 31 20:15:38 2026 +0100

    [hotfix][docs] Fix temporal table function examples (#29717)
    
    createTemporalTableFunction only takes expressions since 1.16, the join
    examples referenced columns that do not exist, and the SQL example used
    the rates alias without declaring it. Fixed in both the EN and ZH pages.
    
    Co-authored-by: novakov-alexey 
<[email protected]>
    Generated-by: Claude Code (Claude Opus 5.5)
    (cherry picked from commit cd4c2ab77b7109a64605dba18758f682a181bd2e)
---
 .../dev/table/concepts/temporal_table_function.md  | 22 ++++++++++++++--------
 docs/content.zh/docs/dev/table/tableApi.md         |  6 +++---
 .../dev/table/concepts/temporal_table_function.md  | 22 ++++++++++++++--------
 docs/content/docs/dev/table/tableApi.md            |  6 +++---
 4 files changed, 34 insertions(+), 22 deletions(-)

diff --git a/docs/content.zh/docs/dev/table/concepts/temporal_table_function.md 
b/docs/content.zh/docs/dev/table/concepts/temporal_table_function.md
index ef2800378e6..18486fbac22 100644
--- a/docs/content.zh/docs/dev/table/concepts/temporal_table_function.md
+++ b/docs/content.zh/docs/dev/table/concepts/temporal_table_function.md
@@ -62,16 +62,16 @@ the versioning time attribute.
 ```java
 TemporalTableFunction rates = tEnv
     .from("currency_rates")
-    .createTemporalTableFunction("update_time", "currency");
+    .createTemporalTableFunction($("update_time"), $("currency"));
  
 tEnv.createTemporarySystemFunction("rates", rates);                            
                               
 ```
 {{< /tab >}}
 {{< tab "Scala" >}}
 ```scala
-rates = tEnv
+val rates = tEnv
     .from("currency_rates")
-    .createTemporalTableFunction("update_time", "currency")
+    .createTemporalTableFunction($"update_time", $"currency")
  
 tEnv.createTemporarySystemFunction("rates", rates);                            
                               
 ```
@@ -112,23 +112,29 @@ SELECT
   SUM(amount * rate) AS amount
 FROM
   orders,
-  LATERAL TABLE (rates(order_time))
+  LATERAL TABLE (rates(order_time)) AS rates
 WHERE
   rates.currency = orders.currency
 ```
 {{< /tab >}}
 {{< tab "Java" >}}
 ```java
+Table orders = tEnv.from("orders");
 Table result = orders
-    .joinLateral(call("rates", $("o_proctime")), 
$("o_currency").isEqual($("r_currency")))
-    .select($("(o_amount").times($("r_rate")).sum().as("amount"));
+    .joinLateral(
+        call("rates", $("order_time")).as("r_update_time", "r_currency", 
"r_rate"),
+        $("currency").isEqual($("r_currency")))
+    .select($("amount").times($("r_rate")).sum().as("amount"));
 ```
 {{< /tab >}}
 {{< tab "Scala" >}}
 ```scala
+val orders = tEnv.from("orders")
 val result = orders
-    .joinLateral($"rates(order_time)", $"orders.currency = rates.currency")
-    .select($"(o_amount * r_rate).sum as amount"))
+    .joinLateral(
+        call("rates", $"order_time").as("r_update_time", "r_currency", 
"r_rate"),
+        $"currency" === $"r_currency")
+    .select(($"amount" * $"r_rate").sum as "amount")
 ```
 {{< /tab >}}
 {{< tab "Python" >}}
diff --git a/docs/content.zh/docs/dev/table/tableApi.md 
b/docs/content.zh/docs/dev/table/tableApi.md
index 500932df35c..c6efd9ad1e5 100644
--- a/docs/content.zh/docs/dev/table/tableApi.md
+++ b/docs/content.zh/docs/dev/table/tableApi.md
@@ -1124,8 +1124,8 @@ Table ratesHistory = tableEnv.from("RatesHistory");
 
 // 注册带有时间属性和主键的 temporal table function
 TemporalTableFunction rates = ratesHistory.createTemporalTableFunction(
-    "r_proctime",
-    "r_currency");
+    $("r_proctime"),
+    $("r_currency"));
 tableEnv.createTemporarySystemFunction("rates", rates);
 
 // 基于时间属性和键与“Orders”表关联
@@ -1143,7 +1143,7 @@ val rates = 
ratesHistory.createTemporalTableFunction($"r_proctime", $"r_currency
 // 基于时间属性和键与“Orders”表关联
 val orders = tableEnv.from("Orders")
 val result = orders
-    .joinLateral(rates($"o_rowtime"), $"r_currency" === $"o_currency")
+    .joinLateral(rates($"o_proctime"), $"r_currency" === $"o_currency")
 ```
 {{< /tabs >}}
 {{< tab "Python" >}}
diff --git a/docs/content/docs/dev/table/concepts/temporal_table_function.md 
b/docs/content/docs/dev/table/concepts/temporal_table_function.md
index 25e9d817a24..974f14d3cf0 100644
--- a/docs/content/docs/dev/table/concepts/temporal_table_function.md
+++ b/docs/content/docs/dev/table/concepts/temporal_table_function.md
@@ -62,16 +62,16 @@ the versioning time attribute.
 ```java
 TemporalTableFunction rates = tEnv
     .from("currency_rates")
-    .createTemporalTableFunction("update_time", "currency");
+    .createTemporalTableFunction($("update_time"), $("currency"));
  
 tEnv.createTemporarySystemFunction("rates", rates);                            
                            
 ```
 {{< /tab >}}
 {{< tab "Scala" >}}
 ```scala
-rates = tEnv
+val rates = tEnv
     .from("currency_rates")
-    .createTemporalTableFunction("update_time", "currency")
+    .createTemporalTableFunction($"update_time", $"currency")
  
 tEnv.createTemporarySystemFunction("rates", rates)
 ```
@@ -112,23 +112,29 @@ SELECT
   SUM(amount * rate) AS amount
 FROM
   orders,
-  LATERAL TABLE (rates(order_time))
+  LATERAL TABLE (rates(order_time)) AS rates
 WHERE
   rates.currency = orders.currency
 ```
 {{< /tab >}}
 {{< tab "Java" >}}
 ```java
+Table orders = tEnv.from("orders");
 Table result = orders
-    .joinLateral(call("rates", $("o_proctime")), 
$("o_currency").isEqual($("r_currency")))
-    .select($("(o_amount").times($("r_rate")).sum().as("amount"));
+    .joinLateral(
+        call("rates", $("order_time")).as("r_update_time", "r_currency", 
"r_rate"),
+        $("currency").isEqual($("r_currency")))
+    .select($("amount").times($("r_rate")).sum().as("amount"));
 ```
 {{< /tab >}}
 {{< tab "Scala" >}}
 ```scala
+val orders = tEnv.from("orders")
 val result = orders
-    .joinLateral($"rates(order_time)", $"orders.currency = rates.currency")
-    .select($"(o_amount * r_rate).sum as amount"))
+    .joinLateral(
+        call("rates", $"order_time").as("r_update_time", "r_currency", 
"r_rate"),
+        $"currency" === $"r_currency")
+    .select(($"amount" * $"r_rate").sum as "amount")
 ```
 {{< /tab >}}
 {{< tab "Python" >}}
diff --git a/docs/content/docs/dev/table/tableApi.md 
b/docs/content/docs/dev/table/tableApi.md
index 47e598e713e..9ce59478f88 100644
--- a/docs/content/docs/dev/table/tableApi.md
+++ b/docs/content/docs/dev/table/tableApi.md
@@ -1123,8 +1123,8 @@ Table ratesHistory = tableEnv.from("RatesHistory");
 
 // register temporal table function with a time attribute and primary key
 TemporalTableFunction rates = ratesHistory.createTemporalTableFunction(
-    "r_proctime",
-    "r_currency");
+    $("r_proctime"),
+    $("r_currency"));
 tableEnv.createTemporarySystemFunction("rates", rates);
 
 // join with "Orders" based on the time attribute and key
@@ -1142,7 +1142,7 @@ val rates = 
ratesHistory.createTemporalTableFunction($"r_proctime", $"r_currency
 // join with "Orders" based on the time attribute and key
 val orders = tableEnv.from("Orders")
 val result = orders
-    .joinLateral(rates($"o_rowtime"), $"r_currency" === $"o_currency")
+    .joinLateral(rates($"o_proctime"), $"r_currency" === $"o_currency")
 ```
 {{< /tabs >}}
 {{< tab "Python" >}}

Reply via email to