-
Notifications
You must be signed in to change notification settings - Fork 540
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
bug: Oracle Table alias #9179
Comments
Hi @Baazion -- thanks for reporting this! Can you tell us which version of Oracle you are running against? We only have a Docker image running 23.4 and table aliasing works as expected there -- I'm not sure which version this was added in? |
|
Ok, well, 19c is a LTS release and they promise support for another 2 years, so we can try to remove keyword that's causing the syntax error. Thanks, @Baazion ! |
This may need to be reported upstream to SQLGlot, and hopefully in the meantime there's a SQLGlot compiler flag we can use to set the aliasing style. |
Hmm, looks like [nav] In [3]: expr = sg.parse_one(
...: '''SELECT
...: COUNT(*) AS "CountStar()"
...: FROM (
...: SELECT
...: "t0"."sst_nr"
...: FROM "SOME_TABLE" AS "t0"
...: ) AS "t1"''',
...: read="oracle",
...: )
[ins] In [4]: expr.sql(dialect="oracle")
Out[4]: 'SELECT COUNT(*) AS "CountStar()" FROM (SELECT "t0"."sst_nr" FROM "SOME_TABLE" "t0") "t1"' |
Seems like we're potentially misusing
|
check out the table arg in alias_ |
Hey @Baazion -- I've been digging into this -- can you clarify how you are running the Oracle query? Are you generating the SQL and then executing it manually? Or are you hitting this error when using |
executed code (slightly sanitised):
output:
Executing with DuckDB-Conn returns a count. |
Thanks @Baazion -- I'm still having trouble reproducing this locally. Can you try upgrading Then, if that doesn't do it and you're game, you can try installing an ibis prerelease, which has a few fixes which may have helped with this, by running python -m pip install -U --pre 'ibis-framework[oracle]' |
Ran this with: but got the same Error |
What happened?
When Selecting on Oracle query gets parsed with AS for Table-Alias, which is not supported in Oracle
What version of ibis are you using?
9.0.0
What backend(s) are you using, if any?
Oracle
Relevant log output
Code of Conduct
The text was updated successfully, but these errors were encountered: