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

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


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

commit c947ca95a39c78a71d44391d7797e12637dec2b7
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)
---
 .../sql-table-concepts/temporal_table_function.md  | 22 ++++++++++++++--------
 docs/content.zh/docs/dev/table/tableApi.md         |  6 +++---
 .../sql-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/concepts/sql-table-concepts/temporal_table_function.md 
b/docs/content.zh/docs/concepts/sql-table-concepts/temporal_table_function.md
index c4d3c405280..44bac39065e 100644
--- 
a/docs/content.zh/docs/concepts/sql-table-concepts/temporal_table_function.md
+++ 
b/docs/content.zh/docs/concepts/sql-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 rates(order_time)
+  LATERAL 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 42b832367b5..6e28aa625b1 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”表关联
@@ -1144,7 +1144,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")
 ```
 {{< /tab >}}
 {{< tab "Python" >}}
diff --git 
a/docs/content/docs/concepts/sql-table-concepts/temporal_table_function.md 
b/docs/content/docs/concepts/sql-table-concepts/temporal_table_function.md
index 1f87a57512f..0dce97d7c98 100644
--- a/docs/content/docs/concepts/sql-table-concepts/temporal_table_function.md
+++ b/docs/content/docs/concepts/sql-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 rates(order_time)
+  LATERAL 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 ebb4dadcda4..9ad4da59ce6 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
@@ -1143,7 +1143,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")
 ```
 {{< /tab >}}
 {{< tab "Python" >}}

Reply via email to