homatthew commented on code in PR #3633:
URL: https://github.com/apache/gobblin/pull/3633#discussion_r1098109140
##########
gobblin-hive-registration/src/main/java/org/apache/gobblin/hive/writer/HiveMetadataWriter.java:
##########
@@ -232,12 +222,69 @@ public void write(GobblinMetadataChangeEvent gmce,
Map<String, Collection<HiveSp
break;
}
default: {
- log.error("unsupported operation {}",
gmce.getOperationType().toString());
+ log.error("unsupported operation {}", opType);
return;
}
}
}
+ /**
+ * Helper function to gracefully handle errors when creating a hive table.
Existence is not an error.
Review Comment:
Maybe the wording here is confusing. What I am trying to convey is that
Existence of the table when making this call still returns true. What do you
think of the following wording instead?
> If the table existed before calling this method, the method will still
return true
The reason I even chose to add this wording is because the underlying call
is `createTableIfNotExists`, which returns false if the table already existed.
```
/**
* Create a Hive table if not exists.
*
* @param table a {@link HiveTable} to be created.
* @return true if the table is successfully created; false if the table
already exists.
* @throws IOException
*/
public abstract boolean createTableIfNotExists(HiveTable table)
throws IOException;
```
--
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]