Repository navigation
Fix S3 positional partition_strategy case-insensitivity - #107297
Conversation
Closes: #102285 Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Workflow [PR], commit [25d5186] Summary: ❌
AI ReviewSummary
Final Verdict
|
…none' Closes: #102285 Co-Authored-By: Claude Opus 4.8 <[email protected]>
| { | ||
| auto sixth_arg = checkAndGetLiteralArgument<String>(args[6], "compression_method/partition_strategy"); | ||
| if (magic_enum::enum_contains<PartitionStrategyFactory::StrategyType>(sixth_arg)) | ||
| if (looksLikeExplicitPartitionStrategy(sixth_arg)) |
There was a problem hiding this comment.
This regresses a previously-valid 8-arg form: s3(..., format, structure, 'NONE', 1) used to parse as partition_strategy=NONE + partition_columns_in_data_file=1, but now 'NONE' is taken as compression_method and the 1 falls into the String partition_strategy slot, so it throws BAD_ARGUMENTS. Only the table-function path (with_structure=true) hits this. For count==8 it's cleaner to check whether args[7] parses as a bool first (then args[6] is the strategy) and only fall back to looksLikeExplicitPartitionStrategy otherwise.
|
|
||
| /// Disambiguates an ambiguous positional slot (partition strategy vs compression method). Matches a | ||
| /// real strategy case-insensitively (`hive`/`HIVE`), but excludes `NONE` so the valid compression | ||
| /// method `none` keeps mapping to compression_method rather than the default strategy. |
There was a problem hiding this comment.
compression_method should be backticked like the other names in this comment.
| SELECT * FROM s3('http://localhost:11111/test/test', 'key', 'secret', 'token', 'Parquet', 'col1 UInt32', 'none', 'unknown_strategy') LIMIT 0; -- { serverError BAD_ARGUMENTS } | ||
| SELECT * FROM s3('http://localhost:11111/test/test', 'key', 'secret', 'token', 'Parquet', 'col1 UInt32', 'NONE', 'unknown_strategy') LIMIT 0; -- { serverError BAD_ARGUMENTS } |
There was a problem hiding this comment.
Neither line discriminates — both throw BAD_ARGUMENTS with and without the PR. 'none', 'unknown_strategy' takes the compression+strategy layout both times (fails as an unknown strategy); 'NONE', 'unknown_strategy' fails on master converting 'unknown_strategy' to the bool partition_columns_in_data_file, and as an unknown strategy after — different messages, same code. The case that actually catches the count==8 regression is 'NONE', 1 (a bool 8th arg), which isn't covered.
Match exact enum names case-sensitively before the case-insensitive check, so positional `NONE`/`HIVE`/`WILDCARD` stay a partition_strategy while lowercase `none` keeps meaning compression_method. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
…ot LIMIT 0 Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
LLVM Coverage Report
Changed lines: Changed C/C++ lines covered by tests: 18/19 (94.74%) | Lost baseline coverage: none · Uncovered code |
|
@tiandiwonder Could you give it another look? CI failures are unrelated. |
|
@groeneai would you please fix CI failure: 04337_quorum_insert_honors_time_limit? |
|
@tiandiwonder confirmed: Triage (CIDB, 30d):
Mechanism (hypothesis): the break INSERT returns success when I could not reproduce the spurious success locally (debug build: 145+/145+ correct timeouts, including under CPU load and Thread Fuzzer), so I am not pushing a speculative change. The clean fix is test-side, on the author of #107513's call: make the second replica provably unable to confirm quorum (e.g. (groeneai, session cron:clickhouse-worker-slot-7:20260617-033400) |
|
@tiandiwonder this is now fixed upstream by #107760 (nickitat, the author of #107513), approved by azat. No action needed here. His fix removes the |
A
partition_strategypassed positionally to thes3table function was matchedcase-sensitively, so a lowercase value like
hivewas silently misrouted tocompression_method. Make the disambiguation case-insensitive.Closes: #102285
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix the
s3table function silently ignoring a lowercase positionalpartition_strategy(e.g.hive).Co-authored-by: Claude Opus 4.8 [email protected]
🤖 Generated with Claude Code
Version info
26.6.1.941