guilload commented on a change in pull request #1243:
URL: https://github.com/apache/iceberg/pull/1243#discussion_r470767997
##########
File path:
mr/src/test/java/org/apache/iceberg/mr/hive/TestHiveIcebergInputFormat.java
##########
@@ -155,11 +157,31 @@ public void testJoinTables() {
Assert.assertArrayEquals(new Object[] {1L, "Bob", 102L, 33.33d},
rows.get(2));
}
- private void createHiveTable(String table, String location) {
+ protected void createTable(String tableName, Schema schema, List<Record>
records)
+ throws IOException {
+ Table table = createIcebergTable(tableName, schema, records);
+ createHiveTable(tableName, table.location());
+ }
+
+ protected Table createIcebergTable(String tableName, Schema schema,
List<Record> records)
+ throws IOException {
+ String identifier = testTables.identifier("default." + tableName);
+ TestHelper helper = new TestHelper(
+ metastore.hiveConf(), testTables.tables(), identifier, schema,
SPEC, FileFormat.PARQUET, temp);
+ Table table = helper.createTable();
+
+ if (!records.isEmpty()) {
+ helper.appendToTable(helper.writeFile(null, records));
+ }
+
+ return table;
+ }
+
+ protected void createHiveTable(String tableName, String location) {
shell.execute(String.format(
Review comment:
Yeah, I think that will work once the catalog loader handles catalog
settings defined at the table properties level. I'll add this refactor in the
follow up PR.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]