You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Missing syntax support for certain Graph Table queries/keywords #5
Start a new query and type out a CREATE TABLE statement for an edge table with a CONNECTION constraint.
For example:
CREATE TABLE [core].[isClass] (
CONSTRAINT [EC_thing_is_classification] CONNECTION ([core].[thing] TO [core].[classification])
) AS EDGE;
The syntax parser reports the following errors:
"Incorrect syntax near 'CONNECTION'.
"Incorrect syntax near '[core]'. Expecting '(', or SELECT."
Additionally, writing a valid SELECT query using MATCH & SHORTEST_PATH also causes syntax errors.
For example:
SELECT *
FROM [core].[thing] [thing]
, [core].[isClass] FOR PATH [isClass]
, [core].[classification] FOR PATH [classification]
WHERE MATCH(SHORTEST_PATH([thing](-([isClass])->[classification])+))
Shows these syntax errors:
"Incorrect syntax near 'PATH'."
"Incorrect syntax near 'SHORTEST_PATH'. Expecting '(', or SELECT."
"Incorrect syntax near '[thing]'. Expecting '(', or SELECT."
"Incorrect syntax near '-'. Expecting '(', or SELECT."
"Incorrect syntax near '[isClass]'. Expecting '(', or SELECT."
Azure Data Studio version: azuredatastudio 1.34.0 (83a4316cf89cbf961a0f09a72c861379cfd01fa9, 2021-12-15T20:47:33.863Z)
OS version: Windows_NT x64 10.0.18363
Restricted Mode: No
System Info
Item
Value
CPUs
AMD Ryzen 7 PRO 4750U with Radeon Graphics (16 x 1697)
Ops Clicked the close by accident. Meant to just reply.
I've had mixed results in SSMS. I have a query right now that uses similar queries with the same syntax but no errors are showing. On my work PC I get similar syntax errors but at home I don't. Might simply be a difference in SSMS versions (18.8 vs 18.10).
For what it's worth - language service stuff was something I'm planning on taking up here for the next work cycle. So I'll be triaging/fixing all these kinds of issues when we get that started. Always happy to have others helping out though 😁
Activity
lamdacomplex commentedon Feb 15, 2022
Sorry, meant to also include a link to the documentation for Edge constraints and SHORTEST_PATH which include examples of valid syntax.
https://docs.microsoft.com/en-us/sql/relational-databases/tables/graph-edge-constraints?view=sql-server-ver15
https://docs.microsoft.com/en-us/sql/relational-databases/graphs/sql-graph-shortest-path?view=sql-server-ver15#examples
alanrenmsft commentedon Feb 16, 2022
looks like SSMS is also having the issue.
lamdacomplex commentedon Feb 16, 2022
Ops Clicked the close by accident. Meant to just reply.
I've had mixed results in SSMS. I have a query right now that uses similar queries with the same syntax but no errors are showing. On my work PC I get similar syntax errors but at home I don't. Might simply be a difference in SSMS versions (18.8 vs 18.10).
alanrenmsft commentedon Sep 15, 2022
Hai Cao (@caohai) I wanted to get this fixed but didn't get a chance, could you please pick up this one? you can check with Charles Gagnon (@Charles-Gagnon) to see whether this is documented.
it actually goes beyond this particular issue, I think in general we need to refresh our syntax library version.
caohai commentedon Sep 15, 2022
Sure I can pick this one up. I'll take a look.
Charles-Gagnon commentedon Sep 15, 2022
For what it's worth - language service stuff was something I'm planning on taking up here for the next work cycle. So I'll be triaging/fixing all these kinds of issues when we get that started. Always happy to have others helping out though 😁
caohai commentedon Sep 26, 2022
This issue is confirmed to be a bug in SqlParser, I've filed a bug internally and I'll move this issue to backlog for now.