Sagar Mittal created SPARK-60557:
------------------------------------
Summary: Support CHANGES for parenthesized STREAM relations
Key: SPARK-60557
URL: https://issues.apache.org/jira/browse/SPARK-60557
Project: Spark
Issue Type: Bug
Components: SQL
Affects Versions: 5.0.0
Reporter: Sagar Mittal
The SQL parser accepts a streaming CHANGES clause when the source table is
written without
parentheses:
{code:sql}
SELECT * FROM STREAM events CHANGES FROM VERSION 1;
{code}
However, the equivalent parenthesized form fails to parse as a CHANGES clause:
{code:sql}
SELECT * FROM STREAM(events) CHANGES FROM VERSION 1;
{code}
Both forms already support the same trailing options, source identifier,
watermark, and alias
clauses. Parentheses only group the stream source and should not change whether
CHANGES is
supported.
h3. Expected behavior
The parenthesized and non-parenthesized forms should parse to equivalent
logical plans.
h3. Actual behavior
Only the non-parenthesized form parses CHANGES successfully. Depending on the
remainder of the
query, the parser can consume CHANGES as an alias and report the parse error at
a following token.
h3. Proposed fix
Use a common stream-source grammar path for parenthesized and non-parenthesized
table identifiers,
allowing the streaming CHANGES and options clauses after either form. Add
positive equivalence
coverage and negative coverage ensuring CHANGES remains unsupported for
table-valued functions.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]