-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TSql Add rule and keyword for LABEL in OPTIONS of table #3459
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please cover suggested changed by an example.
@@ -527,6 +527,7 @@ KEY_PATH: 'KEY_PATH'; | |||
KEY_SOURCE: 'KEY_SOURCE'; | |||
KEY_STORE_PROVIDER_NAME: 'KEY_STORE_PROVIDER_NAME'; | |||
KILL: 'KILL'; | |||
LABEL: 'LABEL'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can LABEL
be identifier? I guess so that why add this token to keyword list.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to
https://learn.microsoft.com/en-us/sql/t-sql/language-elements/reserved-keywords-transact-sql?view=azuresqldb-current
LABEL is a keyword in Azure Synapse Analytics, which is tsql dialect too.
I'll remove this keyword here because those rules are general purpose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I add only rule in parser without keyword here, then on parsing
select whatever from tbl OPTION (MAXDOP 1, LABEL = 'Large');
it will throw errors:
mismatched input ',' expecting '.'
mismatched input 'OPTION' expecting '.'
mismatched input 'LABEL' expecting {'CONCAT', 'EXPAND', 'FAST', 'FORCE', 'HASH', 'IGNORE_NONCLUSTERED_COLUMNSTORE_INDEX', 'KEEP', 'KEEPFIXED', 'LOOP', 'MAXDOP', 'MAXRECURSION', 'MERGE', 'OPTIMIZE', 'ORDER', 'PARAMETRIZATION', 'RECOMPILE', 'ROBUST', 'USE', LABEL}
Is there any other way to support this syntax?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't mean adding the rule only to parser. I meant adding both token as you did at the beginning:
LABEL: 'LABEL';
and to keyword
list:
keyword
...
| LABEL
...
No description provided.