Skip to content

Conversation

@sters
Copy link
Contributor

@sters sters commented Sep 17, 2025

Blocked by #178


Why

To support IS_HIDDEN column. Related PR: #176

Tested in my local

Current version

Terminal#1

>>> docker run -p 19010:9010 -p 19020:9020 gcr.io/cloud-spanner-emulator/emulator:1.5.34
...

Terminal#2

>>> gcloud spanner instances create test-instance --config emulator-config --description test --configuration spanner-emulator
Creating instance...done.

>>> gcloud spanner databases create test-database --instance test-instance --configuration spanner-emulator
Creating database...done.

>>> SPANNER_EMULATOR_HOST=localhost:19010 spanner-cli -p emul -i test-instance -d test-database
Connected.
spanner> CREATE TABLE FullTextSearch (
      ->   ID INT64 NOT NULL,
      ->   Content STRING(2048) NOT NULL,
      ->   Content_Tokens TOKENLIST AS (TOKENIZE_FULLTEXT(Content)) HIDDEN,
      -> ) PRIMARY KEY(ID);
Query OK, 0 rows affected (0.05 sec)

spanner> select * from INFORMATION_SCHEMA.COLUMNS limit 1;
+---------------+--------------+----------------+-------------+------------------+----------------+-----------+-------------+--------------+--------------+-----------------------+-----------+---------------+-------------+---------------------+---------------+-----------------------------+-------------------------+-------------------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME     | COLUMN_NAME | ORDINAL_POSITION | COLUMN_DEFAULT | DATA_TYPE | IS_NULLABLE | SPANNER_TYPE | IS_GENERATED | GENERATION_EXPRESSION | IS_STORED | SPANNER_STATE | IS_IDENTITY | IDENTITY_GENERATION | IDENTITY_KIND | IDENTITY_START_WITH_COUNTER | IDENTITY_SKIP_RANGE_MIN | IDENTITY_SKIP_RANGE_MAX |
+---------------+--------------+----------------+-------------+------------------+----------------+-----------+-------------+--------------+--------------+-----------------------+-----------+---------------+-------------+---------------------+---------------+-----------------------------+-------------------------+-------------------------+
|               |              | FullTextSearch | Content     | 2                | NULL           | NULL      | NO          | STRING(2048) | NEVER        | NULL                  | NULL      | COMMITTED     | NO          | NULL                | NULL          | NULL                        | NULL                    | NULL                    |
+---------------+--------------+----------------+-------------+------------------+----------------+-----------+-------------+--------------+--------------+-----------------------+-----------+---------------+-------------+---------------------+---------------+-----------------------------+-------------------------+-------------------------+
1 rows in set (19.29675ms)

There is no IS_HIDDEN column.

The new version

Terminal#1

>>> docker run -p 19010:9010 -p 19020:9020 gcr.io/cloud-spanner-emulator/emulator:1.5.41
...

Terminal#2

>>> gcloud spanner instances create test-instance --config emulator-config --description test --configuration spanner-emulator
Creating instance...done.

>>> gcloud spanner databases create test-database --instance test-instance --configuration spanner-emulator
Creating database...done.

>>> SPANNER_EMULATOR_HOST=localhost:19010 spanner-cli -p emul -i test-instance -d test-database
Connected.
spanner> CREATE TABLE FullTextSearch (
      ->   ID INT64 NOT NULL,
      ->   Content STRING(2048) NOT NULL,
      ->   Content_Tokens TOKENLIST AS (TOKENIZE_FULLTEXT(Content)) HIDDEN,
      -> ) PRIMARY KEY(ID);
Query OK, 0 rows affected (0.02 sec)

spanner> select * from INFORMATION_SCHEMA.COLUMNS limit 1;
+---------------+--------------+----------------+-------------+------------------+----------------+-----------+-------------+--------------+--------------+-----------+-----------------------+-----------+---------------+-------------+---------------------+---------------+-----------------------------+-------------------------+-------------------------+
| TABLE_CATALOG | TABLE_SCHEMA | TABLE_NAME     | COLUMN_NAME | ORDINAL_POSITION | COLUMN_DEFAULT | DATA_TYPE | IS_NULLABLE | SPANNER_TYPE | IS_GENERATED | IS_HIDDEN | GENERATION_EXPRESSION | IS_STORED | SPANNER_STATE | IS_IDENTITY | IDENTITY_GENERATION | IDENTITY_KIND | IDENTITY_START_WITH_COUNTER | IDENTITY_SKIP_RANGE_MIN | IDENTITY_SKIP_RANGE_MAX |
+---------------+--------------+----------------+-------------+------------------+----------------+-----------+-------------+--------------+--------------+-----------+-----------------------+-----------+---------------+-------------+---------------------+---------------+-----------------------------+-------------------------+-------------------------+
|               |              | FullTextSearch | Content     | 2                | NULL           | NULL      | NO          | STRING(2048) | NEVER        | false     | NULL                  | NULL      | COMMITTED     | NO          | NULL                | NULL          | NULL                        | NULL                    | NULL                    |
+---------------+--------------+----------------+-------------+------------------+----------------+-----------+-------------+--------------+--------------+-----------+-----------------------+-----------+---------------+-------------+---------------------+---------------+-----------------------------+-------------------------+-------------------------+
1 rows in set (5.197084ms)

There is a IS_HIDDEN column.

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

Successfully merging this pull request may close these issues.

2 participants