cloudspannerecosystem / memefish

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

Incompatibility: CREATE/DROP/ALTER MODEL statements(a.k.a. Vertex AI integration) are not supported #96

Closed apstndb closed 2 days ago

apstndb commented 2 months ago

This incompatibility is detected by #90.

Spec

https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language#model_statements

{ CREATE MODEL | CREATE OR REPLACE MODEL | CREATE MODEL IF NOT EXISTS } model_name
[INPUT ( column_list ) OUTPUT ( column_list )]
REMOTE
[OPTIONS ( model_options )]

where column_list is:
   { column_name data_type [OPTIONS ( model_column_options )] [, ... ] }

and model_column_options is:
    {
      required = { true | false }
    }

and model_options is:
    {
      endpoint = '{endpoint_address}',
      endpoints = [ '{endpoint_address}' [, ...] ],
      default_batch_size = int64_value
    }

https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language#alter-model

ALTER MODEL [ IF EXISTS ] model_name
SET OPTIONS ( model_options )

where model_options is:
    {
      endpoint = '{endpoint_address}',
      endpoints = [ '{endpoint_address}' [, ...] ],
      default_batch_size = int64_value
    }

https://cloud.google.com/spanner/docs/reference/standard-sql/data-definition-language#drop-model

DROP MODEL [ IF EXISTS ] model_name

Reproducing input

CREATE MODEL m1
INPUT( feature INT64 )
OUTPUT( label STRING(MAX) )
REMOTE OPTIONS (
  endpoint = '//aiplatform.googleapis.com/projects/tp/locations/tl/endpoints/schemaless'
);

Current error

syntax error:testdata/models.test:4:8: expected pseudo keyword: DATABASE, TABLE, INDEX, UNIQUE, NULL_FILTERED, ROLE, CHANGE but: MODEL

  4:  CREATE MODEL m1
             ^~~~~

Related update of this syntax

https://cloud.google.com/spanner/docs/release-notes#October_11_2022