-
Notifications
You must be signed in to change notification settings - Fork 693
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
example doesn't work #168
Comments
This could be closed. |
I'll keep this issue open. |
Just realized the example is mis-recognizing one of the columns |
Closed
ovr
pushed a commit
to cube-js/sqlparse
that referenced
this issue
Dec 26, 2020
Fixes andialbrecht#168 by enabling `DATE` and other keywords to be used as identifiers when not followed by a string literal. A "typed string" is our term for generalized version of `DATE '...'`/`TIME '...'`/ `TIMESTAMP '...'` literals, represented as `TypedString { data_type, value }` in the AST. Unlike DATE/TIME/TIMESTAMP literals, this is a non-standard extension supported by PostgreSQL at least. This is a port of MaterializeInc/materialize#3146 Co-authored-by: Nikhil Benesch <nikhil.benesch@gmail.com> Co-authored-by: Nickolay Ponomarev <asqueella@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The examples don't work, on python3.
1: they are not 2to3ed, so they don't run without changing the print statements
2: column_defs_lowlevel.py doesn't work, it parses the sql into a Statement, then uses token_next_by_instance() to find Parenthesis tokens.
However, the 'parsed' Statement's token_next_by_instance() goes through its token list, but its token list is vastly different then the token list flattened: (also seems the sql is parsed incorrectly, foo is not a function). So it passes the result of token_next_by_instance() which is None, and then it errors out.
But shouldn't token_next_by_instance recurse into the tokens in its token list? or how are you supposed to do stuff like this? use a token list like the example uses, or create a new token list from the 'flattened' tokens...but then you don't get the nested parent/children relationship
The text was updated successfully, but these errors were encountered: