Closed jp-harvey closed 5 years ago
the PR https://github.com/ibis-project/ibis/pull/1903 will resolve this issue.
This seems like a pymapd
bug not an ibis issue, what if a non ibis library wanted to issue a similar query? Fixing every downstream client of pymapd
is going to lead to a bunch of duplicate code.
@cpcloud my understanding about this issue is:
pymapd allows the usage of ;
but not inside a nested SQL.
So select * from a;
works fine, but SELECT * FROM (select * from a;) t0
doesn't work.
Using con.sql("""select * from a;""").execute()
it will translate the expression to SELECT * FROM (select * from a;) t0
that is why in https://github.com/ibis-project/ibis/pull/1903 I am removing ;
Right, but it's no longer nested anymore because the schema is being retrieved in an alternative way.
@cpcloud mmm not sure I am following you. is there any current changing that fixed that issue?
The nesting issue stems from adding a LIMIT 0
subquery to retrieve the schema of query
.
Terminating ';' still causes an error on _execute. Exception: Parse failed: Encountered ";" at line 3, column 26.
. _execute has a 'LIMIT 10000' statement.
I see. ibis is still wrapping the query in a subquery, the munging is necessary.
Right, unless there is a way to get rid of the wrapper of course...
@mpeaton I could change the default limit and now (in that PR) it doesn't put LIMIT 10000
anymore.
LGTM
It's common for users to append a
;
to the end of their OmniSci query by habit since it's required in command line tools like omnisql. In Immerse SQL Editor the semi colon is not required but it is accepted.When using the
sql
API in Ibis, the sql is not validated and the string is simply wrapped inSELECT *
and executed, leading to a syntax error in OmniSci.Example, where o is an Ibis object:
OmniSci supports comments in the form of
--
also, although not tested this will likely cause a similar issue.