-
Notifications
You must be signed in to change notification settings - Fork 701
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
fix: Athena read_sql_query cache errors for qmark style parametrized queries #2957
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
…ly-wrong-results-for-qmark-style-parametrized-queries-with-cache-enabled
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This comment was marked as outdated.
This comment was marked as outdated.
awswrangler/athena/_read.py
Outdated
@@ -1048,6 +1048,7 @@ def read_sql_query( | |||
if not client_request_token: | |||
cache_info: _CacheInfo = _check_for_cached_results( | |||
sql=sql, | |||
params=params if paramstyle == "qmark" else None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we not cache paramstyle="named"
parameters as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The named
parameters end up built into the SQL query itself client-side. So the query itself contains the values already.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha, makes sense.
awswrangler/athena/_cache.py
Outdated
sql=comparable_sql, | ||
other=parsed_query, | ||
sql_params=params, | ||
other_params=query_info.get("ExecutionParameters"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this effectively disable caching for qmark queries since parameter values are not returned? https://docs.aws.amazon.com/athena/latest/APIReference/API_QueryExecution.html#athena-Type-QueryExecution-ExecutionParameters "The list of parameters is not returned in the response."
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…ly-wrong-results-for-qmark-style-parametrized-queries-with-cache-enabled
This comment was marked as outdated.
This comment was marked as outdated.
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
…ly-wrong-results-for-qmark-style-parametrized-queries-with-cache-enabled
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Feature or Bugfix
Detail
read_sql_query
cache errors for qmark style parametrized queriesRelates
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.