Repository navigation
Fix clickhouse-local printing TSV instead of PrettyCompact in interactive mode - #115360
Conversation
…teractive mode `applyCmdOptions` seeds the `default_format` setting on the global context as the fallback format of the sessions of the embedded protocol listeners (`SYSTEM START LISTEN`), where it must match a real `clickhouse-server` (`TabSeparated`). The client context is copied from the global context and inherited the seed, and the per-query output-format resolution introduced in #105249 treats a non-empty `default_format` setting as the fallback format, so the seed overrode the interactive display default (`PrettyCompact`) with `TSV`. Clear the seeded value on the client context: this client renders results from its own `ClientBase::default_output_format`. An explicit `--default_format` on the command line stays honored, as do `SET default_format = ...` and an in-query `SETTINGS` clause; the sessions of the embedded listeners still get the seed through the global context. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Workflow [PR], commit [065c3ea] Summary: ✅
AI ReviewSummaryThe PR fixes the Final Verdict✅ Approved. LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 11/11 (100.00%) · Uncovered code |
…ty value
Assigning `String{}` marked the setting as changed on the client session, so
`system.settings WHERE changed` listed `default_format` with an empty value
and `02800_clickhouse_local_default_settings` failed. `resetSettingsToDefaultValue`
copies the pristine default field, clearing the `changed` flag along with the
value, so the session looks exactly like one where nothing was seeded.
Co-Authored-By: Claude Fable 5 <[email protected]>
|
🕵 The Validated locally against a fresh build: Note: this regression is what makes the two interactive client tests of #114043 ( |
The interactive tests of this PR (04909, 04911) assert the PrettyCompact rendering of query results in interactive `clickhouse-local`, which is broken on master (#115360): the `default_format` seed for the embedded protocol listeners overrides the terminal display default. This merge will fall out of the diff once #115360 lands in master.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
Only the stripped binary is compared: the official master build keeps debug symbols while PR builds strip them, so the other binaries differ by construction. Compile time of recompiled translation units7 translation units recompiled, 14 s compile time in total, 7 of them have a recent master baseline. |
…nly the synthetic listener seed `makeFormatOptionsPrivateToTheClient` reset `default_format` on `client_context` whenever the command line did not set it, which also erased a `default_format` legitimately configured in the default profile (`setDefaultProfiles` applies it after `applyCmdOptions` seeds the listener fallback). Remember the exact seeded value in `listener_default_format_seed` and reset only when the inherited value still equals that seed, so a profile override keeps its role in the per-query format resolution. Adds the test `05023_local_profile_default_format` covering a profile-provided `default_format` in batch output, `system.settings` visibility, the command-line override, and the reset of the untouched seed. Co-Authored-By: Claude Fable 5 <[email protected]>
|
🕵 @groeneai, investigate the failure: https://s3.amazonaws.com/clickhouse-test-reports/json.html?PR=115360&sha=3578a91592e58c6999d621d597e0187a8ced9812&name_0=PR&name_1=Stateless%20tests%20%28arm_binary%2C%20parallel%29 and provide a fix in a separate PR. If the fix is already in progress, link it here. |
|
No fix PR exists (searched open PRs for the test name: only this PR and #110997, both carriers). Root cause below, and I will open a separate PR. This is a test defect, not an engine bug. All six failures on unrelated PRs are The oracle is a wall clock by construction: Planned fix: assert the early stop directly instead of timing it, with a Two costs worth flagging first: it adds failpoints to the exchange sinks @ davenger shipped in #114806 six days ago, and a test that waits on global failpoints has to be Ruled out already: raising the cap (the assertion rests on the ~7s correct versus 50s+ incorrect separation), |
…nance, not by value `makeFormatOptionsPrivateToTheClient` compared the inherited value with the seeded one, so a `default_format` provided by the default profile that happened to be the same format as the seed was reset as if it were synthetic. Seed the listener fallback in a separate `seedListenerDefaultFormat`, called after `setDefaultProfiles`, and only when neither the command line nor the default profile has set `default_format`. The provenance of the value is then known outright: only a seed the program itself introduced is taken back out of `client_context`, whatever its value. Extended `05023_local_profile_default_format` with a profile whose `default_format` equals the seed (`TSV`).
…ve-default-format
|
🕵 Merged master and addressed the AI Review "Changes requested" verdict.
The only red on the previous head was |
|
Fix: #117764. The design changed from what I described above. Instead of The primary control is One correction to my message above: local distributed-plan tasks do write |
Related: #105249
Interactive
clickhouse-localon master renders query results asTSVinstead of the terminal defaultPrettyCompact.applyCmdOptionsseeds thedefault_formatsetting onglobal_contextas the fallback format of the sessions of the embedded protocol listeners (SYSTEM START LISTEN), where it must match a realclickhouse-server(TabSeparated).client_contextis copied fromglobal_contextand inherits the seed, and the per-query output-format resolution introduced in #105249 treats a non-emptydefault_formatsetting as the fallback format, so the seed overrode the interactive display default. (#105249 guarded--verticalagainst exactly this failure mode, but the plain interactive default slipped through: it is the one case whereis_default_formatstays true.)The fix clears the seeded value on
client_context, inmakeFormatOptionsPrivateToTheClient, which already handles the mirror image of this problem for theformat/input_format/output_formatsettings. This client renders results from its ownClientBase::default_output_format, so the seed is not needed there. Explicit choices keep working: an explicit--default_formaton the command line is left in place (guarded bycmd_settings->isChanged), and a laterSET default_format = ...or an in-querySETTINGSclause lands onclient_contextafter the clearing. The served sessions still get the fallback throughglobal_context.Verified against the master CI binary (26.8.1.1658, where the regression reproduces): emulating the fix by forcing an empty
default_formaton the client restoresPrettyCompact, whileSET default_format = 'JSONEachRow'andSETTINGS default_format = 'CSV'continue to be honored. The added04927_local_interactive_default_format.expecttest fails on current master and passes with the fix emulated; the listener-side default is already covered by04501_local_http_default_format.expect.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed a regression on master (not present in any release): interactive
clickhouse-localrendered query results asTSVinstead ofPrettyCompact.Workflow [PR]
Sync PR [sync-upstream/pr/115360]