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 quotes for db and table names into queries #1

Open
wants to merge 1 commit into
base: add-region-support
Choose a base branch
from

Conversation

lukaszach
Copy link

Issue #, if available:

Our setup creates workgroup (database) with dashes as well as tables. The queries building fails with it so extra quotes are required.

Description of changes:

Adding extra quotes into athena queries.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@@ -86,7 +86,7 @@ def build_athena_query(log, database_name, table_name):
hour = current_timestamp.hour

query_string = "ALTER TABLE " \
+ database_name + "." + table_name \
+ "\"" + database_name + "\".\"" + table_name + "\"" \

Choose a reason for hiding this comment

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

I think you can just use '"' to escape instead of \"

Copy link

@vijaykiran vijaykiran left a comment

Choose a reason for hiding this comment

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

LGTM - just one style comment for escaping quotes ?

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.

2 participants