Andrew Wong has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/17090 )
Change subject: KUDU-2671: Adds compatibility for per range hash schemas with unbounded ranges. ...................................................................... KUDU-2671: Adds compatibility for per range hash schemas 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_idx_to_hash_schemas_idx' 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 Reviewed-on: http://gerrit.cloudera.org:8080/17090 Reviewed-by: Andrew Wong <[email protected]> Tested-by: Andrew Wong <[email protected]> --- M src/kudu/common/partition-test.cc M src/kudu/common/partition.cc 2 files changed, 172 insertions(+), 5 deletions(-) Approvals: Andrew Wong: Looks good to me, approved; Verified -- 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: merged Gerrit-Change-Id: I5f6c709e211359b04f7597af5f670c787bda7481 Gerrit-Change-Number: 17090 Gerrit-PatchSet: 5 Gerrit-Owner: Mahesh Reddy <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Mahesh Reddy <[email protected]> Gerrit-Reviewer: Tidy Bot (241)
