wip grace hash

This commit is contained in:
vdimir 2022-10-18 12:20:52 +00:00
parent bf3f66b5b6
commit 424971d9ae
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
3 changed files with 55 additions and 7 deletions

View File

@ -475,7 +475,9 @@ std::unique_ptr<QueryPipelineBuilder> QueryPipelineBuilder::joinPipelinesRightLe
} }
const Block left_header = left->getHeader(); Block left_header = left->getHeader();
Block joined_header = JoiningTransform::transformHeader(left_header, join);
for (size_t i = 0; i < num_streams; ++i) for (size_t i = 0; i < num_streams; ++i)
{ {
auto joining = std::make_shared<JoiningTransform>( auto joining = std::make_shared<JoiningTransform>(
@ -486,7 +488,7 @@ std::unique_ptr<QueryPipelineBuilder> QueryPipelineBuilder::joinPipelinesRightLe
if (delayed_root) if (delayed_root)
{ {
// Process delayed joined blocks when all JoiningTransform are finished. // Process delayed joined blocks when all JoiningTransform are finished.
auto delayed = std::make_shared<DelayedJoinedBlocksWorkerTransform>(left_header); auto delayed = std::make_shared<DelayedJoinedBlocksWorkerTransform>(joined_header);
if (delayed->getInputs().size() != 1 || delayed->getOutputs().size() != 1) if (delayed->getInputs().size() != 1 || delayed->getOutputs().size() != 1)
throw Exception("DelayedJoinedBlocksWorkerTransform should have one input and one output", ErrorCodes::LOGICAL_ERROR); throw Exception("DelayedJoinedBlocksWorkerTransform should have one input and one output", ErrorCodes::LOGICAL_ERROR);
@ -516,7 +518,6 @@ std::unique_ptr<QueryPipelineBuilder> QueryPipelineBuilder::joinPipelinesRightLe
if (delayed_root) if (delayed_root)
{ {
// Process DelayedJoinedBlocksTransform after all JoiningTransforms. // Process DelayedJoinedBlocksTransform after all JoiningTransforms.
auto joined_header = JoiningTransform::transformHeader(left_header, join);
DelayedPortsProcessor::PortNumbers delayed_ports_numbers; DelayedPortsProcessor::PortNumbers delayed_ports_numbers;
delayed_ports_numbers.reserve(joined_output_ports.size() / 2); delayed_ports_numbers.reserve(joined_output_ports.size() / 2);
for (size_t i = 1; i < joined_output_ports.size(); i += 2) for (size_t i = 1; i < joined_output_ports.size(); i += 2)

View File

@ -1,3 +1,52 @@
-- full_sorting_merge --
ALL INNER
500353531835 500353531835 1000342 1000342 1000342
ALL LEFT
50195752660639 500353531835 10369589 10369589 1000342
ALL RIGHT
500353531835 684008812186 1367170 1000342 1367170
ALL INNER
500353531835 500353531835 1000342 1000342 1000342
ALL LEFT
50195752660639 500353531835 10369589 10369589 1000342
ALL RIGHT
500353531835 684008812186 1367170 1000342 1367170
ALL INNER
500353531835 500353531835 1000342 1000342 1000342
ALL LEFT
50195752660639 500353531835 10369589 10369589 1000342
ALL RIGHT
500353531835 684008812186 1367170 1000342 1367170
ALL INNER
500353531835 500353531835 1000342 1000342 1000342
ALL LEFT
50195752660639 500353531835 10369589 10369589 1000342
ALL RIGHT
500353531835 684008812186 1367170 1000342 1367170
ANY INNER
199622811843 199622811843 399458 399458 399458
ANY LEFT
50010619420459 315220291655 10000000 10000000 630753
ANY RIGHT
316611844056 500267124407 1000000 633172 1000000
ANY INNER
199622811843 199622811843 399458 399458 399458
ANY LEFT
50010619420459 315220291655 10000000 10000000 630753
ANY RIGHT
316611844056 500267124407 1000000 633172 1000000
ANY INNER
199622811843 199622811843 399458 399458 399458
ANY LEFT
50010619420459 315220291655 10000000 10000000 630753
ANY RIGHT
316611844056 500267124407 1000000 633172 1000000
ANY INNER
199622811843 199622811843 399458 399458 399458
ANY LEFT
50010619420459 315220291655 10000000 10000000 630753
ANY RIGHT
316611844056 500267124407 1000000 633172 1000000
-- grace_hash -- -- grace_hash --
ALL INNER ALL INNER
500353531835 500353531835 1000342 1000342 1000342 500353531835 500353531835 1000342 1000342 1000342

View File

@ -29,7 +29,7 @@ SELECT 'skipped';
{% endif -%} {% endif -%}
{% endmacro -%} {% endmacro -%}
{% for join_algorithm in ['grace_hash'] -%} {% for join_algorithm in ['full_sorting_merge', 'grace_hash'] -%}
SET max_bytes_in_join = '{% if join_algorithm == 'grace_hash' %}1M{% else %}0{% endif %}'; SET max_bytes_in_join = '{% if join_algorithm == 'grace_hash' %}1M{% else %}0{% endif %}';
@ -37,11 +37,9 @@ SELECT '-- {{ join_algorithm }} --';
SET join_algorithm = '{{ join_algorithm }}'; SET join_algorithm = '{{ join_algorithm }}';
{% for kind in ['ALL', 'ANY'] -%} {% for kind in ['ALL', 'ANY'] -%}
{% for block_size in [0, 32001, 65505, 65536] %} {% for block_size in [10240, 32001, 65505, 65536] %}
{% if block_size -%}
SET max_block_size = {{ block_size }}; SET max_block_size = {{ block_size }};
{%- endif %}
{% if not (kind == 'ANY' and join_algorithm == 'grace_hash') -%} {% if not (kind == 'ANY' and join_algorithm == 'grace_hash') -%}