apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.33k stars 1.2k forks source link

Subquery check_internal_plan does not support LogicalPlan::Unnest #13498

Open kosiew opened 1 day ago

kosiew commented 1 day ago

Describe the bug

The Error during planning: Unsupported operator in the subquery plan. error in https://github.com/apache/datafusion-python/issues/850 is due to datafusion/optimizer/src/analyzer/subquery.rs's check_internal_plan not handling LogicalPlan::Unnest

To Reproduce

Follow the steps in https://github.com/apache/datafusion-python/issues/850

Expected behavior

Datafusion should handle it

Additional context

No response

kosiew commented 1 day ago

I can try to fix this but I don't know where the existing tests for check_inner_plan are.

alamb commented 1 day ago

@kosiew I would recommend trying to write a SQL query (or rust dataframe example) that shows the same behavior

the sql tests are in https://github.com/apache/datafusion/blob/main/datafusion/sqllogictest/test_files/unnest.slt

The dataframe test are in: https://github.com/apache/datafusion/blob/main/datafusion/core/tests/dataframe/mod.rs