You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by whh_960101 <wh...@163.com> on 2020/10/15 08:38:52 UTC
pyflink Table object如何打印出其中内容方便调试
您好,我使用pyflink时的代码如下,有如下问题:
source = st_env.from_path('source') #st_env是StreamTableEnvironment,source是kafka源端
#udf1 (input_types =DataTypes.STRING(), result_type = DataTypes.BOOLEAN())
table = source.select("msg").where(udf1(msg)=True)
这样单步调试print(table)出来的结果是<pyflink.table.table.Table object at 0x7f888fb2cef0>
pyflink有没有将Table转化成可打印格式的方法
希望您们能够给予解答!感谢!
Re: pyflink Table object如何打印出其中内容方便调试
Posted by Xingbo Huang <hx...@gmail.com>.
Hi,
你想要输出table的结果,可以有两种方便的方式,
1. table.to_pandas()
2. 使用print connector,可以参考[1]
然后你如果对pyflink感兴趣,可以看看这个doc[2],可以帮助你快速上手
[1]
https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/table/connectors/print.html
[2]
https://ci.apache.org/projects/flink/flink-docs-release-1.11/dev/python/table-api-users-guide/intro_to_table_api.html
Best,
Xingbo
whh_960101 <wh...@163.com> 于2020年10月15日周四 下午4:39写道:
> 您好,我使用pyflink时的代码如下,有如下问题:
>
>
> source = st_env.from_path('source')
> #st_env是StreamTableEnvironment,source是kafka源端
> #udf1 (input_types =DataTypes.STRING(), result_type = DataTypes.BOOLEAN())
> table = source.select("msg").where(udf1(msg)=True)
>
>
> 这样单步调试print(table)出来的结果是<pyflink.table.table.Table object at
> 0x7f888fb2cef0>
> pyflink有没有将Table转化成可打印格式的方法
> 希望您们能够给予解答!感谢!
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>