cloudspannerecosystem / memefish

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

Incompatibility: SAFE functions are not supported #94

Open apstndb opened 2 months ago

apstndb commented 2 months ago

This incompatibility is detected by #90.

Spec

https://cloud.google.com/spanner/docs/reference/standard-sql/functions-reference#safe_prefix

Additionally, SAFE_CAST is needed to be supported. #115

Reproducing input

CREATE TABLE T (
  id INT64,
  string_field STRING(MAX),
  gen BYTES(MAX) AS (SAFE.MD5(string_field)) STORED,
) PRIMARY KEY(id);

Current error

syntax error:testdata/generated_column.test:5:30: expected token: ), but: (

  5:    gen BYTES(MAX) AS (SAFE.MD5(string_field)) STORED,
                                   ^