Repository navigation
Fix hive partition validation when compatibility is 26.6 - #107437
tiandiwonder merged 18 commits into
Conversation
|
Lefteris Gilmaz seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
Workflow [PR], commit [b126b3b] Summary: ❌
AI ReviewSummaryThis PR fixes the Findings
Final Verdict
|
| /// Only promote to WILDCARD when the effective default strategy is WILDCARD (backwards compatibility). | ||
| /// When the default is HIVE (e.g. via `SET compatibility = '26.6'`), leave the strategy as NONE | ||
| /// so that initPartitionStrategy() sets HIVE and its validation correctly rejects {_partition_id} paths. | ||
| if (local_context->getSettingsRef()[Setting::file_like_engine_default_partition_strategy].value |
There was a problem hiding this comment.
Better to merge the if with the above if, and make comment short.
There was a problem hiding this comment.
Resolved in an earlier commit — this is now an if/else-if chain with a one-line comment.
Co-authored-by: Cursor <[email protected]>
…ard'.
With the hive default under compatibility 26.6, implicit {_partition_id} paths
must explicitly request wildcard partitioning in tests that still exercise
the old behaviour.
Co-authored-by: Cursor <[email protected]>
| @@ -0,0 +1,10 @@ | |||
| SET compatibility = '26.6'; | |||
There was a problem hiding this comment.
Let's also add a test with compatibility 26.5?
Under compatibility 26.5 the default partition strategy remains wildcard, so
{_partition_id} paths must still be accepted.
Co-authored-by: Cursor <[email protected]>
| @@ -0,0 +1,18 @@ | |||
| -- Tags: no-random-settings | |||
There was a problem hiding this comment.
this uses ENGINE = S3, which isn't in the Fast test build, so it needs no-fasttest too — Fast test is already red here with UNKNOWN_STORAGE (56) before it ever reaches the intended BAD_ARGUMENTS (36) check.
Fast test builds omit the S3 storage engine, so the test fails with UNKNOWN_STORAGE before reaching the intended BAD_ARGUMENTS check. Co-authored-by: Cursor <[email protected]>
Head branch was pushed to by a user without write access
|
Hello @kssenii, could you let me know if i need to cover more tests or anything? |
|
Hi, there are a lot of failed tests, see #107437 (comment) then press on fail and you will see: |
|
@tiandiwonder @LefterisXefteris kind ping, this is a critical fix for 26.6 |
…hive default.
Legacy S3/Azure integration tests that use {_partition_id} without an explicit
partition_strategy now opt into partition_strategy='wildcard', matching the
stateless test updates and fixing CI failures on PR ClickHouse#107437.
Co-authored-by: Cursor <[email protected]>
…ault. Use positional wildcard partition strategy in Azure tests (ENGINE and table function) and add upstream 04000 prefetch test with explicit wildcard. Co-authored-by: Cursor <[email protected]>
|
|
||
| -- Write 16 tiny files. Each is far below 2 * max_download_buffer_size, i.e. "object_too_small", | ||
| -- so it takes the prefetch path. | ||
| INSERT INTO FUNCTION s3(s3_conn, filename='04000_prefetch_{_partition_id}.tsv', format='TSV', partition_strategy='wildcard') |
There was a problem hiding this comment.
this file already exists on master (added by 76ba4ae after your base), so committing a parallel copy makes an add/add conflict — the PR is now unmergeable and CI can't start on this head. merge master into the branch and keep the partition_strategy='wildcard' edit as a normal modification; the edit itself is right, master's unguarded insert is exactly why this test failed on 5 stateless lanes in the previous run.
There was a problem hiding this comment.
Resolved — merged master into the branch and kept the partition_strategy='wildcard' edit as a modification of master's file (merge commit 054609c).
…on-id-compatibility-106465 # Conflicts: # tests/queries/0_stateless/04000_s3_table_function_small_file_prefetch.sql
…licitly Master's test rewrite (e405e66, 2026-07-12) switched the object-writing in test_s3_glob_scheherazade and test_s3_glob_many_objects_under_selection to bare `{_partition_id}` partitioned inserts, relying on the unconditional promote-to-wildcard this PR narrows to wildcard-default only. Under the 26.6 `hive` default the writes then throw `BAD_ARGUMENTS` ("Partition strategy hive can not be used with a '_partition_id' wildcard in the path") - caught by the private sync CI; the public run predates the rewrite. Same adaptation as test_partition_by already carries: explicit partition_strategy='wildcard'.
…gcs synopses Review follow-up: the azureBlobStorage partitioned-write example uses the positional partition_strategy slot and the gcs examples use the named form, but neither page advertised the parameter in its Syntax block or arguments table. Add the slot to both azureBlobStorage syntax forms and to gcs, plus argument-table rows, mirrored into docs/reference.
| | `account_key` | Storage account key. **Required** when using `storage_account_url` without SAS; must **not** be passed when using `connection_string`. | | ||
| | `format` | The [format](/sql-reference/formats) of the file. | | ||
| | `compression` | Supported values: `none`, `gzip/gz`, `brotli/br`, `xz/LZMA`, `zstd/zst`. By default, it will autodetect compression by file extension (same as setting to `auto`). | | ||
| | `partition_strategy` | Optional. Supported values: `WILDCARD` or `HIVE`. `WILDCARD` requires a `{_partition_id}` in the path, which is replaced with the partition key. `HIVE` does not allow wildcards, assumes the path is the table root, and generates Hive-style partitioned directories with Snowflake IDs as file names and the file format as the extension. | |
There was a problem hiding this comment.
This added row duplicates the existing partition_strategy entry immediately below, so the rendered Arguments table now shows the same parameter twice. I think this should be collapsed back to a single row, keeping the default/partition_columns_in_data_file details in one place.
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered: 35/35 (100.00%) · Uncovered code |
0eb9389
Cherry pick #107437 to 26.6: Fix hive partition validation when compatibility is 26.6
Backport #107437 to 26.6: Fix hive partition validation when compatibility is 26.6
|
Found via ClickGap automated review. Please close or comment if this is incorrect or needs adjustment. TL;DRFix hive partition validation when compatibility is 26.6 ClickGap verified: reproduced it with the script below on ReproductionSET file_like_engine_default_partition_strategy = 'hive';
-- Fixed: raises BAD_ARGUMENTS "Partition strategy hive can not be used with a '_partition_id' wildcard".
-- Buggy (26.6): the table is silently created (implicit hive default promoted to wildcard).
CREATE TABLE t (a UInt64, b String)
ENGINE = S3('http://localhost:9000/bucket/data_{_partition_id}.parquet', 'Parquet')
PARTITION BY a;Bisect
Affects
Suggested next stepThe bug reproduces as far back as the oldest tested release ( Component: cc fix PR reviewer: @tiandiwonder @kssenii ClickGap · Finding: Triage metadata
|
After ClickHouse#107437, a CREATE statement with a `{_partition_id}` placeholder in the path and no explicit `partition_strategy` was rejected with `BAD_ARGUMENTS` whenever the effective `file_like_engine_default_partition_strategy` default was `hive` (the default since 26.6). This broke pre-26.6 DDL and DDL generators that rely on the implicit wildcard strategy. A `{_partition_id}` placeholder is valid only under the `wildcard` strategy, so when no explicit strategy is given the path alone determines the only strategy that can work. `initPartitionStrategy` now infers `wildcard` from the path shape on CREATE, the same way it already does on ATTACH / server startup / RESTORE. The default setting only applies to paths without the placeholder, and an explicit `partition_strategy = 'hive'` still rejects such paths. Related: ClickHouse#106465 Related: ClickHouse#86746
After ClickHouse#107437, a CREATE statement with a `{_partition_id}` placeholder in the path and no explicit `partition_strategy` was rejected with `BAD_ARGUMENTS` whenever the effective `file_like_engine_default_partition_strategy` default was `hive` (the default since 26.6). This broke pre-26.6 DDL and DDL generators that rely on the implicit wildcard strategy. A `{_partition_id}` placeholder is valid only under the `wildcard` strategy, so when no explicit strategy is given the path alone determines the only strategy that can work. `initPartitionStrategy` now infers `wildcard` from the path shape on CREATE, the same way it already does on ATTACH / server startup / RESTORE. The default setting only applies to paths without the placeholder, and an explicit `partition_strategy = 'hive'` still rejects such paths. Related: ClickHouse#106465 Related: ClickHouse#86746
…hive default.
Legacy S3/Azure integration tests that use {_partition_id} without an explicit
partition_strategy now opt into partition_strategy='wildcard', matching the
stateless test updates and fixing CI failures on PR ClickHouse#107437.
Co-authored-by: Cursor <[email protected]>
…e-partition-id-compatibility-106465 Fix hive partition validation when compatibility is 26.6
Closes: #106465
Caused by: #86746
After #86746,
compatibility = '26.6'makesfile_like_engine_default_partition_strategydefault to hive. A path containing{_partition_id}was silently accepted instead of raisingBAD_ARGUMENTS, while explicitly settingpartition_strategy = 'hive'correctly rejected it.In
StorageObjectStorageConfiguration::initialize(), the backwards-compatibility block unconditionally promoted{_partition_id}paths toWILDCARD, bypassing the hive default frominitPartitionStrategy(). The fix only performs that promotion when the effective default strategy isWILDCARD.Legacy stateless tests that still exercise implicit wildcard partitioning (
{_partition_id}without an explicit strategy) were updated to opt intopartition_strategy = 'wildcard'(orSET file_like_engine_default_partition_strategy = 'wildcard'), including02302_s3_file_pruning,04004_s3_schema_hash,2480_s3_support_wildcard, and related S3 tests.Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed a regression where setting compatibility = '26.6' (which implicitly enables hive partition strategy) silently accepted {_partition_id} in S3/object storage table paths instead of raising BAD_ARGUMENTS.
Documentation entry
Version info
26.7.1.1258(included in26.7and later)26.6.2.92