Skip to content

Add quotes for db and table names into queries#1

Open
lukaszach wants to merge 1 commit into
add-region-supportfrom
lukaszach/META-4068-fix-db-table-naming
Open

Add quotes for db and table names into queries#1
lukaszach wants to merge 1 commit into
add-region-supportfrom
lukaszach/META-4068-fix-db-table-naming

Conversation

@lukaszach
Copy link
Copy Markdown

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.

@lukaszach lukaszach requested a review from vijaykiran February 27, 2024 14:41

query_string = "ALTER TABLE " \
+ database_name + "." + table_name \
+ "\"" + database_name + "\".\"" + table_name + "\"" \
Copy link
Copy Markdown

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
Copy Markdown

@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