Repository navigation
Add {_schema_hash} placeholder for S3 table engine - #98265
Conversation
|
Workflow [PR], commit [9b46f0a] Summary: ❌
|
|
Related to #98265 (comment): I think we need to disallow ClickHouse/src/Storages/ObjectStorage/StorageObjectStorageConfiguration.cpp Lines 172 to 185 in 215f3d3 It'll probably never happen with ClickHouse/src/Storages/ObjectStorage/StorageObjectStorageConfiguration.cpp Lines 119 to 125 in 215f3d3 On the other hand, from what I can see, I think the simplest solution would be to explicitly disallow the combination by adding a check in the new Also, maybe good to add a test for this. |
In `{ echo }` mode, queries expecting `serverError` are still echoed
to stdout. The reference file was missing these lines, causing CI to
fail with a diff mismatch.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
| const S3::S3AuthSettings & getAuthSettings() const { return s3_settings->auth_settings; } | ||
|
|
||
| Path getRawPath() const override { return url.key; } | ||
| void setRawPath(const Path & path) override { url.key = path.path; } |
There was a problem hiding this comment.
S3 setRawPath doesn't update uri_str, causing URI inconsistency
Medium Severity
The S3 setRawPath implementation sets url.key = path.path but doesn't update url.uri_str. After setSchemaHash calls setRawPath, url.key contains the resolved path (with the actual hash) while url.uri_str still contains the {_schema_hash} placeholder. Since getRawURI() returns url.uri_str and is documented as being used for permission checks, this inconsistency means permission checks evaluate against a stale URI containing the literal {_schema_hash} text rather than the resolved path. This differs from {_partition_id} behavior, where the raw path and URI remain consistently unresolved.
Additional Locations (1)
There was a problem hiding this comment.
URI is only used in the permission check (checkAccessWithFilter), which runs in ITableFunction::execute before setSchemaHash is ever called.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
LLVM Coverage Report
PR changed lines: PR changed-lines coverage: 87.07% (101/116) |


Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add a
{_schema_hash}placeholder for the S3 table engine that inserts a hash of the table's column definitions into the S3 path.Documentation entry for user-facing changes
Note
Medium Risk
Touches core object-storage path resolution (including glob/placeholder detection) and changes
TRUNCATEbehavior for partitioned paths, which could affect existing S3/Azure/HDFS/Local table configurations at runtime.Overview
Adds support for a new
{_schema_hash}placeholder in object-storage paths, computing a SipHash from the table’s physical column definitions and substituting it into the configured read/write paths (rejecting use without explicit columns, with DataLake engines, or withpartition_strategy='hive').Updates configuration implementations (S3/Azure/HDFS/Local) to allow mutating the raw path after initialization, refines glob detection to ignore
{_partition_id}/{_schema_hash}placeholders, and makesTRUNCATEexplicitly fail for partitioned tables (paths containing{_partition_id}) instead of silently succeeding. Tests are extended to cover the new placeholder, validation errors, and the updated truncate semantics.Written by Cursor Bugbot for commit 9b46f0a. This will update automatically on new commits. Configure here.
Version info
26.3.1.581