[ 
https://issues.apache.org/jira/browse/HIVE-21992?focusedWorklogId=277520&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-277520
 ]

ASF GitHub Bot logged work on HIVE-21992:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Jul/19 14:14
            Start Date: 16/Jul/19 14:14
    Worklog Time Spent: 10m 
      Work Description: maheshk114 commented on pull request #725: HIVE-21992: 
REPL DUMP throws NPE when dumping Create Function event.
URL: https://github.com/apache/hive/pull/725#discussion_r303932086
 
 

 ##########
 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:
   do we need to inform user if the uri is null ? or we should throw exception ?
 
----------------------------------------------------------------
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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 277520)
    Time Spent: 20m  (was: 10m)

> REPL DUMP throws NPE when dumping Create Function event.
> --------------------------------------------------------
>
>                 Key: HIVE-21992
>                 URL: https://issues.apache.org/jira/browse/HIVE-21992
>             Project: Hive
>          Issue Type: Bug
>          Components: repl
>    Affects Versions: 4.0.0, 3.2.0
>            Reporter: Sankar Hariappan
>            Assignee: Sankar Hariappan
>            Priority: Major
>              Labels: DR, Replication, pull-request-available
>         Attachments: HIVE-21992.01.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> REPL DUMP throws NPE while dumping Create Function event.It seems, null check 
> is missing for function.getResourceUris().
> {code}
> java.lang.NullPointerException
>         at 
> org.apache.hadoop.hive.ql.parse.repl.dump.io.FunctionSerializer.writeTo(FunctionSerializer.java:54)
>         at 
> org.apache.hadoop.hive.ql.parse.repl.dump.events.CreateFunctionHandler.handle(CreateFunctionHandler.java:48)
>         at 
> org.apache.hadoop.hive.ql.exec.repl.ReplDumpTask.dumpEvent(ReplDumpTask.java:304)
>         at 
> org.apache.hadoop.hive.ql.exec.repl.ReplDumpTask.incrementalDump(ReplDumpTask.java:231)
>         at 
> org.apache.hadoop.hive.ql.exec.repl.ReplDumpTask.execute(ReplDumpTask.java:121)
>         at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:212)
>         at 
> org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:103)
>         at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2727)
>         at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:2394)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:2066)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1764)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1758)
>         at 
> org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:157)
>         at 
> org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:226)
>         at 
> org.apache.hive.service.cli.operation.SQLOperation.access$700(SQLOperation.java:87)
>         at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:324)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:422)
>         at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1730)
>         at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:342)
>         at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at java.lang.Thread.run(Thread.java:748)
> FAILED: Execution Error, return code 40000 from 
> org.apache.hadoop.hive.ql.exec.repl.ReplDumpTask. 
> java.lang.NullPointerException
>         at 
> org.apache.hadoop.hive.ql.parse.repl.dump.io.FunctionSerializer.writeTo(FunctionSerializer.java:54)
>         at 
> org.apache.hadoop.hive.ql.parse.repl.dump.events.CreateFunctionHandler.handle(CreateFunctionHandler.java:48)
>         at 
> org.apache.hadoop.hive.ql.exec.repl.ReplDumpTask.dumpEvent(ReplDumpTask.java:304)
>         at 
> org.apache.hadoop.hive.ql.exec.repl.ReplDumpTask.incrementalDump(ReplDumpTask.java:231)
>         at 
> org.apache.hadoop.hive.ql.exec.repl.ReplDumpTask.execute(ReplDumpTask.java:121)
>         at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:212)
>         at 
> org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:103)
>         at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2727)
>         at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:2394)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:2066)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1764)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1758)
>         at 
> org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:157)
>         at 
> org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:226)
>         at 
> org.apache.hive.service.cli.operation.SQLOperation.access$700(SQLOperation.java:87)
>         at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:324)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at javax.security.auth.Subject.doAs(Subject.java:422)
>         at 
> org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1730)
>         at 
> org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:342)
>         at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>         at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>         at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>         at java.lang.Thread.run(Thread.java:748)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to