Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse STRUCT in CREATE MODEL #269

Open
apstndb opened this issue Jan 12, 2025 · 0 comments
Open

Parse STRUCT in CREATE MODEL #269

apstndb opened this issue Jan 12, 2025 · 0 comments

Comments

@apstndb
Copy link
Contributor

apstndb commented Jan 12, 2025

STRUCT can be used in CREATE MODEL, but it can't be parsed because CreateModelColumn uses SchemaType and StructType doesn't implement SchemaType.

CREATE MODEL MODEL_NAME
INPUT(content STRING(MAX))
OUTPUT(
  embeddings
    STRUCT<
      statistics STRUCT<truncated BOOL, token_count FLOAT64>,
      values ARRAY<FLOAT64>>
)
REMOTE OPTIONS (
  endpoint = '//aiplatform.googleapis.com/projects/PROJECT/locations/LOCATION/publishers/google/models/textembedding-gecko$MODEL_VERSION'
)

I think StructType should also be a SchemaType. Validation is a responsibility of analyzer.

Note: column_type() of cloud-spanner-emulator includes STRUCT.

https://github.com/GoogleCloudPlatform/cloud-spanner-emulator/blob/7ad3d598613bc6fef5ef9806bb5a3ee343f15586/backend/schema/parser/ddl_parser.jjt#L337-L356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant