[jira] [Commented] (HIVE-13953) Issues in HiveLockObject equals method
[ https://issues.apache.org/jira/browse/HIVE-13953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15317748#comment-15317748 ] Chaoyu Tang commented on HIVE-13953: The eight failed tests are not related to this patch. the test stats_list_bucket.q fails even without this patch applied. Other seven failed tests are aged. > Issues in HiveLockObject equals method > -- > > Key: HIVE-13953 > URL: https://issues.apache.org/jira/browse/HIVE-13953 > Project: Hive > Issue Type: Bug > Components: Locking >Reporter: Chaoyu Tang >Assignee: Chaoyu Tang > Attachments: HIVE-13953.patch > > > There are two issues in equals method in HiveLockObject: > {code} > @Override > public boolean equals(Object o) { > if (!(o instanceof HiveLockObject)) { > return false; > } > HiveLockObject tgt = (HiveLockObject) o; > return Arrays.equals(pathNames, tgt.pathNames) && > data == null ? tgt.getData() == null : > tgt.getData() != null && data.equals(tgt.getData()); > } > {code} > 1. Arrays.equals(pathNames, tgt.pathNames) might return false for the same > path in HiveLockObject since in current Hive, the pathname components might > be stored in two ways, taking a dynamic partition path db/tbl/part1/part2 as > an example, it might be stored in the pathNames as an array of four elements, > db, tbl, part1, and part2 or as an array only having one element > db/tbl/part1/part2. It will be safer to comparing the pathNames using > StringUtils.equals(this.getName(), tgt.getName()) > 2. The comparison logic is not right. > {code} > @Override > public boolean equals(Object o) { > if (!(o instanceof HiveLockObject)) { > return false; > } > HiveLockObject tgt = (HiveLockObject) o; > return StringUtils.equals(this.getName(), tgt.getName()) && > (data == null ? tgt.getData() == null : data.equals(tgt.getData())); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-13953) Issues in HiveLockObject equals method
[ https://issues.apache.org/jira/browse/HIVE-13953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15317668#comment-15317668 ] Hive QA commented on HIVE-13953: Here are the results of testing the latest attachment: https://issues.apache.org/jira/secure/attachment/12808434/HIVE-13953.patch {color:red}ERROR:{color} -1 due to no test(s) being added or modified. {color:red}ERROR:{color} -1 due to 8 failed/errored test(s), 10220 tests executed *Failed tests:* {noformat} org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_acid_globallimit org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_acid_table_stats org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_list_bucket_dml_12 org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_list_bucket_dml_13 org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_stats_list_bucket org.apache.hadoop.hive.cli.TestCliDriver.testCliDriver_subquery_multiinsert org.apache.hadoop.hive.cli.TestMiniSparkOnYarnCliDriver.testCliDriver_constprog_partitioner org.apache.hadoop.hive.cli.TestMiniSparkOnYarnCliDriver.testCliDriver_index_bitmap3 {noformat} Test results: https://builds.apache.org/job/PreCommit-HIVE-MASTER-Build/21/testReport Console output: https://builds.apache.org/job/PreCommit-HIVE-MASTER-Build/21/console Test logs: http://ec2-50-18-27-0.us-west-1.compute.amazonaws.com/logs/PreCommit-HIVE-MASTER-Build-21/ Messages: {noformat} Executing org.apache.hive.ptest.execution.TestCheckPhase Executing org.apache.hive.ptest.execution.PrepPhase Executing org.apache.hive.ptest.execution.ExecutionPhase Executing org.apache.hive.ptest.execution.ReportingPhase Tests exited with: TestsFailedException: 8 tests failed {noformat} This message is automatically generated. ATTACHMENT ID: 12808434 - PreCommit-HIVE-MASTER-Build > Issues in HiveLockObject equals method > -- > > Key: HIVE-13953 > URL: https://issues.apache.org/jira/browse/HIVE-13953 > Project: Hive > Issue Type: Bug > Components: Locking >Reporter: Chaoyu Tang >Assignee: Chaoyu Tang > Attachments: HIVE-13953.patch > > > There are two issues in equals method in HiveLockObject: > {code} > @Override > public boolean equals(Object o) { > if (!(o instanceof HiveLockObject)) { > return false; > } > HiveLockObject tgt = (HiveLockObject) o; > return Arrays.equals(pathNames, tgt.pathNames) && > data == null ? tgt.getData() == null : > tgt.getData() != null && data.equals(tgt.getData()); > } > {code} > 1. Arrays.equals(pathNames, tgt.pathNames) might return false for the same > path in HiveLockObject since in current Hive, the pathname components might > be stored in two ways, taking a dynamic partition path db/tbl/part1/part2 as > an example, it might be stored in the pathNames as an array of four elements, > db, tbl, part1, and part2 or as an array only having one element > db/tbl/part1/part2. It will be safer to comparing the pathNames using > StringUtils.equals(this.getName(), tgt.getName()) > 2. The comparison logic is not right. > {code} > @Override > public boolean equals(Object o) { > if (!(o instanceof HiveLockObject)) { > return false; > } > HiveLockObject tgt = (HiveLockObject) o; > return StringUtils.equals(this.getName(), tgt.getName()) && > (data == null ? tgt.getData() == null : data.equals(tgt.getData())); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HIVE-13953) Issues in HiveLockObject equals method
[ https://issues.apache.org/jira/browse/HIVE-13953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15317062#comment-15317062 ] Yongzhi Chen commented on HIVE-13953: - The fix looks good, +1 pending the testing. > Issues in HiveLockObject equals method > -- > > Key: HIVE-13953 > URL: https://issues.apache.org/jira/browse/HIVE-13953 > Project: Hive > Issue Type: Bug > Components: Locking >Reporter: Chaoyu Tang >Assignee: Chaoyu Tang > Attachments: HIVE-13953.patch > > > There are two issues in equals method in HiveLockObject: > {code} > @Override > public boolean equals(Object o) { > if (!(o instanceof HiveLockObject)) { > return false; > } > HiveLockObject tgt = (HiveLockObject) o; > return Arrays.equals(pathNames, tgt.pathNames) && > data == null ? tgt.getData() == null : > tgt.getData() != null && data.equals(tgt.getData()); > } > {code} > 1. Arrays.equals(pathNames, tgt.pathNames) might return false for the same > path in HiveLockObject since in current Hive, the pathname components might > be stored in two ways, taking a dynamic partition path db/tbl/part1/part2 as > an example, it might be stored in the pathNames as an array of four elements, > db, tbl, part1, and part2 or as an array only having one element > db/tbl/part1/part2. It will be safer to comparing the pathNames using > StringUtils.equals(this.getName(), tgt.getName()) > 2. The comparison logic is not right. > {code} > @Override > public boolean equals(Object o) { > if (!(o instanceof HiveLockObject)) { > return false; > } > HiveLockObject tgt = (HiveLockObject) o; > return StringUtils.equals(this.getName(), tgt.getName()) && > (data == null ? tgt.getData() == null : data.equals(tgt.getData())); > } > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)