duckdb/pg_duckdb

Pivot error

Open

#939 创建于 2025年9月28日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)C++ (183 fork)github user discovery
enhancementgood first issue

仓库指标

Star
 (3,125 star)
PR 合并指标
 (PR 指标待抓取)

描述

What happens?

-- Reviewed https://github.com/duckdb/pg_duckdb/blob/main/docs/gotchas_and_syntax.md#when-to-use-duckdbquery

-- This Works on my pgduckdb/pgduckdb:17-v1.0.0 instance SELECT * FROM duckdb.raw_query('

PIVOT "Order"
ON "StoreId"
USING SUM("Total")/100
GROUP BY status

');

-- This fails SELECT * FROM duckdb.query($$ PIVOT "Order" ON "StoreId" USING SUM("Total")/100 GROUP BY status $$);

-- Query 1 ERROR at Line 1: : ERROR: (PGDuckDB/CreatePlan) Prepared query returned an error: Parser Error: Expected a single SELECT statement

To Reproduce

SELECT * FROM duckdb.query('$$

    PIVOT "Order"
    ON "StoreId"
    USING SUM("Total")/100
    GROUP BY status

$$');   

OS:

Docker (running on MacOS)

pg_duckdb Version (if built from source use commit hash):

pgduckdb/pgduckdb:17-v1.0.0 i

Postgres Version (if built from source use commit hash):

17

Hardware:

N/A

Full Name:

Jim Castillo

Affiliation:

RepairWise

What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a stable release

Did you include all relevant data sets for reproducing the issue?

No - I cannot share the data sets because they are confidential

Did you include all code required to reproduce the issue?

  • Yes, I have

Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?

  • Yes, I have

贡献者指南