Getting TABLE_REDIRECTION_ERROR in AWS Athena when querying iceberg history.

0

I have a glue database called edb_iris_iceberg_test. It has an iceberg type table called sample_data_iceberg_2.

Below is the table DDL -

CREATE TABLE edb_iris_iceberg_test.sample_data_iceberg_2 (
  id int,
  first_name string,
  last_name string,
  email string,
  gender string,
  ip_address string,
  cc string,
  country string,
  birthdate string,
  salary double,
  title string,
  comments string)
PARTITIONED BY (`country`)
LOCATION 's3://bucketname/iris/iceberg_test/sample_data_iceberg_2'
TBLPROPERTIES (
  'table_type'='iceberg',
  'format'='parquet'
);

Some data updates and insertions have been done on the iceberg table.

When I try to execute the below query -

select * from "edb_iris_iceberg_test"."sample_data_iceberg_2$iceberg_history";

it is throwing me the below error -

TABLE_REDIRECTION_ERROR: Table 'awsdatacatalog.edb_iris_iceberg_test.sample_data_iceberg_2$iceberg_history' redirected to 'awsdatacatalog$iceberg-aws.edb_iris_iceberg_test.sample_data_iceberg_2$iceberg_history', but the target table 'awsdatacatalog$iceberg-aws.edb_iris_iceberg_test.sample_data_iceberg_2$iceberg_history' does not exist
This query ran against the "edb_iris_iceberg_test" database, unless qualified by the query. Please post the error message on our forum  or contact customer support  with Query Id: 0877b36c-8b08-4636-8802-869d6e90e2ef

What am I doing wrong ?

suraj
asked a month ago241 views
1 Answer
0

The below query is giving the correct history results.

select * from "edb_iris_iceberg_test"."sample_data_iceberg_2$history";
suraj
answered a month ago
profile picture
EXPERT
reviewed a month ago