rdblue commented on code in PR #4946:
URL: https://github.com/apache/iceberg/pull/4946#discussion_r890377453
##########
hive-metastore/src/test/java/org/apache/iceberg/hive/HiveTableTest.java:
##########
@@ -404,6 +389,80 @@ public void testRegisterTable() throws TException {
Assert.assertEquals(originalTable.getSd(), newTable.getSd());
}
+ @Test
+ public void testRegisterHadoopTableToHiveCatalog() throws IOException,
TException {
+ // create a hadoop catalog
+ String tableLocation = tempFolder.newFolder().toString();
+ HadoopCatalog hadoopCatalog = new HadoopCatalog(new Configuration(),
tableLocation);
+ // create table using hadoop catalog
+ TableIdentifier identifier = TableIdentifier.of(DB_NAME, "table1");
+ Table table = hadoopCatalog.createTable(identifier, schema,
PartitionSpec.unpartitioned(), Maps.newHashMap());
+ // insert some data
+ appendData(table, "file1");
+ List<FileScanTask> tasks = Lists.newArrayList(table.newScan().planFiles());
+ Assert.assertEquals("Should scan 1 file", 1, tasks.size());
Review Comment:
Should this validate that the file is `file1`?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]