Skip to content
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

add TABLE to insert statements #17

Closed
wants to merge 6 commits into from
Closed

add TABLE to insert statements #17

wants to merge 6 commits into from

Conversation

cpcloud
Copy link
Contributor

@cpcloud cpcloud commented Mar 15, 2015

closes #15



@compiles(Insert, 'hive')
def insert_into_add_table_keyword(insert, compiler, **kwargs):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a simpler way is to override visit_insert in HiveCompiler. The overridden method would call the base method, assert that the result starts with INSERT INTO, and swap that out with INSERT INTO TABLE.

Also could you throw in a test? Something that makes a test table (default db is fine), inserts a couple rows into it, and reads the results back.

@jingw
Copy link
Contributor

jingw commented Mar 17, 2015

Thanks for fixing this. As it turns out, Dropbox only uses pyhive to programatically generate read queries from a data exploration GUI, so we never actually did inserts with it.

@cpcloud
Copy link
Contributor Author

cpcloud commented Mar 26, 2015

@jingw was just about to pick this back up again, but looks like you fixed it! much appreciated!

@cpcloud cpcloud deleted the insert branch March 26, 2015 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

INSERT INTO TABLE
2 participants