Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/18808 )
Change subject: KUDU-2671 fix updating partition end keys for unbounded ranges ...................................................................... KUDU-2671 fix updating partition end keys for unbounded ranges This patch fixes an issue with updating the hash bucket components for partitions' end keys in case of unbounded ranges. I also added new test scenarios that allowed to spot the issue. The newly added scenarios would fail if not including the fix. In addition, I updated a few other test scenarios to match the current logic of updating the hash partition component of partition end key. The previous implementation of updating the hash components tried to avoid holes in the partition keyspace by carrying over iotas to next hash dimension index, but with the introduction of range-specific hash schemas it's no longer possible to do so while keeping the result key ranges disjoint. For example, consider the following partitioning: [-inf, 0) x 3 buckets x 3 buckets; [0, +inf) x 2 buckets x 2 buckets The original set of ranges looks like the following: [ (0, 0, ""), (0, 0, "0") ) [ (0, 1, ""), (0, 1, "0") ) [ (0, 2, ""), (0, 2, "0") ) [ (1, 0, ""), (1, 0, "0") ) [ (1, 1, ""), (1, 1, "0") ) [ (1, 2, ""), (1, 2, "0") ) [ (2, 0, ""), (2, 0, "0") ) [ (2, 1, ""), (2, 1, "0") ) [ (2, 2, ""), (2, 2, "0") ) [ (0, 0, "0"), (0, 0, "") ) [ (0, 1, "0"), (0, 1, "") ) [ (1, 0, "0"), (1, 0, "") ) [ (1, 1, "0"), (1, 1, "") ) The previous implementation would transform the key range [ (0, 1, "0"), (0, 1, "") ) into [ (0, 1, "0"), (1, 0, "") ), but that would put the key range [ (0, 2, ""), (0, 2, "0") ) inside the transformed one. That would mess up the interval logic of the partition pruning and the client's metacache. As it turns out, the continuous keyspace was just a nice thing to have since the partition pruning and the client metacache work fine with sparse keyspaces as well. Change-Id: I3775f914a3b7cdc294a26911663c2d848f4e491b Reviewed-on: http://gerrit.cloudera.org:8080/18808 Tested-by: Kudu Jenkins Reviewed-by: Mahesh Reddy <[email protected]> Reviewed-by: Abhishek Chennaka <[email protected]> Reviewed-by: Attila Bukor <[email protected]> --- M java/kudu-client/src/test/java/org/apache/kudu/client/TestAlterTable.java M src/kudu/client/flex_partitioning_client-test.cc M src/kudu/common/partition-test.cc M src/kudu/common/partition.cc 4 files changed, 279 insertions(+), 65 deletions(-) Approvals: Kudu Jenkins: Verified Mahesh Reddy: Looks good to me, but someone else must approve Abhishek Chennaka: Looks good to me, but someone else must approve Attila Bukor: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/18808 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I3775f914a3b7cdc294a26911663c2d848f4e491b Gerrit-Change-Number: 18808 Gerrit-PatchSet: 5 Gerrit-Owner: Alexey Serbin <[email protected]> Gerrit-Reviewer: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Mahesh Reddy <[email protected]>
