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 2021/11/12 08:01:59 UTC
[GitHub] [iceberg] openinx commented on a change in pull request #3539: Hive: Allow to create external table to access the iceberg table managed in hive catalog
openinx commented on a change in pull request #3539:
URL: https://github.com/apache/iceberg/pull/3539#discussion_r748046649
##########
File path: mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergStorageHandlerLocalScan.java
##########
@@ -311,6 +313,26 @@ public void testCreateTableWithColumnSpecificationMultilevelPartitioned() throws
runCreateAndReadTest(identifier, createSql, HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA, spec, data);
}
+ @Test
+ public void testExternalTableToTableManagedInHiveCatalog() throws IOException {
+ Assume.assumeTrue("Only relevant for HiveCatalog", testTableType == TestTables.TestTableType.HIVE_CATALOG);
+
+ TableIdentifier identifier = TableIdentifier.of("default", "customers");
+ testTables.createIcebergTable(shell.getHiveConf(), identifier.name(),
+ HiveIcebergStorageHandlerTestUtils.CUSTOMER_SCHEMA, FileFormat.PARQUET,
+ Collections.emptyList());
+
+ Map<StructLike, List<Record>> data = Maps.newHashMap();
+ data.put(null, HiveIcebergStorageHandlerTestUtils.CUSTOMER_RECORDS);
+
+ String createSql = String.format("CREATE EXTERNAL TABLE external_table_to_iceberg " +
+ "STORED BY 'org.apache.iceberg.mr.hive.HiveIcebergStorageHandler' " +
+ "TBLPROPERTIES('name'='%s')", identifier);
Review comment:
The `name` property seems like to be an internal property for convertion between hive table and iceberg table, I'm not sure it is correct to expose as a table property like this to hive sql users.
--
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