Query: ``` select abc, number from ethereum_mainnet.blocks limit 3 ``` Error message: ``` Got bad state FAILED for query qu8-38abed9a-b69a-4a0c-a2d6-cc0ce347c640 (queryrun: mr8-e06919f5-9f4c-4e5f-a940-2682dcaad2b4): { ErrorCategory: 2, ErrorMessage: "COLUMN_NOT_FOUND: line 1:8: Column 'abc' cannot be resolved", ErrorType: 1006, Retryable: false } | COLUMN_NOT_FOUND: line 1:8: Column 'abc' cannot be resolved ```

2023-05-08by@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 abc, number from ethereum_mainnet.blocks limit 3

Error message:

Got bad state FAILED for query qu8-38abed9a-b69a-4a0c-a2d6-cc0ce347c640 (queryrun: mr8-e06919f5-9f4c-4e5f-a940-2682dcaad2b4): {
ErrorCategory: 2,
ErrorMessage: "COLUMN_NOT_FOUND: line 1:8: Column 'abc' cannot be resolved",
ErrorType: 1006,
Retryable: false
} | COLUMN_NOT_FOUND: line 1:8: Column 'abc' cannot be resolved
Avatar
Avatar

The issue with the query is that the column abc is not present in the ethereum_mainnet.blocks table. Hence, it is throwing the error "Column 'abc' cannot be resolved". To fix the query, you need to replace the abc column with the correct column name present in the table.

Assuming you want to retrieve the block number and hash, the correct query would be:

SELECT number, hash FROM ethereum_mainnet.blocks LIMIT 3