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

Improve the errors that result when a aggregate type is not supported #201

Closed
Tracked by #2355
alamb opened this issue Apr 26, 2021 · 2 comments
Closed
Tracked by #2355

Improve the errors that result when a aggregate type is not supported #201

alamb opened this issue Apr 26, 2021 · 2 comments
Labels
datafusion Changes in the datafusion crate

Comments

@alamb
Copy link
Contributor

alamb commented Apr 26, 2021

Note: migrated from original JIRA: https://issues.apache.org/jira/browse/ARROW-12319

When you try and run a query such as

{code}
select AVG(ts_colum) from t;
{code}

where ts_column has DataType::Timestamp type, you get a pretty unintelligible error message

"Coercion from [Timestamp(Nanosecond, None)] to the signature Uniform(1, [Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Float32, Float64]) failed."

This error should be improved to say something more like "AVG is not supported for {datatype} try an explicit cast."

@alamb alamb added the datafusion Changes in the datafusion crate label Apr 26, 2021
@alamb
Copy link
Contributor Author

alamb commented Apr 26, 2021

Comment from Andrew Lamb(alamb) @ 2021-04-09T21:12:18.292+0000:

I spent some non trivial time in IOx trying to figure out what this message meant when trying to do MIN(timestamp) column

@alamb
Copy link
Contributor Author

alamb commented Jun 11, 2023

I believe the errors are now much improved so closing this ticket:

❯ create table foo (x timestamp) as values ('2023-01-01');
0 rows in set. Query took 0.005 seconds.
❯ select * from foo;
+---------------------+
| x                   |
+---------------------+
| 2023-01-01T00:00:00 |
+---------------------+
1 row in set. Query took 0.002 seconds.
❯ select avg(x) from foo;
Error during planning: The function Avg does not support inputs of type Timestamp(Nanosecond, None).
❯

@alamb alamb closed this as completed Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datafusion Changes in the datafusion crate
Projects
None yet
Development

No branches or pull requests

1 participant