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

Bug in SimplifyExpressions #7700

Closed
Dandandan opened this issue Sep 29, 2023 · 0 comments · Fixed by #7699
Closed

Bug in SimplifyExpressions #7700

Dandandan opened this issue Sep 29, 2023 · 0 comments · Fixed by #7699
Labels
bug Something isn't working

Comments

@Dandandan
Copy link
Contributor

Describe the bug

SimplifyExpressions doesn't have access to the entire schema, resulting in planning errors when the filter can be pushed down entirely to the tablescan.

        let fields = vec![
            Field::new("a", DataType::UInt32, false),
            Field::new("b", DataType::UInt32, false),
            Field::new("c", DataType::UInt32, false),
        ];

        let schema = Schema::new(fields);

        let table_scan = table_scan_with_filters(
            Some("test"),
            &schema,
            Some(vec![0]),
            vec![col("b").is_not_null()],
        )?
        .build()?;
        assert_eq!(1, table_scan.schema().fields().len());
        assert_fields_eq(&table_scan, vec!["a"]);

        let expected = "TableScan: test projection=[a], full_filters=[Boolean(true) AS b IS NOT NULL]";

        assert_optimized_plan_eq(&table_scan, expected)

To Reproduce

No response

Expected behavior

No response

Additional context

No response

@Dandandan Dandandan added the bug Something isn't working label Sep 29, 2023
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