96 Commits
Author SHA1 Message Date
zooqueen 0f1e1b5143 merge: ClickHouse 26.6.1.1 into datastore — preserve debrand + ZAP + gRPC/gcloud removal
Merge upstream/changelog-26.6 (9593 commits) into our debranded fork.
- 190 conflicts resolved: 24 delete-side kept-removed (grpc/arrowflight/gcloud), submodules+version→26.6,
  contrib/CMakeLists keeps zap + new libpng, drops capnproto (zap provides kj), Server.cpp/CMakeLists
  re-apply the ZAP wiring + gRPC/arrowflight/gcloud removal.
- Full-tree debrand re-swept over the new 26.6 code (uniform Datastore naming; Azure fork Clickhouse*
  symbols preserved). 0 clickhouse in product src/programs/CMakeLists.
- Version now 26.6.1.1. gRPC/google-cloud/chdig stay removed; ZAP remains the transport.
2026-06-23 12:23:48 -07:00
zooqueen f9f34ad947 datastore: rename program source/completion files clickhouse-* -> datastore-*
The lowercase sweep renamed source-file references inside programs/*/CMakeLists.txt
(clickhouse-su.cpp -> datastore-su.cpp etc.) but not the physical files -> 'Cannot find source
file datastore-su.cpp'. Renamed all 19 program entry-point sources, the client config xml, and
bash-completion scripts to match. Completes the program-file rebrand.
2026-06-21 23:57:41 -07:00
zooqueen 0357c7e3ff datastore rebrand: lowercase clickhouse -> datastore in commands/prose/help
Completes the user-facing branding: lowercase `clickhouse` command/symlink names
(clickhouse-server/-client/-local/...), `clickhouse <subcommand>` usage strings, and bare-word
prose in messages/comments -> datastore (~238 occurrences across 227 files).

Intentionally KEPT (not branding):
- SQL dict-source keyword "clickhouse" (SOURCE(CLICKHOUSE(...)) compat) - 4 sites
- external URLs (clickhouse.com / github.com/ClickHouse)
- filesystem / ZooKeeper path conventions (/var/lib/clickhouse fallback default, /clickhouse/tables/
  ReplicatedMergeTree ZK path) - deployment convention, overridden by our datastore-* config

String/comment-literal changes only; no identifiers touched (verified no bare lowercase clickhouse
C++ symbol exists). Build was already green; verifying this is still green.
2026-06-21 23:46:30 -07:00
zooqueen 06f45b6529 datastore rebrand: compound symbols + CMake targets/macros (clickhouse -> datastore)
The deep internal rebrand (user: "rename all compound symbols", "datastore_ good", "DB:: fine"):
- CamelCase symbols ClickHouse* -> Datastore* (358 distinct): mainEntryDatastoreServer,
  DatastoreDictionarySource, DatastoreRevision, DatastoreVersion, etc. URL/repo lines skipped.
- snake targets + macros clickhouse_* -> datastore_* (850 occ): datastore_common_io,
  datastore_add_executable, datastore_program_install, datastore_functions, etc. — uniform
  across src + cmake + all CMakeLists, and the contrib wrappers that link/use them
  (croaring, nuraft, corrosion, chdig, delta-kernel-rs, mongo-cxx).
- CLICKHOUSE_* macros -> DATASTORE_* (DATASTORE_OFFICIAL_BUILD, ENABLE_DATASTORE_*, etc.).
- project(ClickHouse) -> project(Datastore) so ${Datastore_SOURCE_DIR}/${Datastore_BINARY_DIR}
  (45 refs) resolve.

Replace (not drop) -> collision-free. DB:: namespace kept (per direction). lowercase SQL
`clickhouse` dictionary-source keyword + clickhouse.com / github.com/ClickHouse URLs kept.
NEEDS BUILD VERIFICATION on spark/CI — uniform + inspected-consistent but uncompiled here.
2026-06-21 20:38:05 -07:00
zooqueen 332335ddb4 datastore rebrand: standalone "ClickHouse" word -> "Datastore" (prose, strings, comments)
The correct, safe broad rebrand: renames "ClickHouse" only as a whole word (boundary on
BOTH sides), so it rewrites display strings/messages/comments but leaves every compound
C++ symbol intact — `ClickHouseDictionarySource`, `getInfoIfClickHouseDictionarySource`,
`mainEntryClickHouseServer`, `ClickHouseRevision`, `ClickHouse_SOURCE_DIR` are untouched
(an earlier one-sided heuristic mangled suffix symbols like `manageClickHouse`; reverted).
1677 occurrences across 482 files. Compile-safe (string/comment content; symbols preserved).

Still NOT renamed (would be a build-coupled symbol rename, needs build-host iteration): the
199 compound identifiers containing ClickHouse, the `DB::` namespace, the `clickhouse_*`
CMake targets/macros, the lowercase `clickhouse` SQL dictionary-source keyword. Needs build
verification.
2026-06-21 20:10:25 -07:00
Alexey MilovidovandGitHub e3068f34a9 Merge 3fa1ed2d9d into fix-clickhouse-format-backslash-insert-values 2026-06-03 05:43:52 +00:00
avogarandClaude Opus 4.6 a3a758b045 Fix clickhouse-format --backslash silently dropping INSERT VALUES data
The backslash branch in Format.cpp formatted the INSERT AST (which has
its format field cleared) but omitted the `insert_query_payload` data.
The non-backslash branch correctly appended the payload, but this was
not replicated in the backslash branch.

Also fix multiquery semicolon handling in the backslash branch for
INSERT VALUES queries — when the payload is present, the semicolon is
already included in the data, so we must not add another one.

Closes https://github.com/ClickHouse/ClickHouse/issues/103533

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-05-21 13:42:28 +00:00
Alexey Milovidov 7a2f9f408a Merge remote-tracking branch 'origin/master' into fix-compiler-warnings 2026-05-19 15:05:56 +00:00
d7d1302857 Make client rainbow parentheses optional (#103851)
* Make client rainbow parentheses optional

* Make client rainbow parentheses optional

* Make client rainbow parentheses optional

* Make client rainbow parentheses optional

* Fix style and clang-tidy CI failures

- In `programs/format/Format.cpp`, replace `options.count(...)` with
  `options.contains(...)` to satisfy the `readability-container-contains`
  clang-tidy check that fires in the `arm_tidy` build.

- In `src/Client/ClientBaseHelpers.cpp`, drop redundant braces around
  single-statement `if (!rainbow_parentheses) ...` blocks. One of them
  had the opening brace on the same line, which the C++ style check
  rejects (Allman braces are required).

CI report: https://github.com/ClickHouse/ClickHouse/pull/103851

---------

Co-authored-by: Alexey Milovidov <[email protected]>
2026-05-18 22:13:00 +02:00
Alexey Milovidov 7d54e33c7c Merge remote-tracking branch 'origin/master' into fix-compiler-warnings
# Conflicts:
#	programs/main.cpp
2026-05-06 03:18:15 +00:00
Alexey MilovidovandGitHub 8b819651a9 Merge branch 'master' into revert-98038-revert-96025-clickhouse-help 2026-03-28 23:50:35 +01:00
Alexey MilovidovandClaude Opus 4.6 8b47d200d5 Enable -Wmissing-prototypes compiler warning
Add `static` to file-local functions and forward declarations
for cross-TU functions to satisfy `-Wmissing-prototypes`.

This ensures all functions have visible prototypes before their
definitions, improving code quality and catching accidental
linkage issues.

Reference: https://github.com/ClickHouse/ClickHouse/issues/76944

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
2026-03-27 20:11:07 +00:00
Raúl MarínandClaude Opus 4.6 0cb2bc2dbc Preserve dictionary definitions in clickhouse format --obfuscate
Dictionary layout types (`complex_key_hashed`, `range_hashed`,
`ssd_cache`, etc.), source types, and source/layout parameter names
(`PORT`, `PASSWORD`, `DB`, `SIZE_IN_CELLS`, `BLOCK_SIZE`, `SHARDS`,
etc.) were being obfuscated, producing invalid SQL output.

Add `getAllRegisteredNames` to `DictionaryFactory` and
`DictionarySourceFactory`, register their names as known identifiers,
add dictionary parameter keywords to the obfuscator keyword list,
and remove the now-redundant hardcoded dictionary layout/source
keywords that are covered by the factory-based approach.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-11 14:26:02 +01:00
Raúl MarínandClaude Opus 4.6 751c3948de Preserve database engine names in clickhouse format --obfuscate
Add `DatabaseFactory::getAllRegisteredNames` to the known identifiers
set so database engine names like `Atomic`, `Memory`,
`MaterializedPostgreSQL`, etc. are not obfuscated.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-11 14:26:02 +01:00
Raúl MarínandClaude Opus 4.6 5de856ce49 Fix clickhouse format --obfuscate not preserving index types and codec names
Skip index type names (`minmax`, `set`, `bloom_filter`, `ngrambf_v1`,
`tokenbf_v1`, etc.) and compression codec names (`LZ4`, `ZSTD`, `Delta`,
etc.) were being obfuscated, producing invalid SQL output.

Add `getAllRegisteredNames` to `MergeTreeIndexFactory` and
`CompressionCodecFactory`, and register their names as known identifiers
in the obfuscator.

Closes #99248

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-03-11 14:26:02 +01:00
Alexey MilovidovandGitHub 85164c93d4 Revert "Revert "Improve help output for ClickHouse applications"" 2026-02-27 00:49:00 +01:00
Alexey MilovidovandGitHub e8654c51eb Revert "Improve help output for ClickHouse applications" 2026-02-26 07:51:17 +01:00
Alexey MilovidovandClaude Opus 4.6 3be8cbbf33 Fix query obfuscator to produce parseable SQL in more cases
The query obfuscator (`clickhouse format --obfuscate`) was producing
unparseable SQL for many queries. This fixes several categories of issues:

1. Add missing keywords for SYSTEM commands (`FLUSH`, `LOGS`, `DNS`,
   `CACHE`, `RELOAD`, etc.), dictionary definitions (`FLAT`, `HASHED`,
   `CLICKHOUSE`, etc.), special SQL constructs (`EXTRACT`, `TRIM`,
   `DECIMAL`), multi-word data types (`NATIONAL`, `NCHAR`, `BINARY`,
   `LARGE`, `OBJECT`), and substitution syntax (`Identifier`).

2. Fix hex/binary number prefix corruption: `0x1234` was becoming
   `0p1234` because the `x` was treated as alphabetical and obfuscated.
   Now preserves `0x`/`0b` prefixes and handles hex float literals
   like `0xD.5p-6`.

3. Fix hex/binary string literal content corruption: `x'ABCD'` was
   producing invalid hex like `x'WXYZ'`. Now replaces hex digits with
   random hex digits and binary digits with random binary digits.

4. Make known identifier lookup case-insensitive: `DECIMAL` and
   `decimal` are now recognized as known types like `Decimal`.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-21 19:33:01 +00:00
Alexey MilovidovandClaude Opus 4.5 62ccfbd3aa Improve help output for ClickHouse applications
This commit improves the help output for all ClickHouse applications:

- Add `clickhouse help` command that lists all available subcommands
- Return exit code 0 for all help messages (previously some returned 1)
- Output help messages to stdout instead of stderr
- Use "clickhouse <cmd>" format instead of argv[0] in help messages
- Add dynamic `app_name` detection for `clickhouse client` and `clickhouse local`
  to show correct invocation name based on how the binary was called
- Add `--no-sudo` option for `clickhouse start` and `clickhouse restart`
  for environments without sudo (e.g., Docker containers)
- Add detailed help headers and footers for client and local with usage examples

Closes #58244

Co-Authored-By: Claude Opus 4.5 <[email protected]>
2026-02-05 07:12:44 +01:00
Konstantin Bogdanov 48d2f3b145 Fix readability-container-contains 2025-11-04 23:40:04 +01:00
Pablo MarcosandGitHub 4a7a992541 Merge pull request #88018 from ZelvaMan/format-semicolons-inline
Add semicolons_inline option to clickhouse format
2025-10-06 13:13:41 +00:00
Azat Khuzhin aaacc4706d format: remove superfluous dbms link dependency 2025-10-05 22:46:33 +02:00
Jan Rada b220ec9f24 Add docs and change help message 2025-10-03 19:53:08 +02:00
Jan Rada 809f2fe0e6 Fix type 2025-10-03 15:01:55 +02:00
Jan Rada 63343b4bdb Add semicolons_inline option to clickhouse format 2025-10-02 14:10:16 +02:00
Pablo Marcos 63c403b946 Merge branch 'master' into fix-clickhouse-format-show-sercrets-cmdline-arg 2025-08-19 15:01:15 +00:00
Rishabh Bhardwaj f2ab452cab Align command-line options for clickhouse-format with clickhouse-client 2025-07-31 17:56:53 +02:00
Alexey MilovidovandGitHub dffd84400c Merge branch 'master' into fix-clickhouse-format-show-sercrets-cmdline-arg 2025-07-15 15:51:28 +02:00
Alexey Milovidov 3b43b65f70 Format independently 2025-06-30 04:52:52 +02:00
Alexey Milovidov 37155f4791 Decouple syntax highlighting from AST 2025-06-30 04:04:39 +02:00
Nikolai Ryzhov e6b28fad40 [ClickHouse Format] Replacing uppdercase to lowercase 2025-06-09 01:58:04 +03:00
Nikolai Ryzhov 94bfb2e5b3 [ClickHouse Format] Fixing show_secrets 2025-06-09 01:56:43 +03:00
Nikolai Ryzhov 349ad214e6 [ClickHouse Format][Secrets][WIP] Hide secrets support adding 2025-06-09 00:25:12 +03:00
Azat Khuzhin 98ee9e4506 Move skipSpacesAndComments() into client helpers 2025-05-21 17:34:40 +02:00
János Benjamin Antal c2038a812d Remove format_alter_commands_with_parentheses server setting
The setting was introduced and set false by default in 24.2. It was enabled by default in 25.2. As there are no LTS versions that doesn't support the new format, we can remove the setting.
2025-05-08 13:26:11 +00:00
Robert Schulze f5217aeebe Remove legacy MongoDB integration 2025-03-19 09:19:06 +00:00
Nikita Mikhailov 450c8ba2a8 Remove formatAST completely 2025-03-14 20:04:45 +01:00
Raúl Marín 945d41e7e6 Hide boost::geometry 2025-02-24 18:38:45 +01:00
Raúl Marín 8753073760 Add format_alter_operations_with_parentheses to clickhouse-format 2025-01-30 21:11:32 +01:00
Robert Schulze 9b2fd5850d Revert "get rid of poco mongodb integration implementation"
This reverts commit fcaa058c92.
2024-12-16 13:04:53 +00:00
Vitaly Baranov d0a11071d4 Remove ostr from structure IAST::FormatSettings. 2024-12-03 01:01:24 +01:00
Kirill Nikiforov fcaa058c92 get rid of poco mongodb integration implementation 2024-11-16 00:28:54 +04:00
vdimir 4c9c9015f8 Revert "Revert "Merge pull request #63279 from allmazz/mongodb_refactoring""
This reverts commit 2ae9c9ac16.
2024-09-23 07:06:58 +00:00
Alexey Milovidov 2ae9c9ac16 Revert "Merge pull request #63279 from allmazz/mongodb_refactoring"
This reverts commit 14cb02a18c, reversing
changes made to a940a9ebbc.
2024-09-22 22:28:24 +02:00
Kirill Nikiforov 8173c4fcff Merge remote-tracking branch 'origin' into mongodb_refactoring 2024-09-19 17:00:00 +04:00
Raúl Marín f3df7bd171 Hide Settings implementation 2024-09-18 15:48:02 +02:00
Kirill Nikiforov 40462bc716 Merge remote-tracking branch 'origin' into mongodb_refactoring 2024-08-23 22:10:06 +04:00
Alexey Milovidov 60dd7e962a Fix tests 2024-08-18 05:56:27 +02:00
Alexey Milovidov 4b68ba23c0 Pretty print tuples in CREATE TABLE statements 2024-08-17 03:44:18 +02:00
avogar 11d56a08cd Fix clickhouse-format 2024-07-12 20:16:47 +00:00