Skip to content

Resubmit #68682#71577

Merged
vdimir merged 19 commits intomasterfrom
vdimir/join_select_inner_table
Nov 25, 2024
Merged

Resubmit #68682#71577
vdimir merged 19 commits intomasterfrom
vdimir/join_select_inner_table

Conversation

@vdimir
Copy link
Copy Markdown
Member

@vdimir vdimir commented Nov 7, 2024

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

  • Added an option to select the side of the join that will act as the inner (build) table in the query plan. This is controlled by query_plan_join_swap_table, which can be set to auto. In this mode, ClickHouse will try to choose the table with the smallest number of rows.

Close #71454, close #71507

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@robot-ch-test-poll3 robot-ch-test-poll3 added pr-not-for-changelog This PR should not be mentioned in the changelog submodule changed At least one submodule changed in this PR. labels Nov 7, 2024
@robot-ch-test-poll2
Copy link
Copy Markdown
Contributor

robot-ch-test-poll2 commented Nov 7, 2024

This is an automated comment for commit c10d68c with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests❌ failure
Successful checks
Check nameDescriptionStatus
AST fuzzerRuns randomly generated queries to catch program errors. The build type is optionally given in parenthesis. If it fails, ask a maintainer for help✅ success
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
ClickBenchRuns [ClickBench](https://github.com/ClickHouse/ClickBench/) with instant-attach table✅ success
Compatibility checkChecks that clickhouse binary runs on distributions with old libc versions. If it fails, ask a maintainer for help✅ success
Docker keeper imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docker server imageThe check to build and optionally push the mentioned image to docker hub✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Install packagesChecks that the built packages are installable in a clear environment✅ success
Performance ComparisonMeasure changes in query performance. The performance test report is described in detail here. In square brackets are the optional part/total tests✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stress testRuns stateless functional tests concurrently from several clients to detect concurrency-related errors✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success
Upgrade checkRuns stress tests on server version from last release and then tries to upgrade it to the version from the PR. It checks if the new server can successfully startup without any errors, crashes or sanitizer asserts✅ success

…/join_select_inner_table"

This reverts commit dd5061a, reversing
changes made to 0011bc5.
@robot-clickhouse-ci-1 robot-clickhouse-ci-1 removed the submodule changed At least one submodule changed in this PR. label Nov 7, 2024
@vdimir vdimir self-assigned this Nov 7, 2024
@robot-ch-test-poll robot-ch-test-poll added pr-feature Pull request with new product feature and removed pr-not-for-changelog This PR should not be mentioned in the changelog labels Nov 12, 2024
@vdimir
Copy link
Copy Markdown
Member Author

vdimir commented Nov 12, 2024

@vdimir vdimir force-pushed the vdimir/join_select_inner_table branch from 77bf340 to ffd1183 Compare November 13, 2024 10:27
For single JOIN in case of identifier ambiguity prefer left table
)", IMPORTANT) \
\
DECLARE(BoolAuto, query_plan_join_swap_table, {}, R"(
Copy link
Copy Markdown
Member Author

@vdimir vdimir Nov 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devcrafter , is this name and description better?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vdimir Honestly, the setting looks weird. IMHO, the setting should just enable or disable the automatic mode to choose the table. But to use this setting for swapping tables in JOIN clause - looks weird - user should just rewrite the query itself.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's also useful for testing, as I want to ensure that any pipeline we build is valid and can be executed.

Another reason is that when the automatically inferred side is incorrect, and the user need an ad-hoc solution to specify the correct one (however, as you mentioned, rewriting is also an option and should work for most use cases).

But in ideal case the setting is used only in tests and rarely by user set to false to have legacy behavior.

@vdimir vdimir force-pushed the vdimir/join_select_inner_table branch from 0367fc6 to d92383f Compare November 15, 2024 09:45
@vdimir vdimir force-pushed the vdimir/join_select_inner_table branch from 8afb0d0 to b03f488 Compare November 18, 2024 10:08
@vdimir vdimir force-pushed the vdimir/join_select_inner_table branch from 2d00ec4 to e29fc6e Compare November 18, 2024 13:16
@vdimir
Copy link
Copy Markdown
Member Author

vdimir commented Nov 18, 2024

Fast test — fail: 207, passed: 5652, skipped: 1380 Details

Conflict resolution did not go well

@vdimir
Copy link
Copy Markdown
Member Author

vdimir commented Nov 22, 2024

Integration tests (tsan) [1/6] — fail: 1, passed: 526 Details

test_backup_restore_on_cluster/test_cancel_backup.py::test_error_leaves_no_trash ?

Stress test/Upgrade check

#72248

@vdimir
Copy link
Copy Markdown
Member Author

vdimir commented Nov 25, 2024

Integration tests (tsan) [1/6] — fail: 1, passed: 526 Details

#72391

@vdimir vdimir added this pull request to the merge queue Nov 25, 2024
Merged via the queue into master with commit 95b21f4 Nov 25, 2024
@vdimir vdimir deleted the vdimir/join_select_inner_table branch November 25, 2024 13:59
@robot-ch-test-poll robot-ch-test-poll added the pr-synced-to-cloud The PR is synced to the cloud repo label Nov 25, 2024
@ppakawatk
Copy link
Copy Markdown

Hi, I found a potential bug on this feature, and reported it two weeks ago. Just wanted to follow up and see if anyone has taken a look at this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-feature Pull request with new product feature pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Paste join with Group by logical error Logical error: 'Unexpected number of columns in result sample block: 4 instead of 1 (1 + 0 + 0)'.

7 participants