Zoltan Borok-Nagy has uploaded this change for review. ( https://gerrit.cloudera.org/25587
Change subject: PROTOTYPE IMPALA-15631: Partition shared hash join builds in parallel ...................................................................... PROTOTYPE IMPALA-15631: Partition shared hash join builds in parallel A hash join build shared by several probe threads (a broadcast join with mt_dop > 0 or COMPUTE_PROCESSING_COST) hashes every build row and appends it to the stream of its partition on one thread while the probe threads wait. With --parallel_build_partition_threads=K > 1, a shared build hands its input batches to K worker threads once it has partitioned --parallel_build_partition_min_rows rows (default 4M). Each worker runs the codegen'd ProcessBuildBatch() into its own stream of every partition and its own runtime filter copies, which are merged into the builder's at the end. Hash table builds, spilling and repartitioning read all streams of a partition. The streams share the builder's buffer pool client under a lock. If a worker runs out of reservation, the workers stop and one of them spills the largest partition with the serial code. The queued batches own buffers of the exchange that feeds the build, so a new DataSink::FlushInput(), called before the fragment closes its plan tree, waits for the workers. The build stays serial for null-aware anti joins, builds with in-list filters and builds that have spilled, and if the workers' reservation is not available. The flag defaults to 1, the serial build. A prototype of this change with 8 threads was measured against the parallel hash table build alone, under COMPUTE_PROCESSING_COST. On 3 executors with 64 vCPUs each, it cut the TPC-H SF1000 time of the 18 queries other than the noisy q4, q9, q13 and q21 by 13.4% (194.4 -> 168.4 s) and TPC-DS SF10000 q72 from 142.3 to 91.0 s. On 12 executors with 16 vCPUs each, the same TPC-H time fell 5.9% (117.4 -> 110.5 s) and q72 88.0 s (291.9 -> 203.9 s). It was not measured on TPC-DS q23_1 and q23_2, for which the parallel hash table build raised scratch writes from 1,106 to 2,628 GB on 3 executors with 64 vCPUs each. Testing: - New BufferedTupleStream test: concurrent writers sharing a client. - The cluster runs above: row counts match master. - No unit test for PhjBuilder or for spilling with several workers. Change-Id: I23e474657b339b7c6ebcea16c47b70391d495f56 Assisted-by: Claude Opus 5.5 (Claude Code) --- M be/src/codegen/gen_ir_descriptions.py M be/src/exec/data-sink.h M be/src/exec/partitioned-hash-join-builder-ir.cc M be/src/exec/partitioned-hash-join-builder.cc M be/src/exec/partitioned-hash-join-builder.h M be/src/exec/partitioned-hash-join-builder.inline.h M be/src/runtime/buffered-tuple-stream-test.cc M be/src/runtime/buffered-tuple-stream.cc M be/src/runtime/buffered-tuple-stream.h M be/src/runtime/fragment-instance-state.cc 10 files changed, 968 insertions(+), 97 deletions(-) git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/87/25587/1 -- To view, visit https://gerrit.cloudera.org/25587 To unsubscribe, visit https://gerrit.cloudera.org/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: newchange Gerrit-Change-Id: I23e474657b339b7c6ebcea16c47b70391d495f56 Gerrit-Change-Number: 25587 Gerrit-PatchSet: 1 Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>
