You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Optimizer rule scalar_subquery_to_join generates a different schema #6606
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
DataFusion CLI v26.0.0
❯ create table t(a int);
0 rows in set. Query took 0.005 seconds.
❯ selecta> (select avg(a) from t) from t;
scalar_subquery_to_join
caused by
Internal error: Optimizer rule 'scalar_subquery_to_join' failed, due to generate a different schema, original schema: DFSchema { fields: [DFField { qualifier: None, field: Field { name: "t.a > AVG(t.a)", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } }], metadata: {} }, new schema: DFSchema { fields: [DFField { qualifier: None, field: Field { name: "t.a > __scalar_sq_1.__value", data_type: Boolean, nullable: true, dict_id: 0, dict_is_ordered: false, metadata: {} } }], metadata: {} }. 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
Activity
mingmwang commentedon Jun 12, 2023
I will take a look
parkma99 commentedon Jun 12, 2023
I think it's because the code L98 to L102 should check subquery is a
scalar queryor not.mingmwang commentedon Jun 25, 2023
@parkma99
I think the issue is fixed after this PR #6457.
I had verified and the error is gone.
mingmwang commentedon Jun 25, 2023
@alamb