Skip to content
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

Grammar and full-featured parser for Column-SQL #1

Open
asavinov opened this issue Jul 4, 2021 · 0 comments
Open

Grammar and full-featured parser for Column-SQL #1

asavinov opened this issue Jul 4, 2021 · 0 comments
Labels
column-sql Tasks related to Column-SQL
Projects

Comments

@asavinov
Copy link
Owner

asavinov commented Jul 4, 2021

Currently Column-SQL is parsed using a simple function. Although it words, it has some limitations, for example, with respect to literals, enforcing more flexible syntactic rules etc. The goal of this item is to define a formal grammar for Column-SQL and implement a full-featured parser. Initially, it should work as an alternative to the existing (simple) parser but later on it should replace the existing parser. Currently, it is assumed that antlr will be used.

Define antlr grammar for Column-SQL with the corresponding unit tests where appropriate. The following syntax elements should be covered:

  • Column names with spaces and other special characters using name delimiters like brackets: [My Column Name]
  • Short names (prefixes) for operations like CALC instead of CALCULATE or FUNC instead of FUNCTION
  • Maybe allow for alternative keywords like ARGS or MODEL
  • Case insensitive keywords
  • If possible arbitrary source code for functions and json for arguments. Simply do not parse whatever is after some keyword. One approach might be to introduce special tags to distinguish between function definition categories
  • If possible and relevant, try to determine the role names, for example, if it is supposed to be a table or column (particularly, depending on the operation)
  • Alternative: either parse column paths or treat them as complex names to be parsed by the topology translator if necessary (topology translator can resolve inherited columns and add new operations depending on the context)
@asavinov asavinov added this to To do in prosto via automation Jul 4, 2021
@asavinov asavinov added the column-sql Tasks related to Column-SQL label Jul 11, 2021
@asavinov asavinov changed the title [Column-SQL] Grammar and full-featured parser for Column-SQL Grammar and full-featured parser for Column-SQL Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
column-sql Tasks related to Column-SQL
Projects
prosto
To do
Development

No branches or pull requests

1 participant