[ 
https://issues.apache.org/jira/browse/FLINK-37927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18145894#comment-18145894
 ] 

Yiyu Tian edited comment on FLINK-37927 at 11/16/26, 8:06 PM:
--------------------------------------------------------------

Async functions are only supported in streaming.[ 
FLIP-498|https://issues.apache.org/jira/browse/FLINK-37723] 
(AsyncTableFunction) scoped batch out.

In batch mode today, a LATERAL call to an AsyncTableFunction fails in 
BatchPhysicalConstantTableFunctionScanRule with "{_}Cannot generate a valid 
execution plan for the given query: Unsupported function for 
scan:ASYNC_TABLE{_}". The async scalar function counterpart is FLINK-41482.

Proposal: support async table functions in the batch planner, sharing the 
planner logic with streaming.
 * Extract CommonPhysicalAsyncCorrelateRule from 
StreamPhysicalAsyncCorrelateRule and AsyncTableUtil#validateAsyncCorrelate, 
shared by stream and batch.
 * Add BatchPhysicalAsyncCorrelateRule / BatchPhysicalAsyncCorrelate and exec 
node BatchExecAsyncCorrelate, reusing CommonExecAsyncCorrelate and 
AsyncWaitOperator.
 * Add AsyncCorrelateSplitRule.CORRELATE_SPLIT_ASYNC_TABLE and 
FlinkLogicalCalcRemoveRule to the batch logical rewrite, and handle ASYNC_TABLE 
in BatchPhysicalConstantTableFunctionScanRule.
 * Keep the existing table.exec.async-table.* options. Output mode stays 
ORDERED.
 * Keep BatchExecAsyncCorrelate out of batch multiple-input operators, since 
TableOperatorWrapper doesn't set the mailbox executor that 
AsyncWaitOperatorFactory needs.

This only turns a query that fails today into one that runs. Existing batch and 
streaming plans don't change.


was (Author: JIRAUSER307116):
Async functions are only supported in streaming. FLIP-498 (AsyncTableFunction) 
scoped batch out.

In batch mode today, a LATERAL call to an AsyncTableFunction fails in 
BatchPhysicalConstantTableFunctionScanRule with "{_}Cannot generate a valid 
execution plan for the given query: Unsupported function for 
scan:ASYNC_TABLE{_}". The async scalar function counterpart is FLINK-41482.

Proposal: support async table functions in the batch planner, sharing the 
planner logic with streaming.


* Extract CommonPhysicalAsyncCorrelateRule from 
StreamPhysicalAsyncCorrelateRule and AsyncTableUtil#validateAsyncCorrelate, 
shared by stream and batch.
* Add BatchPhysicalAsyncCorrelateRule / BatchPhysicalAsyncCorrelate and exec 
node BatchExecAsyncCorrelate, reusing CommonExecAsyncCorrelate and 
AsyncWaitOperator.
* Add AsyncCorrelateSplitRule.CORRELATE_SPLIT_ASYNC_TABLE and 
FlinkLogicalCalcRemoveRule to the batch logical rewrite, and handle ASYNC_TABLE 
in BatchPhysicalConstantTableFunctionScanRule.
* Keep the existing table.exec.async-table.* options. Output mode stays ORDERED.
* Keep BatchExecAsyncCorrelate out of batch multiple-input operators, since 
TableOperatorWrapper doesn't set the mailbox executor that 
AsyncWaitOperatorFactory needs.

This only turns a query that fails today into one that runs. Existing batch and 
streaming plans don't change.

> Add batch mode support for AsyncTableFunction
> ---------------------------------------------
>
>                 Key: FLINK-37927
>                 URL: https://issues.apache.org/jira/browse/FLINK-37927
>             Project: Flink
>          Issue Type: Sub-task
>            Reporter: Alan Sheinberg
>            Assignee: Yiyu Tian
>            Priority: Major
>              Labels: pull-request-available
>




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to