The OPTIMIZE and VACUUM sql statements described in the docs here https://docs.aws.amazon.com/athena/latest/ug/querying-iceberg-data-optimization.html does not seems to be supported in iceberg tables.
HY000][100071] [Simba][AthenaJDBC](100071) An error has been thrown from the AWS Athena client. line 1:1: mismatched input 'OPTIMIZE'. Expecting: 'ALTER', 'ANALYZE', 'CALL', 'COMMENT', 'COMMIT', 'CREATE', 'DEALLOCATE', 'DELETE', 'DENY', 'DESC', 'DESCRIBE', 'DROP', 'EXECUTE', 'EXPLAIN', 'GRANT', 'INSERT', 'MERGE', 'PREPARE', 'REFRESH', 'RESET', 'REVOKE', 'ROLLBACK', 'SET', 'SHOW', 'START', 'TRUNCATE', 'UNLOAD', 'UPDATE', 'USE', <query> [Execution ID not available] line 1:1: mismatched input 'OPTIMIZE'. Expecting: 'ALTER', 'ANALYZE', 'CALL', 'COMMENT', 'COMMIT', 'CREATE', 'DEALLOCATE', 'DELETE', 'DENY', 'DESC', 'DESCRIBE', 'DROP', 'EXECUTE', 'EXPLAIN', 'GRANT', 'INSERT', 'MERGE', 'PREPARE', 'REFRESH', 'RESET', 'REVOKE', 'ROLLBACK', 'SET', 'SHOW', 'START', 'TRUNCATE', 'UNLOAD', 'UPDATE', 'USE', <query> (Service: AmazonAthena; Status Code: 400; Error Code: InvalidRequestException; Request ID: b903dd29-d6b2-404c-9a94-e41bdf0d27cb; Proxy: null)
If this is true the docs should be updated.
The table is added by iceberg. The table format is Apache Iceberg. What sounds weird is that each table added directly by iceberg does not show any info about Input/Output Format and Serde lib.
Iceberg tables are not standard, the main thing is that in the parameters specified "table_type": "ICEBERG" and the metadata_location
Got it. That said my tables have table_type ICEBERG and the metadata_location set. Still OPTIMIZE and VACUUM commands does not work from Athena. Any suggestion?