Andrew Wong has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/15758 )

Change subject: [partitioning] KUDU-2671 Support for different hash 
partitioning per range partition.
......................................................................


Patch Set 3:

(10 comments)

http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition-test.cc
File src/kudu/common/partition-test.cc:

http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition-test.cc@862
PS3, Line 862: Parttions
nit: Partitions


http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition-test.cc@894
PS3, Line 894:   EXPECT_EQ(R"(HASH (k) PARTITION 0, RANGE (k) PARTITION 10 <= 
VALUES < 20)",
             :             partition_schema.PartitionDebugString(partitions[0], 
(*range_hash_buckets)[0], schema));
             :   EXPECT_EQ(R"(HASH (k) PARTITION 1, RANGE (k) PARTITION 10 <= 
VALUES < 20)",
             :             partition_schema.PartitionDebugString(partitions[1], 
(*range_hash_buckets)[0], schema));
I thought the goal of this test was to test the ability to create range 
partitions with different numbers of hash buckets. Isn't this testing a single 
range partition with multiple hash buckets?


http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition.h
File src/kudu/common/partition.h:

http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition.h@150
PS3, Line 150:   using RangeHashBuckets = 
boost::optional<std::vector<std::vector<HashBucketSchema>>>;
nit: I think it'd be more self-documenting and easier to immediately understand 
if this type were just vector<vector<HashBucketSchema>>, and we explicitly 
plumbed optional<RangeHashBuckets> into the callsites. That way it's very 
obvious to readers that the buckets are optional, without coming back to this 
def. Alternatively, rename this OptionalRangeHashBuckets or somesuch (though I 
think the former approach is more the norm of this codebase).


http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition.h@178
PS3, Line 178:                           const RangeHashBuckets& 
range_hash_buckets,
nit: should also mention in the comment how this is expected to be used, and 
how it interacts with hash_bucket_schemas_


http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition.cc
File src/kudu/common/partition.cc:

http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition.cc@316
PS3, Line 316: PartitionSchema::
nit: Don't need? Same elsewhere.


http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition.cc@368
PS3, Line 368: hash_bucket_schemas_
If we are supposed to be using 'range_hash_buckets', why are we using 
'hash_bucket_schemas_'? Or is the idea that this is empty if we're using 
'range_hash_buckets'?


http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition.cc@405
PS3, Line 405:     // start per range hash partitions iterator
nit: while I appreciate the hints, I think it'd be much more helpful in 
understanding this to comment in full sentences, so readers can understand the 
big picture up front.

We generally defer to the Google C++ style guide: 
https://google.github.io/styleguide/cppguide.html#Punctuation,_Spelling_and_Grammar


http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition.cc@409
PS3, Line 409:     for (const auto& bound : bounds) {
             :
             :       // get vector of hash partitioning schemas for that range
             :       const vector<HashBucketSchema>& range_bucket_schemas = 
*next_range_hash_buckets;
             :
nit: may be slightly less error-prone to iterate via an index and just refer to 
bounds[i] and range_hash_buckets[i]


http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition.cc@420
PS3, Line 420: // for every partition created earlier
             :         for (const Partition& base_partition : *partitions) {
             :           // for every bucket in current hash partitioning 
schema for that range
nit: maybe "For every hash partition created above, replace it with multiple 
range partitions for the hash."


http://gerrit.cloudera.org:8080/#/c/15758/3/src/kudu/common/partition.cc@431
PS3, Line 431:         partitions->swap(new_partitions);
Shouldn't we only swap after we've created all of the range-hash buckets? 
Otherwise, we're iterating over newly-created range-hash partitions, not just 
the hash partitions created above.



--
To view, visit http://gerrit.cloudera.org:8080/15758
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ie843f37392240c3a47a589658d9702c2049ee011
Gerrit-Change-Number: 15758
Gerrit-PatchSet: 3
Gerrit-Owner: Volodymyr Verovkin <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Grant Henke <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Tidy Bot (241)
Gerrit-Comment-Date: Tue, 21 Apr 2020 22:07:59 +0000
Gerrit-HasComments: Yes

Reply via email to