get_query_results
¶
get_query_results(
query_execution_id: QueryExecutionId,
*,
config_overrides: Optional[AthenaClientConfig] = None,
next_token: Optional[Token] = None,
max_results: Optional[MaxQueryResults] = None,
query_result_type: Optional[QueryResultType] = None,
) -> GetQueryResultsOutput
Streams the results of a single query execution specified by QueryExecutionId from the Athena query results location in Amazon S3. For more information, see Working with query results, recent queries, and output files in the Amazon Athena User Guide. This request does not execute the query but returns results. Use StartQueryExecution to run a query.
To stream query results successfully, the IAM principal with permission to call GetQueryResults also must have permissions to the Amazon S3 GetObject action for the Athena query results location.
IAM principals with permission to the Amazon S3 GetObject action for the query results location are able to retrieve query results from Amazon S3 even if permission to the GetQueryResults action is denied. To restrict user or role access, ensure that Amazon S3 permissions to the Athena query location are denied.
Parameters:
-
query_execution_id(QueryExecutionId) –The unique ID of the query execution.
-
next_token(Optional[Token], default:None) –A token generated by the Athena service that specifies where to continue pagination if a previous request was truncated. To obtain the next set of pages, pass in the
NextTokenfrom the response object of the previous page call. -
max_results(Optional[MaxQueryResults], default:None) –The maximum number of results (rows) to return in this request.
-
query_result_type(Optional[QueryResultType], default:None) –When you set this to
DATA_ROWSor empty,GetQueryResultsreturns the query results in rows. If set toDATA_MANIFEST, it returns the manifest file in rows. Only the query typesCREATE TABLE AS SELECT,UNLOAD, andINSERTcan generate a manifest file. If you useDATA_MANIFESTfor other query types, the query will fail.
Raises:
-
InternalServerException–Indicates a platform issue, which may be due to a transient condition or outage.
-
InvalidRequestException–Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.
-
TooManyRequestsException–Indicates that the request was throttled.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_athena/_services/athena.py
1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 | |