From 72798a7622830d3052cb6945239dd03e19a754af Mon Sep 17 00:00:00 2001 From: Deepyaman Datta Date: Fri, 21 Jul 2023 13:22:54 -0500 Subject: [PATCH] [hotfix][python][docs] Fix broken syntax in Flink Table API query example This closes #23043. --- docs/content.zh/docs/dev/python/table/intro_to_table_api.md | 4 ++-- docs/content/docs/dev/python/table/intro_to_table_api.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/content.zh/docs/dev/python/table/intro_to_table_api.md b/docs/content.zh/docs/dev/python/table/intro_to_table_api.md index dd08f67402b..98a689d0a0a 100644 --- a/docs/content.zh/docs/dev/python/table/intro_to_table_api.md +++ b/docs/content.zh/docs/dev/python/table/intro_to_table_api.md @@ -322,7 +322,7 @@ new_table.execute().print() ```python from pyflink.table import EnvironmentSettings, TableEnvironment -from pyflink.table.expressions import col +from pyflink.table.expressions import call, col # 通过 batch table environment 来执行查询 env_settings = EnvironmentSettings.in_batch_mode() @@ -336,7 +336,7 @@ revenue = orders \ .select(col("name"), col("country"), col("revenue")) \ .where(col("country") == 'FRANCE') \ .group_by(col("name")) \ - .select(col("name"), col("country").sum.alias('rev_sum')) + .select(col("name"), call("sum", col("revenue")).alias('rev_sum')) revenue.execute().print() ``` diff --git a/docs/content/docs/dev/python/table/intro_to_table_api.md b/docs/content/docs/dev/python/table/intro_to_table_api.md index ce540a68610..43e657514f1 100644 --- a/docs/content/docs/dev/python/table/intro_to_table_api.md +++ b/docs/content/docs/dev/python/table/intro_to_table_api.md @@ -323,7 +323,7 @@ The following example shows a simple Table API aggregation query: ```python from pyflink.table import EnvironmentSettings, TableEnvironment -from pyflink.table.expressions import col +from pyflink.table.expressions import call, col # using batch table environment to execute the queries env_settings = EnvironmentSettings.in_batch_mode() @@ -337,7 +337,7 @@ revenue = orders \ .select(col("name"), col("country"), col("revenue")) \ .where(col("country") == 'FRANCE') \ .group_by(col("name")) \ - .select(col("name"), col("country").sum.alias('rev_sum')) + .select(col("name"), call("sum", col("revenue")).alias('rev_sum')) revenue.execute().print() ```