I'm trying to create an index on the AlbumTokens
column in my Google Cloud Spanner test database and I get a mysterious error referencing an index option that is not currently documented:
CREATE INDEX AlbumTokens
ON Albums (
AlbumTokens
)
>>> Index AlbumTokens references ARRAY AlbumTokens, but is not declared as DISTINCT_ARRAY_ELEMENT index.
Is it possible to do this? If so, how?
I'm using the sample schema with an ARRAY<STRING>
column added on:
CREATE TABLE Singers (
SingerId INT64 NOT NULL,
FirstName STRING(1024),
LastName STRING(1024),
SingerInfo BYTES(MAX),
) PRIMARY KEY (SingerId)
CREATE TABLE Albums (
SingerId INT64 NOT NULL,
AlbumId INT64 NOT NULL,
AlbumTitle STRING(MAX),
AlbumTokens ARRAY<STRING(MAX)>,
) PRIMARY KEY (SingerId, AlbumId),
INTERLEAVE IN PARENT Singers ON DELETE CASCADE