Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partial aggregate error: column types must match schema types, expected Decimal128\(20, 3\) but found Decimal128\(38, 10\) at column index 1 #11832

Closed
alamb opened this issue Aug 5, 2024 · 1 comment · Fixed by #11833
Assignees
Labels
bug Something isn't working

Comments

@alamb
Copy link
Contributor

alamb commented Aug 5, 2024

Describe the bug

When the partial aggregate skipping logic added in #11627 is invoked for decimal values it generates an error like

query error DataFusion error: External error: Arrow error: Invalid argument error: column types must match schema types, expected Decimal128(20, 3) but found Decimal128(38, 10) at column index 1

To Reproduce

Add this to the end of datafusion/sqllogictest/test_files/aggregate_skip_partial.slt

statement ok
DROP TABLE aggregate_test_100_null;

# Test for aggregate functions with different intermediate types
# Need more than 10 values to trigger skipping
statement ok
CREATE TABLE decimal_table(i int, d decimal(10,3)) as
VALUES (1, 1.1), (2, 2.2), (3, 3.3), (2, 4.4), (1, 5.5);

statement ok
CREATE TABLE t(id int) as values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);

query error DataFusion error: External error: Arrow error: Invalid argument error: column types must match schema types, expected Decimal128\(20, 3\) but found Decimal128\(38, 10\) at column index 1
SELECT i, sum(d)
FROM decimal_table CROSS JOIN t
GROUP BY i
ORDER BY i;

statement ok
DROP TABLE decimal_table;

Expected behavior

No response

Additional context

I found this while testing

@alamb alamb added the bug Something isn't working label Aug 5, 2024
@alamb alamb self-assigned this Aug 5, 2024
@alamb
Copy link
Contributor Author

alamb commented Aug 5, 2024

I have a fix and a test for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant