-
Notifications
You must be signed in to change notification settings - Fork 24
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: SQL compilation error...unexpected '.'
when table name is ORDER
#230
bug: SQL compilation error...unexpected '.'
when table name is ORDER
#230
Comments
Fixed in 0.9.0 |
@edgarrmondragon I'm still getting errors when I try to sync a table called "ORDER". When I debug, strangely it doesnt seem like the quoted_name function is doing anything for the fully qualified name or even just the table name. I'm also remembering now how tricky this casing and quoting logic is. What I'm observing is that |
For example I hard coded the merge statement to properly quote
|
When the table is created at this point in the SDK connector class the full_table_name is unquoted I think the SDK needs to either use native sqlalchemy methods that automatically quote (i.e. stop building SQL statements manually) or stop using the native method thats auto quoting. I think the only place auto quoting is the create table statement and as a user its much easier to manually build SQL strings like we do for merge/copy/etc. in this target, so I'd prefer to avoid auto quoting in the create table statement. This way I can handle the quoting myself in the table_name or conform_name methods. What do you think? |
@edgarrmondragon I gave this another shot and it doesnt seem like an easy fix. I was attempting to escape the reserved word consistently but now the problem is that full_table_name is being passed around and parsed to retrieve the table name string. That string would have a double quote around it so using it in any sqlalchemy functions like inspect arent working because the table isnt found. Again because sqlalchemy expects to do the escaping but we've already done it. |
Yeah I've also been trying to replace our stringified SQL constructions with SQLAlchemy-native ones, but it's indeed painful to work around the |
@pnadolny13 I think I got at least a path towards a solution in meltano/sdk#2601 and #242 🎉 |
The target is generating invalid SQL when the stream name is ORDER because thats a reserved word and its not getting double quoted. For example a stream named
tap_jaffle_shop-ORDER
The text was updated successfully, but these errors were encountered: