cloudspannerecosystem / memefish

memefish is the foundation to analyze Spanner SQL
https://cloudspannerecosystem.dev/memefish/
MIT License
76 stars 19 forks source link

Incompatibility: SELECT AS VALUE is not supported #97

Closed apstndb closed 4 weeks ago

apstndb commented 2 months ago

Spec

https://cloud.google.com/spanner/docs/reference/standard-sql/query-syntax#select_list

SELECT[ compute_hint_expr ]
  [ { ALL | DISTINCT } ]
  [ AS { typename | STRUCT | VALUE] } ]
  select_list

https://cloud.google.com/spanner/docs/reference/standard-sql/query-syntax#select_as_value https://cloud.google.com/spanner/docs/reference/standard-sql/query-syntax#value_tables

Reproducing input

SELECT * FROM (SELECT AS VALUE STRUCT(123 AS a, FALSE AS b))

Current error

syntax error::1:26: expected token: STRUCT, but: <ident>

  1:  SELECT * FROM (SELECT AS VALUE STRUCT(123 AS a, FALSE AS b))
                               ^~~~~