Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,24 @@ public void preCreateTable(org.apache.hadoop.hive.metastore.api.Table hmsTable)
// so that the table can be read by other engines like Impala
hmsTable.getSd().setInputFormat(HiveIcebergInputFormat.class.getCanonicalName());
hmsTable.getSd().setOutputFormat(HiveIcebergOutputFormat.class.getCanonicalName());
}

// If not using HiveCatalog check for existing table
try {
this.icebergTable = Catalogs.loadTable(conf, catalogProperties);
// Check for existing table
try {
this.icebergTable = Catalogs.loadTable(conf, catalogProperties);

if (!Catalogs.hiveCatalog(conf, catalogProperties)) {
Preconditions.checkArgument(catalogProperties.getProperty(InputFormatConfig.TABLE_SCHEMA) == null,
"Iceberg table already created - can not use provided schema");
"Iceberg table already created - can not use provided schema");
Preconditions.checkArgument(catalogProperties.getProperty(InputFormatConfig.PARTITION_SPEC) == null,
"Iceberg table already created - can not use provided partition specification");
"Iceberg table already created - can not use provided partition specification");
}

LOG.info("Iceberg table already exists {}", icebergTable);
LOG.info("Iceberg table already exists {}", icebergTable);

return;
} catch (NoSuchTableException nte) {
// If the table does not exist we will create it below
}
return;
} catch (NoSuchTableException nte) {
// If the table does not exist we will create it below
}

// If the table does not exist collect data for table creation
Expand Down