aasha commented on a change in pull request #1249:
URL: https://github.com/apache/hive/pull/1249#discussion_r456403763



##########
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:
       Does this depend on whether copy of load flag is true or false? Or 
always we will do it at the time of load?




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to