Skip to content

Unexpected failure in a subquery with a filter (SQLStorm) #17699

@2010YOUY01

Description

@2010YOUY01

Describe the bug

datafusion-cli is compiled from the latest main commit 1629420

DataFusion CLI v50.0.0
> CREATE TABLE orders (
    o_orderkey INT,
    o_totalprice DECIMAL(15, 2)
);

INSERT INTO orders VALUES (1, 10.00);

SELECT total_spent
FROM (
    SELECT
        SUM(o_totalprice) AS total_spent,
        COUNT(DISTINCT o_orderkey) AS order_count
    FROM orders
) t
WHERE total_spent > 0;

Arrow error: Invalid argument error: Invalid comparison operation: Decimal128(35, 2) > Decimal128(25, 2)

To Reproduce

No response

Expected behavior

No response

Additional context

Found by SQLStorm #17698

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions