Skip to content

feat: support GRAPH_TABLE operator - #393

Merged
makenowjust merged 4 commits into
cloudspannerecosystem:mainfrom
apstndb:feat/gql-graph-table
Jul 30, 2026
Merged

feat: support GRAPH_TABLE operator#393
makenowjust merged 4 commits into
cloudspannerecosystem:mainfrom
apstndb:feat/gql-graph-table

Conversation

@apstndb

@apstndb apstndb commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • support GRAPH_TABLE as a table expression containing either an advanced GQL
    query block or the SQL/PGQ single-MATCH form;
  • support the single-MATCH form both with an optional COLUMNS projection and
    without COLUMNS;
  • support qualified graph names, joins, aliases, and TABLESAMPLE suffixes;
  • add parser, unparser, position, walking, and round-trip goldens.

Note

Spanner's GoogleSQL dialect accepts an SQL/PGQ-style single-MATCH form
with optional COLUMNS, although this form is not currently documented in the
Spanner documentation. The upstream GoogleSQL compliance tests also cover this
grammar:

https://github.com/google/googlesql/blob/1f8aa333f4d6353cd3a64471fc83121df72df3f7/googlesql/compliance/testdata/graph_table.test

spanner> SELECT a_id FROM GRAPH_TABLE(FinGraph MATCH (a) COLUMNS(a.id AS a_id));
+------+
| a_id |
+------+
| 7    |
| 16   |
| 20   |
| 1    |
| 2    |
| 3    |
+------+
6 rows in set (9.03 msecs)

spanner> SELECT a.id FROM GRAPH_TABLE(FinGraph MATCH (a));
+----+
| id |
+----+
| 7  |
| 16 |
| 20 |
| 1  |
| 2  |
| 3  |
+----+
6 rows in set (8.82 msecs)

Related Issues

@apstndb
apstndb force-pushed the feat/gql-graph-table branch from 57f39f3 to e91c8bc Compare July 22, 2026 15:32
Comment thread ast/ast.go Outdated
@makenowjust
makenowjust merged commit 5003a07 into cloudspannerecosystem:main Jul 30, 2026
7 checks passed
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