Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/17643 )
Change subject: [pruning] KUDU-2671: Pruning compatible with custom hash schemas. ...................................................................... Patch Set 7: (4 comments) Not a full review yet, just calling out some style/modernization improvements before jumping into the meat of the patch again. http://gerrit.cloudera.org:8080/#/c/17643/7/src/kudu/common/partition_pruner.h File src/kudu/common/partition_pruner.h: http://gerrit.cloudera.org:8080/#/c/17643/7/src/kudu/common/partition_pruner.h@46 PS7, Line 46: RangeBounds() {} nit: can just be RangeBounds() = default; https://stackoverflow.com/questions/13576055/how-is-default-different-from-for-default-constructor-and-destructor mentions some differences between a user-defined empty constructor vs using the default http://gerrit.cloudera.org:8080/#/c/17643/7/src/kudu/common/partition_pruner.h@47 PS7, Line 47: : RangeBounds(std::string lower, std::string upper) : : lower(std::move(lower)), : upper(std::move(upper)) { : } nit: we shouldn't need these -- we should be able to construct via { lower, upper } or at worst, RangeBounds{ lower, upper } Same in PartitionKeyRange. Did you run into trouble not having these defined? http://gerrit.cloudera.org:8080/#/c/17643/6/src/kudu/common/partition_pruner.h File src/kudu/common/partition_pruner.h: http://gerrit.cloudera.org:8080/#/c/17643/6/src/kudu/common/partition_pruner.h@48 PS6, Line 48: ounds(std > Nope, the pairs aren't related. Each pair contains the range bounds and the +1 for having separate types for separate concerns. Conceptually we shouldn't be able to use range bounds as a partition key bounds, so it's great if we can enforce that via the type system. http://gerrit.cloudera.org:8080/#/c/17643/7/src/kudu/common/partition_pruner.cc File src/kudu/common/partition_pruner.cc: http://gerrit.cloudera.org:8080/#/c/17643/7/src/kudu/common/partition_pruner.cc@533 PS7, Line 533: range_bounds_and_partition_key_range nit: FYI starting in C++17 you can use structured bindings, e.g. for (const auto& [range_bounds, partition_key_range] : range_bounds_to_partition_key_ranges_) { const auto& range_bounds_start = range_bounds.lower; const auto& range_bounds_end = range_bounds.upper; ... } It can be a little finicky around unused variables[1], but it's great when both members of the binding are used. [1] https://stackoverflow.com/a/40714311 -- To view, visit http://gerrit.cloudera.org:8080/17643 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I05c37495430f61a2c6f6012c72251138aee465b7 Gerrit-Change-Number: 17643 Gerrit-PatchSet: 7 Gerrit-Owner: Mahesh Reddy <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Mahesh Reddy <[email protected]> Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Mon, 02 Aug 2021 18:59:54 +0000 Gerrit-HasComments: Yes
