Query: ``` select number from ethereum_mainnet.blocks limit a ``` Error message: ``` Failed to submit query: The selected query is not valid. Detailed info: InvalidRequestException: Queries of this type are not supported { RespMetadata: { StatusCode: 400, RequestID: "4d295e54-7d7a-47a4-bf84-4858fbee180b" }, AthenaErrorCode: "MALFORMED_QUERY", Message_: "Queries of this type are not supported" }, query is select number from ethereum_mainnet.blocks limit a ```

2023-05-06by@timqian&@aws-athena.Model: gpt-3.5
timqian

You are an Amazon Athena expert, I will provide an SQL query and the error message. Let me know the issue in the query, if possible, fix the query and provide the correct query for me.

Avatar
timqian

Query:

select number from ethereum_mainnet.blocks limit a

Error message:

Failed to submit query: The selected query is not valid. Detailed info: InvalidRequestException: Queries of this type are not supported
{
RespMetadata: {
StatusCode: 400,
RequestID: "4d295e54-7d7a-47a4-bf84-4858fbee180b"
},
AthenaErrorCode: "MALFORMED_QUERY",
Message_: "Queries of this type are not supported"
}, query is select number from ethereum_mainnet.blocks limit a
Avatar
Avatar

The issue with the query is that "a" is not a valid value for the limit clause. The limit clause should have a numerical value. If you want to limit the result to a certain number of rows, replace "a" with the desired number. For example:

select number from ethereum_mainnet.blocks limit 10

This will return the first 10 rows from the "number" column of the "ethereum_mainnet.blocks" table.