You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With sqlparser 0.63.0 and SparkSqlDialect, SELECT struct(); fails with Expected: an expression, found: ) at Line: 1, Column: 15. Spark 4.2.0 accepts this syntax and returns an empty struct ({}).
Reproduction:
use sqlparser::{dialect::SparkSqlDialect, parser::Parser};let result = Parser::parse_sql(&SparkSqlDialect{},"SELECT struct();");assert!(result.is_ok(),"{result:?}");
parse_struct_literal in src/parser/mod.rs unconditionally calls parse_comma_separated after consuming (, so an immediate ) cannot produce Expr::Struct { values: vec![], fields: vec![] }. I checked the same code on current main as well.
Could the Spark dialect accept an empty struct argument list? This is a syntax request; support for evaluating the resulting empty struct is separate.
Activity