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

Error while running COUNT DISTINCT (timestamp): 'Unexpected DataType for list #314

Closed
alamb opened this issue May 10, 2021 · 2 comments · Fixed by #319
Closed

Error while running COUNT DISTINCT (timestamp): 'Unexpected DataType for list #314

alamb opened this issue May 10, 2021 · 2 comments · Fixed by #319
Labels
bug Something isn't working datafusion Changes in the datafusion crate good first issue Good for newcomers

Comments

@alamb
Copy link
Contributor

alamb commented May 10, 2021

Describe the bug
A query panic'd on me

To Reproduce
Make a local file

echo "2018-11-13T17:11:10.011" > /tmp/foo.csv
echo "2018-12-13T12:12:10.011" >> /tmp/foo.csv
echo "2018-12-13T12:12:10.011" >> /tmp/foo.csv
echo "2018-12-13T12:13:10.011" >> /tmp/foo.csv

Run a query with datafusion-cli

cargo run -p datafusion-cli
    Finished dev [unoptimized + debuginfo] target(s) in 0.12s
     Running `target/debug/datafusion-cli`
> CREATE EXTERNAL TABLE foo(ts TIMESTAMP)
STORED AS CSV
LOCATION '/tmp/foo.csv';

0 rows in set. Query took 0 seconds.
> SELECT COUNT(DISTINCT ts) from foo;

thread 'tokio-runtime-worker' panicked at 'Unexpected DataType for list', datafusion/src/scalar.rs:366:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread 'tokio-runtime-worker' panicked at 'Unexpected DataType for list', datafusion/src/scalar.rs:366:22
thread 'tokio-runtime-worker' panicked at 'Unexpected DataType for list', datafusion/src/scalar.rs:366:22
thread 'tokio-runtime-worker' panicked at 'Unexpected DataType for list', datafusion/src/scalar.rs:366:22
thread 'tokio-runtime-worker' panicked at 'Unexpected DataType for list', datafusion/src/scalar.rs:366:22
thread 'tokio-runtime-worker' panicked at 'Unexpected DataType for list', datafusion/src/scalar.rs:366:22
thread 'tokio-runtime-worker' panicked at 'thread 'Unexpected DataType for listthread '', tokio-runtime-workerdatafusion/src/scalar.rstokio-runtime-worker' panicked at ':' panicked at 'Unexpected DataType for list366Unexpected DataType for list', :', thread 'datafusion/src/scalar.rsdatafusion/src/scalar.rstokio-runtime-worker22:thread '' panicked at ':
366366Unexpected DataType for list:tokio-runtime-worker:', 22thread '22datafusion/src/scalar.rs' panicked at 'tokio-runtime-worker
Unexpected DataType for list' panicked at '
', :Unexpected DataType for listdatafusion/src/scalar.rs366thread '::tokio-runtime-worker366', ' panicked at ':22datafusion/src/scalar.rsUnexpected DataType for list
22', :
datafusion/src/scalar.rsthread '366:tokio-runtime-worker:366' panicked at '22:Unexpected DataType for list
22', 
datafusion/src/scalar.rs:366:22
thread 'tokio-runtime-worker' panicked at 'Unexpected DataType for list', ArrowError(ExternalError(Canceled))
datafusion/src/scalar.rs:366:22
> thread 'tokio-runtime-worker' panicked at 'Unexpected DataType for list', datafusion/src/scalar.rs:366:22

Expected behavior
I expect a result to be produced with 3 distinct timestamp values

@alamb alamb added bug Something isn't working good first issue Good for newcomers datafusion Changes in the datafusion crate labels May 10, 2021
@charlibot
Copy link
Contributor

Hi @alamb, I had a go at resolving this in #319.

@alamb
Copy link
Contributor Author

alamb commented May 12, 2021

Thanks @charlibot !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working datafusion Changes in the datafusion crate good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants