pkumarsinha commented on a change in pull request #1249:
URL: https://github.com/apache/hive/pull/1249#discussion_r456425658
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/events/CreateFunctionHandler.java
##########
@@ -41,13 +53,36 @@ CreateFunctionMessage eventMessage(String
stringRepresentation) {
public void handle(Context withinContext) throws Exception {
LOG.info("Processing#{} CREATE_FUNCTION message : {}", fromEventId(),
eventMessageAsJSON);
Path metadataPath = new Path(withinContext.eventRoot,
EximUtil.METADATA_NAME);
+ Path dataPath = new Path(withinContext.eventRoot, EximUtil.DATA_PATH_NAME);
FileSystem fileSystem = metadataPath.getFileSystem(withinContext.hiveConf);
-
+ List<DataCopyPath> functionBinaryCopyPaths = new ArrayList<>();
try (JsonWriter jsonWriter = new JsonWriter(fileSystem, metadataPath)) {
- new FunctionSerializer(eventMessage.getFunctionObj(),
withinContext.hiveConf)
- .writeTo(jsonWriter, withinContext.replicationSpec);
+ FunctionSerializer serializer = new
FunctionSerializer(eventMessage.getFunctionObj(),
+ dataPath, withinContext.hiveConf);
+ serializer.writeTo(jsonWriter, withinContext.replicationSpec);
+ functionBinaryCopyPaths.addAll(serializer.getFunctionBinaryCopyPaths());
}
withinContext.createDmd(this).write();
+ copyFunctionBinaries(functionBinaryCopyPaths, withinContext.hiveConf);
+ }
+
+ private void copyFunctionBinaries(List<DataCopyPath>
functionBinaryCopyPaths, HiveConf hiveConf)
Review comment:
no, for function binary copy, we are not using the load flag. It is
retained as it is currently. meaning: earlier during load it used to copy from
src location. Now with this change, it will copy from staging location. So that
src cluster visibility in not required during load of function.
----------------------------------------------------------------
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]