Michael Smith has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/24852 )
Change subject: IMPALA-15358: Cap Kudu DML writers to partition count ...................................................................... IMPALA-15358: Cap Kudu DML writers to partition count For INSERT/UPSERT into a partitioned Kudu table, the planner inserts a KUDU-partitioned exchange ahead of the KuduTableSink. At runtime, KrpcDataStreamSender routes each row to channel (partition_index % num_channels), where partition_index is the actual Kudu tablet index (bounded by the table's tablet count). The writer fragment's instance count, however, was sized like any other fragment (mt_dop / cost-based scaling) with no awareness of the target table's partitioning. Whenever the scheduler assigned more writer instances than the table has tablets, instances index >= tablet count never received rows, causing work skew. Cap the writer fragment's instance count at the Kudu table's partition count via an RPC, reusing the existing MAX_FS_WRITERS mechanism (DmlStatementBase.maxTableSinks_). KuduTableSink now honors the same cap via PlanFragment.getNumNodes()/getNumInstances(). Updates Kudu support for MAX_FS_WRITERS and CPC to match HDFS. Also caps CTAS based on an estimate of the number of tablets. Adds planner and end-to-end tests. Planner tests with CPC use approximate segment-costs as they're susceptible to small differences in statistics that can vary across environments. Change-Id: Ia3644fb245ceac72e91ed70c8c0392f65df75fde Assisted-by: Claude Sonnet 4.5, 5.5 (GitHub Copilot) Reviewed-on: http://gerrit.cloudera.org:8080/24852 Tested-by: Impala Public Jenkins <[email protected]> Reviewed-by: Michael Smith <[email protected]> --- M common/thrift/ImpalaService.thrift M fe/src/main/java/org/apache/impala/analysis/KuduPartitionParam.java M fe/src/main/java/org/apache/impala/analysis/RangePartition.java M fe/src/main/java/org/apache/impala/catalog/FeKuduTable.java M fe/src/main/java/org/apache/impala/planner/DistributedPlanner.java M fe/src/main/java/org/apache/impala/planner/KuduTableSink.java M fe/src/main/java/org/apache/impala/planner/PlanFragment.java M fe/src/main/java/org/apache/impala/planner/TableSink.java M fe/src/test/java/org/apache/impala/planner/PlannerTest.java M testdata/datasets/functional/functional_schema_template.sql M testdata/datasets/functional/schema_constraints.csv A testdata/workloads/functional-planner/queries/PlannerTest/kudu-insert-writer-limit.test A testdata/workloads/functional-query/queries/QueryTest/kudu-dml-writer-limit.test M tests/query_test/test_kudu.py 14 files changed, 1,905 insertions(+), 26 deletions(-) Approvals: Impala Public Jenkins: Verified Michael Smith: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/24852 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ia3644fb245ceac72e91ed70c8c0392f65df75fde Gerrit-Change-Number: 24852 Gerrit-PatchSet: 18 Gerrit-Owner: Michael Smith <[email protected]> Gerrit-Reviewer: Aleksandr Efimov <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: David Rorke <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Michael Smith <[email protected]> Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>
