sv2000 commented on a change in pull request #2719: [GOBBLIN-863]Handle race
condition issue for hive registration
URL: https://github.com/apache/incubator-gobblin/pull/2719#discussion_r316971795
##########
File path:
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/metastore/HiveMetaStoreBasedRegister.java
##########
@@ -197,6 +210,16 @@ private boolean
ensureHiveTableExistenceBeforeAlternation(String tableName, Stri
try (Timer.Context context =
this.metricContext.timer(GET_HIVE_TABLE).time()) {
existingTable =
HiveMetaStoreUtils.getHiveTable(client.getTable(dbName, tableName));
}
+ if (this.schemaRegistry.isPresent()) {
+ try (Timer.Context context =
this.metricContext.timer(GET_AND_SET_LATEST_SCHEMA).time()) {
+ String latestSchema =
this.schemaRegistry.get().getLatestSchema(topicName).toString();
+
spec.getTable().getSerDeProps().setProp(AvroSerdeUtils.AvroTableProperties.SCHEMA_LITERAL.getPropName(),
latestSchema);
+
table.getSd().setSerdeInfo(HiveMetaStoreUtils.getSerDeInfo(spec.getTable()));
+ } catch (SchemaRegistryException | IOException e) {
+ log.error(String.format("Error when fetch latest for topic %s",
topicName), e);
Review comment:
Minor typo: "Error when fetching latest schema for topic...".
----------------------------------------------------------------
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]
With regards,
Apache Git Services