Apache flink PyFlink-UNNEST的问题:查询使用了不受支持的SQL功能?

Apache flink PyFlink-UNNEST的问题:查询使用了不受支持的SQL功能?,apache-flink,pyflink,Apache Flink,Pyflink,我正在尝试使用表API中的UNNEST函数展平数组 我是否做错了什么,或者它不是一个受支持的函数?但本页建议: 谢谢 代码 Python自定义项 @udf(input_types=DataTypes.STRING(), result_type=DataTypes.ARRAY(DataTypes.STRING())) def explode(s): return 3*[s] t_env.register_function("explode", explode) 加工

我正在尝试使用表API中的UNNEST函数展平数组

我是否做错了什么,或者它不是一个受支持的函数?但本页建议:

谢谢

代码

Python自定义项

@udf(input_types=DataTypes.STRING(), result_type=DataTypes.ARRAY(DataTypes.STRING()))
def explode(s):
    return 3*[s]

t_env.register_function("explode", explode)
加工

tab = t_env.from_path('mySource').select("id, explode(dummy) as dummy_list")
t_env.register_table("temp_table", tab)
t_env.sql_query("SELECT t.item as dummy_item FROM UNNEST(select dummy_list from temp_table) AS t(item)").insert_into("mySink")
执行

t_env.execute("dummy_unnest")
错误

TableException: Cannot generate a valid execution plan for the given query: 

LogicalProject(dummy_item=[$0])
  Uncollect
    LogicalProject(EXPR$0=[org$apache$flink$table$functions$python$PythonScalarFunction$908596b4671476ee325743dba92ed6c7($1)])
      LogicalTableScan(table=[[default_catalog, default_database, mySource]])

This exception indicates that the query uses an unsupported SQL feature.
Please check the documentation for the set of currently supported SQL features.

我想您可以将查询更改为

select id, dummy_item from temp_table CROSS JOIN UNNEST(dummy_list) AS t (dummy_item)

:)将来,如果您对pyflink有任何疑问,也可以直接在flink用户邮件列表中询问,以获得更及时的答案。谢谢,我会的。我认为这类问题可能对更广泛的公众有益。