Mahesh Reddy has uploaded this change for review. ( http://gerrit.cloudera.org:8080/17090
Change subject: KUDU-2671: Adds compatibility for per range hash schems with unbounded ranges. ...................................................................... KUDU-2671: Adds compatibility for per range hash schems with unbounded ranges. This patch updates the logic at the end of PartitionSchema::CreatePartiitons() to allow per range hash schemas to be compatible with unbounded ranges. Some additional context about the block of code is given below. For the start partition key, it iterates in reverse order through the partition's hash buckets. It breaks out of the loop at the first instance of a bucket not equal to 0; If the bucket is equal to 0 it erases that part of the partition key. Essentially, if all hash buckets are equal to 0, then it erases the entire key. For the end partition key, it also iterates in reverse order through the partition's hash buckets. It first erases the index portition of the partition key. It then checks if the current hash bucket is the max bucket of the current hash schema. If it is not the max, it encodes the current hash bucket + 1 at the index portion of the key and breaks the loop. If it is the max, it continues within the loop. Essentially, if all the hash buckets are the max then it erases the entire key. Prior to this change, this block of code assumed the same hash bucket schema for each partition. With per range hash schemas, that may not necessarily be the case. The vector 'partition_mapping' maps each partition to the index of 'bounds_with_hash_schemas' to ensure the correct hash bucket schema is used. '-1' is used to signify the use of the table wide hash schema. Change-Id: I5f6c709e211359b04f7597af5f670c787bda7481 --- M src/kudu/common/partition-test.cc M src/kudu/common/partition.cc 2 files changed, 159 insertions(+), 4 deletions(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/90/17090/1 -- To view, visit http://gerrit.cloudera.org:8080/17090 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I5f6c709e211359b04f7597af5f670c787bda7481 Gerrit-Change-Number: 17090 Gerrit-PatchSet: 1 Gerrit-Owner: Mahesh Reddy <[email protected]>
