You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2022/07/18 13:21:51 UTC
[GitHub] [iceberg] bhanuunrivalled commented on issue #1766: Reading iceberg table using Amazon Athena
bhanuunrivalled commented on issue #1766:
URL: https://github.com/apache/iceberg/issues/1766#issuecomment-1187413248
HI @jackye1995 ,
I ran this test case
org.apache.iceberg.aws.glue.TestGlueCatalogTable#testUpdateTable
` @Test
public void testUpdateTable() {
String namespace = createNamespace();
String tableName = getRandomName();
// current should be null
TableOperations ops = glueCatalog.newTableOps(TableIdentifier.of(namespace, tableName));
TableMetadata current = ops.current();
Assert.assertNull(current);
// create table, refresh should update
createTable(namespace, tableName);
current = ops.refresh();
Assert.assertEquals(schema.toString(), current.schema().toString());
Assert.assertEquals(partitionSpec, current.spec());
Table table = glueCatalog.loadTable(TableIdentifier.of(namespace, tableName));
Assert.assertTrue("initial table history should be empty", table.history().isEmpty());
// commit new version, should create a new snapshot
table = glueCatalog.loadTable(TableIdentifier.of(namespace, tableName));
DataFile dataFile = DataFiles.builder(partitionSpec)
.withPath("/path/to/data-a.parquet")
.withFileSizeInBytes(10)
.withRecordCount(1)
.build();
table.newAppend().appendFile(dataFile).commit();
table = glueCatalog.loadTable(TableIdentifier.of(namespace, tableName));
Assert.assertEquals("commit should create a new table version", 1, table.history().size());
// check table in Glue
GetTableResponse response = glue.getTable(GetTableRequest.builder()
.databaseName(namespace).name(tableName).build());
Assert.assertEquals("external table type is set after update", "EXTERNAL_TABLE", response.table().tableType());
Assert.assertEquals(schema.columns().size(), response.table().storageDescriptor().columns().size());
Assert.assertEquals(partitionSpec.fields().size(), response.table().partitionKeys().size());
}`
at the line
` table = glueCatalog.loadTable(TableIdentifier.of(namespace, tableName));`
i added a break point .
during this time I go to athena and query the random table created .
but I get the error ,
<img width="807" alt="image" src="https://user-images.githubusercontent.com/4332242/179520382-fe4b697d-d208-4764-8b94-4e0c5b8e0710.png">
we want the iceberg table to be queried by Athena . I sent you contact request in Linkedin
pls help
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org