Skip to content

Spark: Support empty STRUCT() literal - #3062

Open
yussypu wants to merge 1 commit into
apache:mainfrom
yussypu:spark-empty-struct
Open

yussypu wants to merge 1 commit into
apache:mainfrom
yussypu:spark-empty-struct

Conversation

@yussypu

@yussypu yussypu commented Nov 27, 2026

Copy link
Copy Markdown

Dialects: Spark

Closes #3048

SELECT struct(); failed with Expected: an expression, found: ). Spark accepts it and returns an empty struct: https://spark.apache.org/docs/latest/api/sql/index.html#struct

This adds Dialect::supports_empty_struct_literal, enabled for Spark. When it is set and the literal has no typed fields, STRUCT() parses as Expr::Struct with no values and displays as STRUCT(). Other dialects with struct literals still reject it, and the test covers both.

AI assistance: drafted with Claude.

@github-actions github-actions Bot added the Spark label Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spark dialect rejects empty struct() expressions

1 participant