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

sqlite test query results in Internal error: predicate did not evaluate to an array #14099

Closed
Tracked by #13811
Omega359 opened this issue Jan 12, 2025 · 3 comments · Fixed by #14156
Closed
Tracked by #13811

sqlite test query results in Internal error: predicate did not evaluate to an array #14099

Omega359 opened this issue Jan 12, 2025 · 3 comments · Fixed by #14156
Labels
bug Something isn't working

Comments

@Omega359
Copy link
Contributor

Describe the bug

Seen in datafusion-testing/data/sqlite/random/expr/slt_good_102.slt:

# Datafusion - Datafusion expected results:
# Datafusion - Expected - -704522
query error
SELECT - 79 * + 91 * - COUNT ( * ) * + - 2 * + - NULLIF ( - 49, - COALESCE ( - + 69, - COALESCE ( + COALESCE ( - 20, ( - 18 ) * + COUNT ( * ) + - 93, - CASE 51 WHEN + COUNT ( * ) + 28 THEN 0 ELSE + 29 * + CASE ( 50 ) WHEN - ( - ( CASE WHEN NOT + 37 IS NULL THEN + COUNT ( * ) END ) ) THEN NULL WHEN - 46 + 87 * - 28 THEN 85 WHEN - COUNT ( * ) THEN NULL END END ), COUNT ( * ) - 39 ) * + 22 ) / - COUNT ( * ) )
----
DataFusion error: Internal error: predicate did not evaluate to an array.
This was likely caused by a bug in DataFusion's code and we would welcome that you file an bug report in our issue tracker

To Reproduce

See above sql.

Expected behavior

Result should be -704522 which is what both Postgresql and duckdb return

Additional context

No response

@Omega359 Omega359 added the bug Something isn't working label Jan 12, 2025
@Omega359
Copy link
Contributor Author

This occurs about 60 times in the sqlite tests. A few more examples:

SELECT ALL - 42 * ( COUNT ( * ) ) AS col2, - CASE WHEN NOT + 39 IS NOT NULL THEN + SUM ( DISTINCT + - 1 ) ELSE NULL END * 56 - - + 50 + - 53 * + - 36 AS col1;
SELECT - 33 - CASE WHEN NOT - 5 IS NOT NULL THEN + AVG ( + + 28 ) ELSE NULL END * + 15 * - + ( - + 58 ) + + 67 + - 1 * - + 43, + 20 AS col1;
SELECT + CASE WHEN NOT ( NULL ) IS NOT NULL THEN + MAX ( DISTINCT + + 99 ) END AS col0;
...

@Omega359 Omega359 changed the title sqlite query results in Internal error: predicate did not evaluate to an array sqlite test query results in Internal error: predicate did not evaluate to an array Jan 12, 2025
@avkirilishin
Copy link
Contributor

@Omega359, could you please take a look at #14156

Image

@Omega359
Copy link
Contributor Author

Thanks! I'll see if I can find the time to run the sqlite tests again your branch tonight.

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
2 participants