[
https://issues.apache.org/jira/browse/FLINK-41253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dian Fu resolved FLINK-41253.
-----------------------------
Fix Version/s: 2.3.1
2.4.0
Resolution: Fixed
Fixed in:
- master via 9f6afdeb1ad0e2e24f94070df5bab35bf00517a9
- release-2.4 via 67347d1adda49ae689caeb4c95761e0b0e341144
- release-2.3 via 52d36adb0e77c13baa5ec2ef3356916e94da3b64
> Python scalar UDFs produce incorrectly ordered columns when mixing sync and
> async calls
> ---------------------------------------------------------------------------------------
>
> Key: FLINK-41253
> URL: https://issues.apache.org/jira/browse/FLINK-41253
> Project: Flink
> Issue Type: Bug
> Components: API / Python
> Affects Versions: 2.3.0
> Reporter: Liu Liu
> Assignee: Liu Liu
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.3.1, 2.4.0
>
>
> Mixing synchronous and asynchronous Python scalar UDFs in a projection can
> produce columns in the wrong order. The issue affects both streaming and
> batch execution.
> For the minimal example below:
>
> {code:java}
> from pyflink.table import DataTypes, EnvironmentSettings, TableEnvironment
> from pyflink.table.udf import udf
> @udf(result_type=DataTypes.BIGINT())
> def sync_add(value):
> return value + 1
> @udf(result_type=DataTypes.BIGINT())
> async def async_add(value):
> return value + 2
> table = env.from_elements(
> [(1,)],
> DataTypes.ROW([DataTypes.FIELD("a", DataTypes.BIGINT())]),
> )
> with table.select(sync_add(table.a), async_add(table.a)).execute().collect()
> as rows:
> print([tuple(row) for row in rows]){code}
>
> * {{select(sync_add(a), async_add(a))}} should return {{{}(2, 3){}}}, but
> returns {{{}(3, 2){}}}.
> * {{select(async_add(a), sync_add(a))}} correctly returns {{{}(3, 2){}}}.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)