-
Notifications
You must be signed in to change notification settings - Fork 183
Queries with typed literals fail to parse #48
Comments
You found a big limitation: The I would like
to parse as
the parser should make no attempt to parse the string; it will be left to whatever post-parser deals with the JSON. I have not given much thought to the two-parameter
the parser might emit any of the following (I put them in best-first order, but I am open to suggestions)
When deciding on a parsed output, remember the JSON object represents a function call; I added the "natural python interpretation" as a comment to each line. If you decide to go with an |
As a side note, to explain how we survived without this: Our query interpreter has a
parses to
which works. Same with interval calculations,
Notice the use of double quotes; which are parsed as a column name. This is confusing to all users: People new the SQL must learn single and double quotes mean two different things, and experts are rightly disturbed to pretend column names are strings. Solving this issue would be appreciated. |
@pydolan Do you have feedback on this issue? I am currently leaning toward
being parsed to
with the understanding there is a time_interval (duration) datatype. |
@klahnakoski – I think that would work for me, thanks |
I have decided on |
In at least MySQL (e.g., with dates), literals can be assigned a type, such as in this query:
This results in a ParseException ("Expecting one of (and, gt, is, union all...").
I might have time to help with a PR. If you have any thoughts on how best to implement this, let me know.
The text was updated successfully, but these errors were encountered: