jackwener opened a new issue, #4575:
URL: https://github.com/apache/arrow-datafusion/issues/4575
**Describe the bug**
It will make some strange problem.
```
Error: Internal("Optimizer rule 'common_sub_expression_eliminate' failed,
due to generate a different schema, original schema:
DFSchema { fields: [
DFField { qualifier: Some(\"t1\"), field: Field { name: \"t1_id\",
data_type: UInt32, nullable: true, dict_id: 0, dict_is_ordered: false,
metadata: {} } },
DFField { qualifier: Some(\"t1\"), field: Field { name: \"t1_name\",
data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} } },
DFField { qualifier: Some(\"t1\"), field: Field { name: \"t1_int\",
data_type: UInt32, nullable: true, dict_id: 0, dict_is_ordered: false,
metadata: {} } },
DFField { qualifier: Some(\"t2\"), field: Field { name: \"t2_id\",
data_type: UInt32, nullable: true, dict_id: 0, dict_is_ordered: false,
metadata: {} } },
DFField { qualifier: Some(\"t2\"), field: Field { name: \"t2_name\",
data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} } },
DFField { qualifier: Some(\"t2\"), field: Field { name: \"t2_int\",
data_type: UInt32, nullable: true, dict_id: 0, dict_is_ordered: false,
metadata: {} } }], metadata: {} }, new schema:
DFSchema { fields: [
DFField { qualifier: None, field: Field { name: \"t2.t2_int <
UInt32(10)UInt32(10)t2.t2_int\", data_type: Boolean, nullable: true, dict_id:
0, dict_is_ordered: false, metadata: {} } },
DFField { qualifier: Some(\"t1\"), field: Field { name: \"t1_id\",
data_type: UInt32, nullable: true, dict_id: 0, dict_is_ordered: false,
metadata: {} } },
DFField { qualifier: Some(\"t1\"), field: Field { name: \"t1_name\",
data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} } },
DFField { qualifier: Some(\"t1\"), field: Field { name: \"t1_int\",
data_type: UInt32, nullable: true, dict_id: 0, dict_is_ordered: false,
metadata: {} } },
DFField { qualifier: Some(\"t2\"), field: Field { name: \"t2_id\",
data_type: UInt32, nullable: true, dict_id: 0, dict_is_ordered: false,
metadata: {} } },
DFField { qualifier: Some(\"t2\"), field: Field { name: \"t2_name\",
data_type: Utf8, nullable: true, dict_id: 0, dict_is_ordered: false, metadata:
{} } },
DFField { qualifier: Some(\"t2\"), field: Field { name: \"t2_int\",
data_type: UInt32, nullable: true, dict_id: 0, dict_is_ordered: false,
metadata: {} } }], metadata: {} }")
original:
"Projection: t1.t1_id, t1.t1_name, t1.t1_int, t2.t2_id, t2.t2_name, t2.t2_int
Filter: t2.t2_int < Int64(10) OR t1.t1_int > Int64(2) AND t2.t2_name !=
Utf8("w")
Left Join: t1.t1_id = t2.t2_id
TableScan: t1
TableScan: t2"
after:
"Filter: (t2.t2_int < UInt32(10)UInt32(10)t2.t2_int AS t2.t2_int <
UInt32(10) OR t1.t1_int > UInt32(2)) AND (t2.t2_int <
UInt32(10)UInt32(10)t2.t2_int AS t2.t2_int < UInt32(10) OR t2.t2_name !=
Utf8("w"))
Projection: t2.t2_int < UInt32(10) AS t2.t2_int <
UInt32(10)UInt32(10)t2.t2_int, t1.t1_id, t1.t1_name, t1.t1_int, t2.t2_id,
t2.t2_name, t2.t2_int
Inner Join: t1.t1_id = t2.t2_id
TableScan: t1 projection=[t1_id, t1_name, t1_int]
TableScan: t2 projection=[t2_id, t2_name, t2_int]"
```
**To Reproduce**
Steps to reproduce the behavior:
**Expected behavior**
A clear and concise description of what you expected to happen.
**Additional context**
Add any other context about the problem here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]