You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@kudu.apache.org by "Alexey Serbin (Code Review)" <ge...@cloudera.org> on 2021/07/07 06:33:20 UTC
[kudu-CR] WIP [client] KUDU-2671 flexible partitioning during table creation
Alexey Serbin has uploaded this change for review. ( http://gerrit.cloudera.org:8080/17657
Change subject: WIP [client] KUDU-2671 flexible partitioning during table creation
......................................................................
WIP [client] KUDU-2671 flexible partitioning during table creation
WIP:
* receive and process feedback on the proposed API in client.h
for adding a range partition with custom hash sub-partitioning
* add proper commit description
* make implementation actually work: as of now, the expected number of
partitions doesn't match the actual one, at least if checking using
KuduPartitioner
* add more test scenarios: multi-level, negative scenarios, etc.
Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
---
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/client.h
M src/kudu/client/table_creator-internal.cc
M src/kudu/client/table_creator-internal.h
M src/kudu/master/master.proto
6 files changed, 326 insertions(+), 51 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/57/17657/1
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
[kudu-CR] WIP [client] KUDU-2671 flexible partitioning during table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: WIP [client] KUDU-2671 flexible partitioning during table creation
......................................................................
Patch Set 2:
(2 comments)
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client.h
File src/kudu/client/client.h:
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client.h@1214
PS1, Line 1214: add_hash_partitions(c
> nit: maybe call it 'add_hash_partitions()' for consistency with the TableCr
Done
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client.cc
File src/kudu/client/client.cc:
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client.cc@869
PS1, Line 869: add_custom_range_partition(
> nit: I wonder if it makes sense to call this add_custom_range_partition() o
Good point: I considered naming it like that, but I rejected it since I thought it was too vague :) From the other side, if we expect KuduRangePartition to be extended with extra fields and be used in other contexts, suddenly 'add_custom_range_partition()' make much more sense.
Done.
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Fri, 09 Jul 2021 06:00:46 +0000
Gerrit-HasComments: Yes
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Patch Set 8: Code-Review+2
(1 comment)
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/flex_partitioning_client-test.cc
File src/kudu/client/flex_partitioning_client-test.cc:
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/flex_partitioning_client-test.cc@200
PS6, Line 200: NO_FATALS(CheckTabletCount(kTableName, 3));
> Yeah, as you can see it's the table is created without any errors, and it e
+1 about the server-side check.
Wow, nice catch. I wonder if that's been there since day 1.
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 8
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Fri, 16 Jul 2021 20:37:15 +0000
Gerrit-HasComments: Yes
[kudu-CR] WIP [client] KUDU-2671 flexible partitioning during table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: WIP [client] KUDU-2671 flexible partitioning during table creation
......................................................................
Patch Set 1:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client-test.cc
File src/kudu/client/client-test.cc:
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client-test.cc@6895
PS1, Line 6895: This effectively
: // cancels the multi-level partitioning defined by the table-wide hash
: // partition schema, so the newly added range has no hash sub-partitioning.
> Maybe I'm missing it, but isn't this equivalent to calling add_range_partit
In my understanding it's not the case, but it's not clearly articulated here. The idea was to provide a means to have a custom range partition with no hash sub-partitioning, even if the table-wide hash partitioning schema assumes there are hash buckets to create for a non-custom range partition.
Effectively, in PS1 this isn't yet done as needed: you are right there should be a special way to do so since not specifying a hashing schema for KuduRangePartition leads to the outcome you described, as per implementation of KuduTableCreator::add_range_partition() in this PS1.
I guess the code below is missing calling p.add_hash_partitioning({}, 0, 0) or alike.
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 08 Jul 2021 20:47:02 +0000
Gerrit-HasComments: Yes
[kudu-CR] WIP [client] KUDU-2671 flexible partitioning during table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Mahesh Reddy, Kudu Jenkins, Andrew Wong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/17657
to look at the new patch set (#2).
Change subject: WIP [client] KUDU-2671 flexible partitioning during table creation
......................................................................
WIP [client] KUDU-2671 flexible partitioning during table creation
This changelist introduces C++ client API to support flexible table
partitioning while creating a table. In other words, with this patch
it's now possible to create a Kudu table with custom hash bucket
schemas per range partition using Kudu C++ client.
Verification via KuduPartitioner or via PartitionSchema returned by
KuduTable::partition_schema() isn't added yet because it depends on
the proper functioning PartitionPruner, which needs to be updated
correspondingly to understand range partitions with custom hash
schemas (posted as WIP patch at https://gerrit.cloudera.org/#/c/17643/)
WIP:
* Add more test scenarios: multi-level, mixed, negative, end-to-end
(insert rows into the created ranges, check every range gets
rows as expected), etc.
* Probably, separate the newly added test scenarios into a new test:
client-test contains too much scenarios at this point.
* Clarify on whether the current server-side implementation of the
flexible range partitioning supports flat, not hash-partitioned
ranges even if there is table-wide hash bucket partitioning.
* address TODOs, brush up the patch
Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
---
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/client.h
M src/kudu/client/partitioner-internal.cc
M src/kudu/client/table_creator-internal.cc
M src/kudu/client/table_creator-internal.h
M src/kudu/common/partition.cc
M src/kudu/master/master.proto
8 files changed, 501 insertions(+), 56 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/57/17657/2
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 2
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Mahesh Reddy, Kudu Jenkins, Andrew Wong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/17657
to look at the new patch set (#5).
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
[client] KUDU-2671 custom hash buckets API for table creation
This patch introduces changes in the Kudu C++ client API to make it
possible creating a Kudu table with custom hash bucket schemas per
range partition.
This patch doesn't contain the rest of functionality required to make
range partitions with custom hash bucket schemas fully functional. This
is rather a patch focusing on the API side only. The missing pieces will
be addressed in follow-up patches:
* update PartitionSchema to properly encode range keys in case
where range partitions with custom hash bucket schemas are present
(i.e. update PartitionSchema::EncodeKeyImpl() correspondingly)
* update the meta-cache to work with partition range keys built for
tables containing range partitions with custom hash bucket schema
* update other places in client code which are dependent on
PartitionPruner doing proper processing of partition key ranges for
tables containing range partitions with custom hash bucket schema
* add end-to-end tests to verify the proper distribution of inserted
rows among range partitions and among their hash buckets
I also added test coverage to verify the newly introduced functionality
up to some extent, namely making sure the appropriate number of tablets
is created for tables with custom hash bucket schemas per range, adding
TODOs where full end-to-end coverage isn't yet available due to missing
functionality outlined above.
Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
---
M src/kudu/client/CMakeLists.txt
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/client.h
A src/kudu/client/flex_partitioning_client-test.cc
M src/kudu/client/meta_cache.cc
M src/kudu/client/partitioner-internal.cc
M src/kudu/client/table_creator-internal.cc
M src/kudu/client/table_creator-internal.h
M src/kudu/common/partition.cc
M src/kudu/master/master.proto
11 files changed, 688 insertions(+), 68 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/57/17657/5
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 5
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
[kudu-CR] WIP [client] KUDU-2671 flexible partitioning during table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Mahesh Reddy, Kudu Jenkins, Andrew Wong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/17657
to look at the new patch set (#3).
Change subject: WIP [client] KUDU-2671 flexible partitioning during table creation
......................................................................
WIP [client] KUDU-2671 flexible partitioning during table creation
This changelist introduces C++ client API to support flexible table
partitioning while creating a table. In other words, with this patch
it's now possible to create a Kudu table with custom hash bucket
schemas per range partition using the Kudu C++ client.
Verification via KuduPartitioner or via PartitionSchema returned by
KuduTable::partition_schema() isn't added yet because it depends on
the proper functioning PartitionPruner, which needs to be updated
correspondingly to understand range partitions with custom hash
schemas (posted at https://gerrit.cloudera.org/#/c/17643/).
WIP:
* Clarify on whether the current server-side implementation of the
flexible range partitioning supports flat, not hash-partitioned
ranges even if there is table-wide hash bucket partitioning.
* Clarify why current code doesn't support range partitions with
custom hash bucket scheme if no table-wide hash bucket scheme is
declared during table creation: in attemp to insert into
corresponding ranges, the following error surfaces:
Not found: No tablet covering the requested range partition: NonCoveredRange { lower_bound: (RANGE (key): <range-key-decode-error: Invalid argument: unable to fully decode range key: \x80\x00\x002>), upper_bound: (<end>), ttl: 299999ms })
Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
---
M src/kudu/client/CMakeLists.txt
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/client.h
A src/kudu/client/flex_partitioning_client-test.cc
M src/kudu/client/partitioner-internal.cc
M src/kudu/client/table_creator-internal.cc
M src/kudu/client/table_creator-internal.h
M src/kudu/common/partition.cc
M src/kudu/master/master.proto
10 files changed, 679 insertions(+), 60 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/57/17657/3
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 3
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Mahesh Reddy, Kudu Jenkins, Andrew Wong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/17657
to look at the new patch set (#6).
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
[client] KUDU-2671 custom hash buckets API for table creation
This patch introduces changes in the Kudu C++ client API to make it
possible creating a Kudu table with custom hash bucket schemas per
range partition.
This patch doesn't contain the rest of functionality required to make
range partitions with custom hash bucket schemas fully functional. This
is rather a patch focusing on the API side only. The missing pieces will
be addressed in follow-up patches:
* update PartitionSchema to properly encode range keys in case
where range partitions with custom hash bucket schemas are present
(i.e. update PartitionSchema::EncodeKeyImpl() correspondingly)
* update the meta-cache to work with partition range keys built for
tables containing range partitions with custom hash bucket schema
* update other places in client code which are dependent on
PartitionPruner doing proper processing of partition key ranges for
tables containing range partitions with custom hash bucket schema
* add provisions to allow for plain (i.e. without any hash
sub-partitioning) custom range partitions for tables with
table-wide hash bucket schema
* add end-to-end tests to verify the proper distribution of inserted
rows among range partitions and among their hash buckets
I also added test coverage to verify the newly introduced functionality
up to some extent, namely making sure the appropriate number of tablets
is created for tables with custom hash bucket schemas per range, adding
TODOs where full end-to-end coverage isn't yet available due to missing
functionality outlined above.
Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
---
M src/kudu/client/CMakeLists.txt
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/client.h
A src/kudu/client/flex_partitioning_client-test.cc
M src/kudu/client/meta_cache.cc
M src/kudu/client/partitioner-internal.cc
M src/kudu/client/table_creator-internal.cc
M src/kudu/client/table_creator-internal.h
M src/kudu/common/partition.cc
M src/kudu/master/master.proto
11 files changed, 690 insertions(+), 68 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/57/17657/6
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Mahesh Reddy, Kudu Jenkins, Andrew Wong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/17657
to look at the new patch set (#4).
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
[client] KUDU-2671 custom hash buckets API for table creation
This patch introduces changes in the Kudu C++ client API to make it
possible creating a Kudu table with custom hash bucket schemas per
range partition.
This patch doesn't contain the rest of functionality required to make
range partitions with custom hash bucket schemas fully functional. This
is rather a patch focusing on the API side only. The missing pieces will
be addressed in follow-up patches:
* update PartitionSchema to properly encode range keys in case
where range partitions with custom hash bucket schemas are present
(i.e. update PartitionSchema::EncodeKeyImpl() correspondingly)
* update the meta-cache to work with partition range keys built for
tables containing range partitions with custom hash bucket schema
* update other places in client code which are dependent on
PartitionPruner doing proper processing of partition key ranges for
tables containing range partitions with custom hash bucket schema
* add end-to-end tests to verify the proper distribution of inserted
rows among range partitions and among their hash buckets
I also added test coverage to verify the newly introduced functionality
up to some extent, namely making sure the appropriate number of tablets
is created for tables with custom hash bucket schemas per range, adding
TODOs where full end-to-end coverage isn't yet available due to missing
functionality outlined above.
Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
---
M src/kudu/client/CMakeLists.txt
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/client.h
A src/kudu/client/flex_partitioning_client-test.cc
M src/kudu/client/meta_cache.cc
M src/kudu/client/partitioner-internal.cc
M src/kudu/client/table_creator-internal.cc
M src/kudu/client/table_creator-internal.h
M src/kudu/common/partition.cc
M src/kudu/master/master.proto
11 files changed, 687 insertions(+), 68 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/57/17657/4
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 4
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
[kudu-CR] WIP [client] KUDU-2671 flexible partitioning during table creation
Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: WIP [client] KUDU-2671 flexible partitioning during table creation
......................................................................
Patch Set 1:
(5 comments)
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client-test.cc
File src/kudu/client/client-test.cc:
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client-test.cc@6895
PS1, Line 6895: This effectively
: // cancels the multi-level partitioning defined by the table-wide hash
: // partition schema, so the newly added range has no hash sub-partitioning.
Maybe I'm missing it, but isn't this equivalent to calling add_range_partition()? In both cases, wouldn't we add a KuduRangePartition that has an empty list of hash bucket schemas? In which case, wouldn't this be using the table-wide schema as well?
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client.h
File src/kudu/client/client.h:
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client.h@1214
PS1, Line 1214: add_hash_partitioning
nit: maybe call it 'add_hash_partitions()' for consistency with the TableCreator API?
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client.cc
File src/kudu/client/client.cc:
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/client.cc@869
PS1, Line 869: add_range_partition_custom_hash_buckets
nit: I wonder if it makes sense to call this add_custom_range_partition() or somesuch, removing the "hash partition" specification. I can imagine KuduRangePartition growing into something more widely used (e.g. to supply tags for a newly provisioned range).
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/table_creator-internal.cc
File src/kudu/client/table_creator-internal.cc:
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/table_creator-internal.cc@58
PS1, Line 58: // TODO(aserbin): any restrictions on the value of the 'seed' parameter?
It's a good question -- my gut says no to be consistent with the table-wide add_hash_partitions(), but I'm not sure.
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/table_creator-internal.cc@60
PS1, Line 60: le
nit: typo
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 08 Jul 2021 20:01:40 +0000
Gerrit-HasComments: Yes
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Mahesh Reddy (Code Review)" <ge...@cloudera.org>.
Mahesh Reddy has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Patch Set 6:
(7 comments)
http://gerrit.cloudera.org:8080/#/c/17657/6//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/17657/6//COMMIT_MSG@10
PS6, Line 10: creating
nit: to create
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.h
File src/kudu/client/client.h:
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.h@1261
PS6, Line 1261: bucketing.
nit: bucket schema.
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.h@1264
PS6, Line 1264: scheme different from the scheme
nit: schema instead of scheme
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.cc
File src/kudu/client/client.cc:
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.cc@953
PS6, Line 953: has_range_with_custom_hash_schema
nit: can break early after this bool is set to true
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.cc@958
PS6, Line 958: simplitity
nit: simplicity
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.cc@961
PS6, Line 961: splits
nit: split rows
Fwiw, would have to change the expected strings in the tests to match the new string if you do change this.
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/flex_partitioning_client-test.cc
File src/kudu/client/flex_partitioning_client-test.cc:
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/flex_partitioning_client-test.cc@200
PS6, Line 200: // One-level hash bucket structure with hashing on non-key column only:
Aren't hash bucket schemas only permitted to be on any subset of primary key columns? Maybe I'm missing something here but how is this allowed?
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 15 Jul 2021 23:57:23 +0000
Gerrit-HasComments: Yes
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Patch Set 6:
(7 comments)
http://gerrit.cloudera.org:8080/#/c/17657/6//COMMIT_MSG
Commit Message:
http://gerrit.cloudera.org:8080/#/c/17657/6//COMMIT_MSG@10
PS6, Line 10: creating
> nit: to create
Done
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.h
File src/kudu/client/client.h:
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.h@1261
PS6, Line 1261: bucketing.
> nit: bucket schema.
Done
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.h@1264
PS6, Line 1264: scheme different from the scheme
> nit: schema instead of scheme
Done
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.cc
File src/kudu/client/client.cc:
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.cc@953
PS6, Line 953: has_range_with_custom_hash_schema
> nit: can break early after this bool is set to true
Done
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.cc@958
PS6, Line 958: simplitity
> nit: simplicity
Done
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/client.cc@961
PS6, Line 961: splits
> nit: split rows
Done
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/flex_partitioning_client-test.cc
File src/kudu/client/flex_partitioning_client-test.cc:
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/flex_partitioning_client-test.cc@200
PS6, Line 200: // One-level hash bucket structure with hashing on non-key column only:
> Aren't hash bucket schemas only permitted to be on any subset of primary ke
Yeah, as you can see it's the table is created without any errors, and it even contains the required number of replicas :)
Apparently, a check is missing at the server side. Not sure whether we want to put a check into the client side as well, but a check at the server side is a must.
What do you think if I add a check in a follow-up patch and turn corresponding test scenarios into negative ones, checking for proper error status?
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Fri, 16 Jul 2021 17:22:00 +0000
Gerrit-HasComments: Yes
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Patch Set 6: Code-Review+2
(1 comment)
I'll look into the test failure
http://gerrit.cloudera.org:8080/#/c/17657/5/src/kudu/client/flex_partitioning_client-test.cc
File src/kudu/client/flex_partitioning_client-test.cc:
http://gerrit.cloudera.org:8080/#/c/17657/5/src/kudu/client/flex_partitioning_client-test.cc@272
PS5, Line 272: // key 0 1 2 3
> Nope, it's not possible to add a hash with only a single bucket.
SGTM
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 15 Jul 2021 17:57:13 +0000
Gerrit-HasComments: Yes
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has removed a vote on this change.
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Removed Verified-1 by Kudu Jenkins (120)
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Mahesh Reddy, Kudu Jenkins, Andrew Wong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/17657
to look at the new patch set (#8).
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
[client] KUDU-2671 custom hash buckets API for table creation
This patch introduces changes in the Kudu C++ client API to make it
possible to create a Kudu table with custom hash bucket schemas per
range partition.
This patch doesn't contain the rest of functionality required to make
range partitions with custom hash bucket schemas fully functional. This
is rather a patch focusing on the API side only. The missing pieces will
be addressed in follow-up patches:
* update PartitionSchema to properly encode range keys in case
where range partitions with custom hash bucket schemas are present
(i.e. update PartitionSchema::EncodeKeyImpl() correspondingly)
* update the meta-cache to work with partition range keys built for
tables containing range partitions with custom hash bucket schema
* update other places in client code which are dependent on
PartitionPruner doing proper processing of partition key ranges for
tables containing range partitions with custom hash bucket schema
* add checks at the server side to check that the columns used for
custom hash bucket schemas are part of the primary key
* add provisions to allow for plain (i.e. without any hash
sub-partitioning) custom range partitions for tables with
table-wide hash bucket schema
* add end-to-end tests to verify the proper distribution of inserted
rows among range partitions and among their hash buckets
I also added test coverage to verify the newly introduced functionality
up to some extent, namely making sure the appropriate number of tablets
is created for tables with custom hash bucket schemas per range, adding
TODOs where full end-to-end coverage isn't yet available due to missing
functionality outlined above.
Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
---
M src/kudu/client/CMakeLists.txt
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/client.h
A src/kudu/client/flex_partitioning_client-test.cc
M src/kudu/client/meta_cache.cc
M src/kudu/client/partitioner-internal.cc
M src/kudu/client/table_creator-internal.cc
M src/kudu/client/table_creator-internal.h
M src/kudu/common/partition.cc
M src/kudu/master/master.proto
11 files changed, 694 insertions(+), 68 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/57/17657/8
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 8
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Patch Set 1:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/table_creator-internal.cc
File src/kudu/client/table_creator-internal.cc:
http://gerrit.cloudera.org:8080/#/c/17657/1/src/kudu/client/table_creator-internal.cc@60
PS1, Line 60: le
> nit: typo
Done
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 1
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Wed, 14 Jul 2021 21:20:30 +0000
Gerrit-HasComments: Yes
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Mahesh Reddy (Code Review)" <ge...@cloudera.org>.
Mahesh Reddy has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Patch Set 8:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/flex_partitioning_client-test.cc
File src/kudu/client/flex_partitioning_client-test.cc:
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/flex_partitioning_client-test.cc@200
PS6, Line 200: NO_FATALS(CheckTabletCount(kTableName, 3));
> +1 about the server-side check.
Just looked through the code paths now. Looks like today we don't check client side and the hash bucket schemas are only validated server side in `PartitionSchema::FromPB()` after calling PartitionSchema::Validate()`.
Seems like the issue lies within how we populate per range hash schemas in CreateTableRequestPB. If we use the separate field 'ranges_hash_schemas', within CatalogManager::CreateTable() the hash bucket schemas are not validated when this field is decoded.
There are two potential solutions here:
1. Stop using the redundant extra field `ranges_hash_schemas` within CreateTableRequestPB and populate per range hash schemas using the `ranges_hash_schemas` field within PartitionSchemaPB within CreateTableRequestPB. This way, when PartitionSchemaPB is decoded the hash bucket schemas will be properly validated.
2. Add a validation check to where the range hash schemas are currently being decoded at (https://github.com/apache/kudu/blob/master/src/kudu/master/catalog_manager.cc#L1864).
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 8
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Sat, 17 Jul 2021 06:20:40 +0000
Gerrit-HasComments: Yes
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Andrew Wong (Code Review)" <ge...@cloudera.org>.
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Patch Set 5:
(5 comments)
http://gerrit.cloudera.org:8080/#/c/17657/4/src/kudu/client/client.h
File src/kudu/client/client.h:
http://gerrit.cloudera.org:8080/#/c/17657/4/src/kudu/client/client.h@1206
PS4, Line 1206: /// multi-dimensional hash bucket structure for the range partition.
nit: maybe it's worth mentioning that the functionality here isn't complete? And this should not yet be used?
http://gerrit.cloudera.org:8080/#/c/17657/3/src/kudu/client/client.cc
File src/kudu/client/client.cc:
http://gerrit.cloudera.org:8080/#/c/17657/3/src/kudu/client/client.cc@949
PS3, Line 949: This is needed to
nit: unfinished sentence?
http://gerrit.cloudera.org:8080/#/c/17657/4/src/kudu/client/client.cc
File src/kudu/client/client.cc:
http://gerrit.cloudera.org:8080/#/c/17657/4/src/kudu/client/client.cc@949
PS4, Line 949: needed to
nit: incomplete?
http://gerrit.cloudera.org:8080/#/c/17657/4/src/kudu/client/client.cc@988
PS4, Line 988: a:
nit: missing space
http://gerrit.cloudera.org:8080/#/c/17657/5/src/kudu/client/flex_partitioning_client-test.cc
File src/kudu/client/flex_partitioning_client-test.cc:
http://gerrit.cloudera.org:8080/#/c/17657/5/src/kudu/client/flex_partitioning_client-test.cc@272
PS5, Line 272: // key 0 1 2 3
An earlier iteration mentioned adding a range with no hashing at all. If that's not possible, is it possible to have a hash with only a single bucket?
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 5
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Wed, 14 Jul 2021 23:29:13 +0000
Gerrit-HasComments: Yes
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Patch Set 6: Verified+1
unrelated test failure in AutoAddMasterTest.TestAddWithOnGoingDdl
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 15 Jul 2021 14:37:22 +0000
Gerrit-HasComments: No
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
[client] KUDU-2671 custom hash buckets API for table creation
This patch introduces changes in the Kudu C++ client API to make it
possible to create a Kudu table with custom hash bucket schemas per
range partition.
This patch doesn't contain the rest of functionality required to make
range partitions with custom hash bucket schemas fully functional. This
is rather a patch focusing on the API side only. The missing pieces will
be addressed in follow-up patches:
* update PartitionSchema to properly encode range keys in case
where range partitions with custom hash bucket schemas are present
(i.e. update PartitionSchema::EncodeKeyImpl() correspondingly)
* update the meta-cache to work with partition range keys built for
tables containing range partitions with custom hash bucket schema
* update other places in client code which are dependent on
PartitionPruner doing proper processing of partition key ranges for
tables containing range partitions with custom hash bucket schema
* add checks at the server side to check that the columns used for
custom hash bucket schemas are part of the primary key
* add provisions to allow for plain (i.e. without any hash
sub-partitioning) custom range partitions for tables with
table-wide hash bucket schema
* add end-to-end tests to verify the proper distribution of inserted
rows among range partitions and among their hash buckets
I also added test coverage to verify the newly introduced functionality
up to some extent, namely making sure the appropriate number of tablets
is created for tables with custom hash bucket schemas per range, adding
TODOs where full end-to-end coverage isn't yet available due to missing
functionality outlined above.
Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Reviewed-on: http://gerrit.cloudera.org:8080/17657
Tested-by: Kudu Jenkins
Reviewed-by: Andrew Wong <aw...@cloudera.com>
---
M src/kudu/client/CMakeLists.txt
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/client.h
A src/kudu/client/flex_partitioning_client-test.cc
M src/kudu/client/meta_cache.cc
M src/kudu/client/partitioner-internal.cc
M src/kudu/client/table_creator-internal.cc
M src/kudu/client/table_creator-internal.h
M src/kudu/common/partition.cc
M src/kudu/master/master.proto
11 files changed, 694 insertions(+), 68 deletions(-)
Approvals:
Kudu Jenkins: Verified
Andrew Wong: Looks good to me, approved
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 9
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Patch Set 5:
(5 comments)
http://gerrit.cloudera.org:8080/#/c/17657/4/src/kudu/client/client.h
File src/kudu/client/client.h:
http://gerrit.cloudera.org:8080/#/c/17657/4/src/kudu/client/client.h@1206
PS4, Line 1206: /// multi-dimensional hash bucket structure for the range partition.
> nit: maybe it's worth mentioning that the functionality here isn't complete
IIRC, we have similar state for the txn-related stuff before orchestration was ready and didn't annotate anything like that.
Anyways, I added corresponding annotation for the KuduTableCreator::add_custom_range_partition() method (I guess just to remove it later on).
http://gerrit.cloudera.org:8080/#/c/17657/3/src/kudu/client/client.cc
File src/kudu/client/client.cc:
http://gerrit.cloudera.org:8080/#/c/17657/3/src/kudu/client/client.cc@949
PS3, Line 949: This is needed to
> nit: unfinished sentence?
Done
http://gerrit.cloudera.org:8080/#/c/17657/4/src/kudu/client/client.cc
File src/kudu/client/client.cc:
http://gerrit.cloudera.org:8080/#/c/17657/4/src/kudu/client/client.cc@949
PS4, Line 949: needed to
> nit: incomplete?
Done
http://gerrit.cloudera.org:8080/#/c/17657/4/src/kudu/client/client.cc@988
PS4, Line 988: a:
> nit: missing space
Done
http://gerrit.cloudera.org:8080/#/c/17657/5/src/kudu/client/flex_partitioning_client-test.cc
File src/kudu/client/flex_partitioning_client-test.cc:
http://gerrit.cloudera.org:8080/#/c/17657/5/src/kudu/client/flex_partitioning_client-test.cc@272
PS5, Line 272: // key 0 1 2 3
> An earlier iteration mentioned adding a range with no hashing at all. If th
Nope, it's not possible to add a hash with only a single bucket.
As for the provisions to allow for adding a custom range without any hashing even if the table-wide schema has one, that requires special provisions at the server side: I'm going to address that separately (this test scenario will be updated correspondingly).
Overall, I found a few places with some room for improvement, but I'd like to keep this patch to be focused on the API part only (at least that's what I originally thought it would be).
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 5
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Thu, 15 Jul 2021 05:37:35 +0000
Gerrit-HasComments: Yes
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Alexey Serbin has posted comments on this change. ( http://gerrit.cloudera.org:8080/17657 )
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
Patch Set 6:
(1 comment)
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/flex_partitioning_client-test.cc
File src/kudu/client/flex_partitioning_client-test.cc:
http://gerrit.cloudera.org:8080/#/c/17657/6/src/kudu/client/flex_partitioning_client-test.cc@200
PS6, Line 200: // One-level hash bucket structure with hashing on non-key column only:
> Just looked through the code paths now. Looks like today we don't check cli
Right: that piece of technical debt should be addressed in a separate patch.
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 6
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>
Gerrit-Comment-Date: Tue, 20 Jul 2021 15:56:12 +0000
Gerrit-HasComments: Yes
[kudu-CR] [client] KUDU-2671 custom hash buckets API for table creation
Posted by "Alexey Serbin (Code Review)" <ge...@cloudera.org>.
Hello Mahesh Reddy, Kudu Jenkins, Andrew Wong,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/17657
to look at the new patch set (#7).
Change subject: [client] KUDU-2671 custom hash buckets API for table creation
......................................................................
[client] KUDU-2671 custom hash buckets API for table creation
This patch introduces changes in the Kudu C++ client API to make it
possible to create a Kudu table with custom hash bucket schemas per
range partition.
This patch doesn't contain the rest of functionality required to make
range partitions with custom hash bucket schemas fully functional. This
is rather a patch focusing on the API side only. The missing pieces will
be addressed in follow-up patches:
* update PartitionSchema to properly encode range keys in case
where range partitions with custom hash bucket schemas are present
(i.e. update PartitionSchema::EncodeKeyImpl() correspondingly)
* update the meta-cache to work with partition range keys built for
tables containing range partitions with custom hash bucket schema
* update other places in client code which are dependent on
PartitionPruner doing proper processing of partition key ranges for
tables containing range partitions with custom hash bucket schema
* add checks at the server side to check that the columns used for
custom hash bucket schemas are part of the primary key
* add provisions to allow for plain (i.e. without any hash
sub-partitioning) custom range partitions for tables with
table-wide hash bucket schema
* add end-to-end tests to verify the proper distribution of inserted
rows among range partitions and among their hash buckets
I also added test coverage to verify the newly introduced functionality
up to some extent, namely making sure the appropriate number of tablets
is created for tables with custom hash bucket schemas per range, adding
TODOs where full end-to-end coverage isn't yet available due to missing
functionality outlined above.
Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
---
M src/kudu/client/CMakeLists.txt
M src/kudu/client/client-test.cc
M src/kudu/client/client.cc
M src/kudu/client/client.h
A src/kudu/client/flex_partitioning_client-test.cc
M src/kudu/client/meta_cache.cc
M src/kudu/client/partitioner-internal.cc
M src/kudu/client/table_creator-internal.cc
M src/kudu/client/table_creator-internal.h
M src/kudu/common/partition.cc
M src/kudu/master/master.proto
11 files changed, 694 insertions(+), 68 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/57/17657/7
--
To view, visit http://gerrit.cloudera.org:8080/17657
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I98fd9754db850dcdd00a00738f470673f42ac5b4
Gerrit-Change-Number: 17657
Gerrit-PatchSet: 7
Gerrit-Owner: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Alexey Serbin <as...@cloudera.com>
Gerrit-Reviewer: Andrew Wong <aw...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Mahesh Reddy <mr...@cloudera.com>