Unknown parameter in QueryExecutionContext: "Catalog", must be one of: Database
See original GitHub issueI’m using pyathena==2.9.4
under Python 3.7.4
My test code is copied from README:
from pyathena import connect
from pyathena.cursor import DictCursor
cursor = connect(s3_staging_dir="s3://YOUR_S3_BUCKET/path/to/",
region_name=REGION,
cursor_class=DictCursor).cursor()
cursor.execute("SELECT * FROM DATABASE.TABLE LIMIT 10;")
it returned an error i don’t understand:
Failed to execute query.
Traceback (most recent call last):
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/pyathena/common.py", line 455, in _execute
**request
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/pyathena/util.py", line 84, in retry_api_call
return retry(func, *args, **kwargs)
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/tenacity/__init__.py", line 404, in __call__
do = self.iter(retry_state=retry_state)
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/tenacity/__init__.py", line 349, in iter
return fut.result()
File "/home/zach/.asdf/installs/python/3.7.4/lib/python3.7/concurrent/futures/_base.py", line 428, in result
return self.__get_result()
File "/home/zach/.asdf/installs/python/3.7.4/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/tenacity/__init__.py", line 407, in __call__
result = fn(*args, **kwargs)
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/botocore/client.py", line 634, in _make_api_call
api_params, operation_model, context=request_context)
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/botocore/client.py", line 682, in _convert_to_request_dict
api_params, operation_model)
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/botocore/validate.py", line 297, in serialize_to_request
raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in QueryExecutionContext: "Catalog", must be one of: Database
Traceback (most recent call last):
File "<input>", line 1, in <module>
cursor.execute("SELECT * FROM <database>.<table> LIMIT 10")
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/pyathena/util.py", line 37, in _wrapper
return wrapped(*args, **kwargs)
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/pyathena/cursor.py", line 97, in execute
cache_expiration_time=cache_expiration_time,
File "/home/zach/my-project/.venv/lib/python3.7/site-packages/pyathena/common.py", line 459, in _execute
raise DatabaseError(*e.args) from e
pyathena.error.DatabaseError: Parameter validation failed:
Unknown parameter in QueryExecutionContext: "Catalog", must be one of: Database
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
AWS Athena Connector Error - Redash Discourse
... connector in Redash: Parameter validation failed: Unknown parameter in QueryExecutionContext: “Catalog”, must be one of: Database.
Read more >Unknown parameter in QueryExecutionContext: "Catalog ...
Steps to Reproduce. create the athena type data source; fill all the input; checked the checkbox "Use Glue Data Catalog"; save it; click...
Read more >StartQueryExecution - Athena - AWS Documentation
The database within which the query executes. Type: QueryExecutionContext object. Required: No. QueryString. The SQL query statements to be executed. Type: ...
Read more >Create AWS Athena view programmatically - Stack Overflow
A catalog property that must have the value awsdatacatalog . A schema property that must be the name of the database where the...
Read more >Athena — Boto3 Docs 1.26.33 documentation - Amazon AWS
The database must exist in the catalog. Catalog (string) --. The name of the data catalog used in the query execution. Status (dict)...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
yeah 1.13.19 doesn’t have it https://boto3.amazonaws.com/v1/documentation/api/1.13.19/reference/services/athena.html#Athena.Client.start_query_execution
since boto packages get updated almost on a daily basis, we can use higher version than 1.13.20 on the safe side 😁
found the problem! although we have
my
are not compatible
i also tried
they don’t work either
so i guess we need to update the
pyproject.toml
. the 2 boto-related lines are 2 years old https://github.com/laughingman7743/PyAthena/blob/3e2f5cfa5c1633139e43e1bb3348ecdbbdc4d186/pyproject.toml#L33-L34