sankarh commented on a change in pull request #725: HIVE-21992: REPL DUMP 
throws NPE when dumping Create Function event.
URL: https://github.com/apache/hive/pull/725#discussion_r304005459
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/io/FunctionSerializer.java
 ##########
 @@ -51,18 +51,20 @@ public void writeTo(JsonWriter writer, ReplicationSpec 
additionalPropertiesProvi
       throws SemanticException, IOException, MetaException {
     TSerializer serializer = new TSerializer(new TJSONProtocol.Factory());
     List<ResourceUri> resourceUris = new ArrayList<>();
-    for (ResourceUri uri : function.getResourceUris()) {
-      Path inputPath = new Path(uri.getUri());
-      if ("hdfs".equals(inputPath.toUri().getScheme())) {
-        FileSystem fileSystem = inputPath.getFileSystem(hiveConf);
-        Path qualifiedUri = PathBuilder.fullyQualifiedHDFSUri(inputPath, 
fileSystem);
-        // Initialize ReplChangeManager instance since we will require it to 
encode file URI.
-        ReplChangeManager.getInstance(hiveConf);
-        String checkSum = ReplChangeManager.checksumFor(qualifiedUri, 
fileSystem);
-        String newFileUri = 
ReplChangeManager.encodeFileUri(qualifiedUri.toString(), checkSum, null);
-        resourceUris.add(new ResourceUri(uri.getResourceType(), newFileUri));
-      } else {
-        resourceUris.add(uri);
+    if (function.getResourceUris() != null) {
 
 Review comment:
   it seems to be a valid case which "CREATE FUNCTION" command allows.

----------------------------------------------------------------
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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to