这是indexloc提供的服务,不要输入任何密码
Skip to content

Materialized View with S3 Engine Treats {_partition_id} as Literal Path Instead of Resolving Partitions #84419

@shawel

Description

@shawel

Company or project name

No response

Describe the unexpected behaviour

Issue: {_partition_id} not resolving in S3-engine Materialized Views

Test Case:

CREATE MATERIALIZED VIEW test.s3_partition_issue
(
    `account_id` String,
    `source_id` String,
    `col1` UInt32
)
ENGINE = S3(
    'https://s3.region.amazonaws.com/bucket/test/{_partition_id}/data.json',
    'AWS_ACCESS_KEY_ID',
    'AWS_SECRET_ACCESS_KEY',
    'JSONEachRow'
)
PARTITION BY concat(account_id, '/', source_id)
AS SELECT
    'test_account' AS account_id,
    'test_source' AS source_id,
    1 AS col1 from events

works when using regular insert

### Which ClickHouse versions are affected?

all versions tested on 24.11 and 25.5

### How to reproduce

create an s3 engine table with partition and attempt insertion via a trigger. Also tested using the Materialized View TO syntax version

### Expected behavior

resolve {_partition_id} as expected in s3 

### Error message and/or stacktrace

_No response_

### Additional context

_No response_

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions