Skip to content

[Bug] can't read from table with partitioned clustered index #85

@keen85

Description

@keen85

Hi,
I noticed some limitation when trying to query a table that has a partitioned clustered index.

in MSSQL:

CREATE PARTITION FUNCTION [pf_logs_by_month] (DATETIME2(7))
AS RANGE RIGHT
FOR VALUES (
    '2026-02-01 00:00:00'
    , '2026-03-01 00:00:00'
    , '2026-04-01 00:00:00'
);
GO

CREATE PARTITION SCHEME [ps_logs_by_month]
AS PARTITION [pf_logs_by_month] ALL TO ([PRIMARY]);
GO

CREATE TABLE [dbo].[log](
    log_ts DATETIME2(7) DEFAULT (GETUTCDATE()) NOT NULL,
    message NVARCHAR(255) 
);
INSERT INTO [dbo].[log] (message) VALUES ('bar');
CREATE CLUSTERED INDEX [ix_ci_log_log_ts]
    ON [dbo].[log] (log_ts DESC) WITH (DATA_COMPRESSION = PAGE, OPTIMIZE_FOR_SEQUENTIAL_KEY = ON)
    ON [ps_logs_by_month] (log_ts);
GO

When trying to query it via DuckDB & mssql-extension, it fails:

SELECT * FROM attached_db.dbo.log;
Catalog Error:
Column with name log_ts already exists!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdocumentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions