-
Notifications
You must be signed in to change notification settings - Fork 42
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
Escaped single quote in COMMENT is not handled properly #63
Comments
@kukigai but now in your example it's not escaped, I mean if I put it in query editor it will parse 'test' -as string, but s' - will be marked like invalid |
as I see - must be some 'escaping' character like ' or '' - for sql server |
sorry, i think github remove escaped char when i pasted. you can try this to reproduce. ddl = """ |
@kukigai this is the most sad ticket, I add some fixes in 0.19.6 but anyway because of python specific there is some complicated things. Escaping characters are showed only in raw strings in python, but if pass text as normal string firstly and when convert it to raw string (under the package logic) it will not work, because escaping symbols dropped immediately in normal string. So there is 2 options how to parse escaping characters in python:
I would be glad to maintain it anyhow more user-friendly way, but it's not first time when I bumbed on escaping symbols in python. So there is only those 2 ways. There is no way like pass simple string and use only one '' symbol to escape. Very sorry about it. @kukigai, can I help anyhow more on this ticket or I can close it? |
thanks! yeah, i can workaround it using one of the option. |
Describe the bug
Escaped single quote in COMMENT is not handled properly
To Reproduce
ddl = """
CREATE EXTERNAL TABLE
test
(job_id STRING COMMENT 'test's'
)
STORED AS PARQUET LOCATION 'hdfs://test'
"""
from simple_ddl_parser import DDLParser
parse_results = DDLParser(ddl).run(output_mode="hql")
Expected behavior
Non empty json should be returned
The text was updated successfully, but these errors were encountered: