Repository navigation
Docs: rewrite the JOIN clause reference as syntax and semantics, and add a JOIN Settings page - #129276
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
Workflow [PR], commit [8ae50dd] Summary: ✅
AI ReviewSummaryThis documentation change reorganizes the Findings
Missing context / blind spots
Final Verdict |
|
Note: the preview for https://private-7c7dfe99-docs-join-reference-rewrite.mintlify.site/reference/statements/select/join is old, since it needs to be regenerated from C++ code. |
The common-subtype conversion applies only to integer keys and tuples of integer keys. The merged USING column of a SEMI or ANTI JOIN keeps the type of the preserved table when semi_join_include_columns_from_both_sides or anti_join_include_columns_from_both_sides is disabled. Addresses the review of #129276 Co-authored-by: Cursor <[email protected]>
The settings tables made the documentation string of the `JOIN` clause 65698 bytes long, above the 65536 bytes that C++ compilers are required to support, and the build failed with `-Woverlength-strings`. The tables now live on the new page `JOIN Settings` in the JOINs section, and the `#settings` section of the reference links to it. https: //github.com/ClickHouse/ClickHouse/actions/runs/41847167721/job/126634685869?pr=129276 https: //github.com//pull/129276 Co-authored-by: Cursor <[email protected]>
JOIN clause reference as syntax and semantics, with a complete table of JOIN settingsJOIN clause reference as syntax and semantics, and add a JOIN Settings page
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units7 translation units recompiled, 7 s compile time in total, 7 of them have a recent master baseline. |
JOIN clause reference as syntax and semantics, and add a JOIN Settings pageJOIN clause reference as syntax and semantics, and add a JOIN Settings page
JOIN clause reference as syntax and semantics, and add a JOIN Settings pageJOIN clause reference as syntax and semantics, and add a JOIN Settings page
Add a "Comparison of JOIN keys" section to the JOIN algorithms page and point the `ie_join` and block nested loop sections at it. A JOIN key is compared by the algorithm, not by `equals`. The hash family compares `Float` keys by their bits, so a `NaN` matches only a `NaN` with the same bit pattern; the sort-merge family compares with `IColumn::compareAt`, where any two `NaN` are equal; both match a `Tuple` with a `NULL` element and a `NULL` `Variant`, for which `equals` returns `NULL`. `ie_join` evaluates a remaining equality as a residual filter or post-join filter with `equals`, and the block nested loop fallback evaluates the whole `ON` condition, so neither matches those pairs. Measured per algorithm on master (26.11.1.1) with one row on each side. `-0.0` vs `0.0` and a `String` with trailing zero bytes vs `FixedString` are left out on purpose: ClickHouse#115970 and ClickHouse#118561 remove those differences. The JOIN statement page is not edited because ClickHouse#129276 rewrites it. Related: ClickHouse#129219 Related: ClickHouse#112409 Co-Authored-By: Claude Opus 5.5 <[email protected]>
mikelewisCH
left a comment
There was a problem hiding this comment.
Nice work. The updated organization of info is a big improvement, here.
Approved, with non-blocking feedback for your consideration:
- On the diff: wording suggestions on
ie_join, suggestions re. headingsUsage recommendationsandSyntax, and suggestions on links in the intro vs.Related content. - The PR description points to "the fact checks" as the basis for removing
### Syntax Limitationsbut it's not clear what those are. Consider referencing in a way that internal colleagues can find it, or just saying "internal testing" without referring.
Co-authored-by: Mike Lewis <[email protected]>
Co-authored-by: Mike Lewis <[email protected]>
…esInSelectQuery.cpp Co-authored-by: Mike Lewis <[email protected]>
Co-authored-by: Mike Lewis <[email protected]>
|
Thanks for the review @mikelewisCH , applied all the changes. |
The JOIN documentation was reorganized into a conceptual overview, an execution page, an algorithms page, a memory and spilling page, and a best-practices page. The
JOINclause reference still carried its own copies of execution, memory, and performance advice, part of which was outdated or wrong. This change reduces the reference to syntax and semantics, links to the concept pages instead of repeating them, corrects the claims that no longer hold, and adds a complete table of the session settings that affect JOINs.The body of
docs/reference/statements/select/join.mdxis generated betweenAUTOGENERATED_STARTandAUTOGENERATED_ENDfromdocumentation["JOIN"]insrc/Parsers/ParserTablesInSelectQuery.cpp.Summary of changes
src/Parsers/ParserTablesInSelectQuery.cpp: new body of theJOINreference, in this order: introduction and syntax with a scope paragraph, supported types of JOIN with thecross_to_inner_join_rewritevalues,ONsection conditions, inequality conditions, arbitraryONcondition,NULLandNaNvalues in JOIN keys, implicit type conversion,ASOF JOINusage,PASTE JOINusage,LATERAL JOIN, distributed JOIN, usage recommendations (processing of empty orNULLcells, syntax), examples, settings, related content.docs/concepts/features/operations/select/join-settings.mdx(new): "JOIN Settings", a hand-written page with five tables of the session settings that affect JOINs.docs/concepts/navigation.jsonlists it in the JOINs section after "JOIN memory management and spilling". The tables are on a separate page because they made theJOINdocumentation string 65698 bytes long, above the 65536 bytes that C++ compilers are required to supportdocs/concepts/features/operations/select/join-memory-management.mdx: the "Hard limits" section now describesenable_adaptive_memory_spill_schedulerandlegacy_join_size_limits_trigger_spilling, which were previously described only on the reference page.Moved and removed content
IN, dictionaries)IN, dictionaries and theJointable engine are covered by Minimize and optimize JOINs. The reference links to these pages in the introduction and in "Related content".enable_adaptive_memory_spill_schedulerandlegacy_join_size_limits_trigger_spillingwere added to its "Hard limits" section.USINGrules)join_use_nulls, types that cannot beNullable(for exampleArray) keep their type, and the mergedUSINGcolumn of aFULLJOIN becomesNullable. TheNULLkey rule links to "NULL and NaN values in JOIN keys" instead of repeating it.UInt64/Int64example of a failing conversion is outdated since 26.9 and was replaced by the rules for the common supertype, the common-subtype conversion and theNO_COMMON_TYPEerror. The existing example was kept withORDER BY ALL.semi_join_include_columns_from_both_sidesnoteLATERAL JOINPASTE JOIN usage. Content kept. The setting name isenable_lateral_join, and the version of arrival is added.partial_mergenoteORexecution paragraphhash.#settings.INNER JOIN LATERALandLEFT JOIN LATERAL, which were missing. Verified on 26.11.1.1307:JOIN LATERAL,INNER JOIN LATERAL, andLEFT [OUTER] JOIN LATERALwork.RIGHT,FULL,CROSS, comma, andANYforms are rejected. Withoutenable_lateral_join = 1, the query fails withSUPPORT_IS_DISABLED.cross_to_inner_join_rewriteparagraphCROSS JOINasINNER JOIN" (#cross-join-rewrite) under "Supported types of JOIN".test.hitsandtest.visitsVALUES, with output.Settings list
The tables contain 110 settings. The list was built by searching
system.settingson 26.11.1.1307 forjoin,lateral,global_inanddistributed_productin the name or description, reading each declaration insrc/Core/Settings.cpp, and adding the settings that the five concept and best-practices pages mention.Changelog category (leave one):
Changelog entry (a [user-readable short description])
Not required.
Workflow [PR]
Sync PR [sync-upstream/pr/129276]
Version info
26.11.1.1524-master(included in26.11and later)