Skip to content

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

Closed

Description

@Omega359

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

Activity

  1. Omega359 commented on Jan 12, 2025

    @Omega359
    ContributorAuthor

    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;
    ...
  2. 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[/+] on Jan 12, 2025
  3. avkirilishin commented on Jan 16, 2025

    @avkirilishin
    Contributor

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

    Image
  4. Omega359 commented on Jan 16, 2025

    @Omega359
    ContributorAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions