-
Notifications
You must be signed in to change notification settings - Fork 1.5k
spanner/spansql: Support subselect and maybe other limitations for spansql parser #8519
Copy link
Copy link
Closed
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.
Description
I'm using spannertest and I have the following query:
SELECT
subTable.Foo AS FooValue,
IFNULL(COUNT(t.UUID), 0) AS count
FROM
(SELECT DISTINCT TestColumn FROM TestTable) subTable
LEFT JOIN TestTable t
ON
subTable.TestColumn = t.TestColumn AND t.ProvisionDate IS NULL
GROUP BY subTable.TestColumn
Using spannertest I get the following error: I also added the value of tok, and tok.typ to the original error for debugging:
spanner: code = "InvalidArgument", desc = "bad query: -:6: expected identifier tok=\"(\", tok.typ=0"
I'm pretty sure the subquery "(SELECT DISTINCT TestColumn FROM TestTable) subTable" is giving the issue as I noticed subselects were not supported. I enabled debug for spansql and am trying to understand a bit for myself how we could go about supporting this, but wanted to raise the issue and see if anyone else has already thought about this or is working on support.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the Spanner API.Issues related to the Spanner API.priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.