Qilong Wang created FLINK-41638:
-----------------------------------
Summary: SQL validation accepts unsupported predicates in LEFT
JOIN LATERAL TABLE
Key: FLINK-41638
URL: https://issues.apache.org/jira/browse/FLINK-41638
Project: Flink
Issue Type: Bug
Components: Table SQL / Planner
Affects Versions: 2.3.0
Reporter: Qilong Wang
A left outer join with an ordinary table function requires a literal TRUE
condition. In batch and streaming SQL, a column predicate can pass validation
when LATERAL is explicit.
Register a table function split_words(STRING, STRING) that emits one string per
token, then explain this query.
{code:sql}
SELECT f, v
FROM (VALUES ('a|b')) AS S(f)
LEFT JOIN LATERAL TABLE(split_words(f, '|')) AS T(v)
ON f = v
{code}
Planning fails with {{unexpected correlate variable $cor0 in the plan}}. SQL
validation should report {{Only literal TRUE is accepted.}} for this predicate.
The same query with {{ON TRUE}} should plan successfully.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)