[jira] [Commented] (HIVE-23295) Possible NPE when on getting predicate literal list when dynamic values are not available
[ https://issues.apache.org/jira/browse/HIVE-23295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17093967#comment-17093967 ] Jason Dere commented on HIVE-23295: --- +1 > Possible NPE when on getting predicate literal list when dynamic values are > not available > - > > Key: HIVE-23295 > URL: https://issues.apache.org/jira/browse/HIVE-23295 > Project: Hive > Issue Type: Bug > Components: storage-api >Reporter: Attila Magyar >Assignee: Attila Magyar >Priority: Major > Fix For: 4.0.0 > > Attachments: HIVE-23295.1.patch > > > getLiteralList() in SearchArgumentImpl$PredicateLeafImpl returns null if > dynamic values are not available. > {code:java} > @Override > public List getLiteralList() { > if (literalList != null && literalList.size() > 0 && literalList.get(0) > instanceof LiteralDelegate) { > List newLiteraList = new ArrayList(); > try { > for (Object litertalObj : literalList) { > Object literal = ((LiteralDelegate) litertalObj).getLiteral(); > if (literal != null) { > newLiteraList.add(literal); > } > } > } catch (NoDynamicValuesException err) { > LOG.debug("Error while retrieving literalList, returning null", err); > return null; > } > return newLiteraList; > } > return literalList; > } {code} > > There are multiple call sites where the return value is used without a null > check. E.g: leaf.getLiteralList().stream(). > > The return null was added as part of HIVE-18827 to avoid having an > unimportant warning message when dynamic values have not been delivered yet. > > [~sershe], [~jdere], I propose return an empty list instead of null in a case > like this. What do you think? -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (HIVE-23295) Possible NPE when on getting predicate literal list when dynamic values are not available
[ https://issues.apache.org/jira/browse/HIVE-23295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092059#comment-17092059 ] Hive QA commented on HIVE-23295: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/13001073/HIVE-23295.1.patch {color:red}ERROR:{color} -1 due to no test(s) being added or modified. {color:green}SUCCESS:{color} +1 due to 17141 tests passed Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/21931/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/21931/console Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-21931/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.YetusPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase {noformat} This message is automatically generated. ATTACHMENT ID: 13001073 - PreCommit-HIVE-Build > Possible NPE when on getting predicate literal list when dynamic values are > not available > - > > Key: HIVE-23295 > URL: https://issues.apache.org/jira/browse/HIVE-23295 > Project: Hive > Issue Type: Bug > Components: storage-api >Reporter: Attila Magyar >Assignee: Attila Magyar >Priority: Major > Fix For: 4.0.0 > > Attachments: HIVE-23295.1.patch > > > getLiteralList() in SearchArgumentImpl$PredicateLeafImpl returns null if > dynamic values are not available. > {code:java} > @Override > public List getLiteralList() { > if (literalList != null && literalList.size() > 0 && literalList.get(0) > instanceof LiteralDelegate) { > List newLiteraList = new ArrayList(); > try { > for (Object litertalObj : literalList) { > Object literal = ((LiteralDelegate) litertalObj).getLiteral(); > if (literal != null) { > newLiteraList.add(literal); > } > } > } catch (NoDynamicValuesException err) { > LOG.debug("Error while retrieving literalList, returning null", err); > return null; > } > return newLiteraList; > } > return literalList; > } {code} > > There are multiple call sites where the return value is used without a null > check. E.g: leaf.getLiteralList().stream(). > > The return null was added as part of HIVE-18827 to avoid having an > unimportant warning message when dynamic values have not been delivered yet. > > [~sershe], [~jdere], I propose return an empty list instead of null in a case > like this. What do you think? -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (HIVE-23295) Possible NPE when on getting predicate literal list when dynamic values are not available
[ https://issues.apache.org/jira/browse/HIVE-23295?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17092050#comment-17092050 ] Hive QA commented on HIVE-23295: | (/) *{color:green}+1 overall{color}* | \\ \\ || Vote || Subsystem || Runtime || Comment || || || || || {color:brown} Prechecks {color} || | {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s{color} | {color:green} The patch does not contain any @author tags. {color} | || || || || {color:brown} master Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 10m 40s{color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 11s{color} | {color:green} master passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 12s{color} | {color:green} master passed {color} | | {color:blue}0{color} | {color:blue} findbugs {color} | {color:blue} 0m 23s{color} | {color:blue} storage-api in master has 51 extant Findbugs warnings. {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 11s{color} | {color:green} master passed {color} | || || || || {color:brown} Patch Compile Tests {color} || | {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 12s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 11s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 11s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 12s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s{color} | {color:green} The patch has no whitespace issues. {color} | | {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 0m 33s{color} | {color:green} the patch passed {color} | | {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 11s{color} | {color:green} the patch passed {color} | || || || || {color:brown} Other Tests {color} || | {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 15s{color} | {color:green} The patch does not generate ASF License warnings. {color} | | {color:black}{color} | {color:black} {color} | {color:black} 13m 36s{color} | {color:black} {color} | \\ \\ || Subsystem || Report/Notes || | Optional Tests | asflicense javac javadoc findbugs checkstyle compile | | uname | Linux hiveptest-server-upstream 3.16.0-4-amd64 #1 SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux | | Build tool | maven | | Personality | /data/hiveptest/working/yetus_PreCommit-HIVE-Build-21931/dev-support/hive-personality.sh | | git revision | master / 88053b2 | | Default Java | 1.8.0_111 | | findbugs | v3.0.1 | | modules | C: storage-api U: storage-api | | Console output | http://104.198.109.242/logs//PreCommit-HIVE-Build-21931/yetus.txt | | Powered by | Apache Yetushttp://yetus.apache.org | This message was automatically generated. > Possible NPE when on getting predicate literal list when dynamic values are > not available > - > > Key: HIVE-23295 > URL: https://issues.apache.org/jira/browse/HIVE-23295 > Project: Hive > Issue Type: Bug > Components: storage-api >Reporter: Attila Magyar >Assignee: Attila Magyar >Priority: Major > Fix For: 4.0.0 > > Attachments: HIVE-23295.1.patch > > > getLiteralList() in SearchArgumentImpl$PredicateLeafImpl returns null if > dynamic values are not available. > {code:java} > @Override > public List getLiteralList() { > if (literalList != null && literalList.size() > 0 && literalList.get(0) > instanceof LiteralDelegate) { > List newLiteraList = new ArrayList(); > try { > for (Object litertalObj : literalList) { > Object literal = ((LiteralDelegate) litertalObj).getLiteral(); > if (literal != null) { > newLiteraList.add(literal); > } > } > } catch (NoDynamicValuesException err) { > LOG.debug("Error while retrieving literalList, returning null", err); > return null; > } > return newLiteraList; > } > return literalList; > } {code} > > There are multiple call sites where the return value is used without a null > check. E.g: leaf.getLiteralList().stream(). > > The return null was added as part of HIVE-18827 to avoid having an > unimportant warning message when dynamic values have not been delivered yet. > > [~sershe], [~jdere], I propose return an empty list