parkma99 commented on issue #6677:
URL:
https://github.com/apache/arrow-datafusion/issues/6677#issuecomment-1595697636
I create this #6708 PR . Now it still has some error like this:
```shell
External error: query result mismatch:
[SQL] EXPLAIN
select *, join_t1.t1_id + 11
from join_t1, join_t2
where join_t1.t1_id + 11 = join_t2.t2_id
[Diff] (-expected|+actual)
logical_plan
Projection: join_t1.t1_id, join_t1.t1_name, join_t1.t1_int,
join_t2.t2_id, join_t2.t2_name, join_t2.t2_int, CAST(join_t1.t1_id AS Int64) +
Int64(11)
--Inner Join: CAST(join_t1.t1_id AS Int64) + Int64(11) =
CAST(join_t2.t2_id AS Int64)
----TableScan: join_t1 projection=[t1_id, t1_name, t1_int]
----TableScan: join_t2 projection=[t2_id, t2_name, t2_int]
physical_plan
ProjectionExec: expr=[t1_id@0 as t1_id, t1_name@1 as t1_name, t1_int@2
as t1_int, t2_id@3 as t2_id, t2_name@4 as t2_name, t2_int@5 as t2_int,
CAST(t1_id@0 AS Int64) + 11 as join_t1.t1_id + Int64(11)]
--ProjectionExec: expr=[t1_id@0 as t1_id, t1_name@1 as t1_name, t1_int@2
as t1_int, t2_id@4 as t2_id, t2_name@5 as t2_name, t2_int@6 as t2_int]
----CoalesceBatchesExec: target_batch_size=4096
- ------HashJoinExec: mode=CollectLeft, join_type=Inner, on=[(Column {
name: "join_t1.t1_id + Int64(11)", index: 3 }, Column { name:
"CAST(join_t2.t2_id AS Int64)", index: 3 })]
+ ------HashJoinExec: mode=CollectLeft, join_type=Inner, on=[(Column {
name: "join_t1.t1_id + Int64(11)", index: 3 }, Column { name: "Cast(Cast {
expr: Column(Column { relation: Some(Bare { table: \"join_t2\" }), name:
\"t2_id\" }), data_type: Int64 })", index: 3 })]
--------CoalescePartitionsExec
----------ProjectionExec: expr=[t1_id@0 as t1_id, t1_name@1 as t1_name,
t1_int@2 as t1_int, CAST(t1_id@0 AS Int64) + 11 as join_t1.t1_id + Int64(11)]
------------RepartitionExec: partitioning=RoundRobinBatch(2),
input_partitions=1
--------------MemoryExec: partitions=1, partition_sizes=[1]
- --------ProjectionExec: expr=[t2_id@0 as t2_id, t2_name@1 as t2_name,
t2_int@2 as t2_int, CAST(t2_id@0 AS Int64) as CAST(join_t2.t2_id AS Int64)]
+ --------ProjectionExec: expr=[t2_id@0 as t2_id, t2_name@1 as t2_name,
t2_int@2 as t2_int, CAST(t2_id@0 AS Int64) as Cast(Cast { expr: Column(Column {
relation: Some(Bare { table: "join_t2" }), name: "t2_id" }), data_type: Int64
})]
----------RepartitionExec: partitioning=RoundRobinBatch(2),
input_partitions=1
------------MemoryExec: partitions=1, partition_sizes=[1]
at tests/sqllogictests/test_files/joins.slt:1430
External error: query result mismatch:
[SQL] explain
(
SELECT id, name FROM t1
EXCEPT
SELECT id, name FROM t2
)
UNION ALL
(
SELECT id, name FROM t2
EXCEPT
SELECT id, name FROM t1
)
[Diff] (-expected|+actual)
logical_plan
Union
--LeftAnti Join: t1.id = CAST(t2.id AS Int32), t1.name = t2.name
----Aggregate: groupBy=[[t1.id, t1.name]], aggr=[[]]
------TableScan: t1 projection=[id, name]
----TableScan: t2 projection=[id, name]
--Projection: CAST(t2.id AS Int32) AS id, t2.name
----LeftAnti Join: CAST(t2.id AS Int32) = t1.id, t2.name = t1.name
------Aggregate: groupBy=[[t2.id, t2.name]], aggr=[[]]
--------TableScan: t2 projection=[id, name]
------TableScan: t1 projection=[id, name]
physical_plan
UnionExec
--ProjectionExec: expr=[id@0 as id, name@1 as name]
----CoalesceBatchesExec: target_batch_size=8192
- ------HashJoinExec: mode=Partitioned, join_type=LeftAnti, on=[(Column {
name: "id", index: 0 }, Column { name: "CAST(t2.id AS Int32)", index: 2 }),
(Column { name: "name", index: 1 }, Column { name: "name", index: 1 })]
+ ------HashJoinExec: mode=Partitioned, join_type=LeftAnti, on=[(Column {
name: "id", index: 0 }, Column { name: "Cast(Cast { expr: Column(Column {
relation: Some(Bare { table: \"t2\" }), name: \"id\" }), data_type: Int32 })",
index: 2 }), (Column { name: "name", index: 1 }, Column { name: "name", index:
1 })]
--------AggregateExec: mode=FinalPartitioned, gby=[id@0 as id, name@1 as
name], aggr=[]
----------CoalesceBatchesExec: target_batch_size=8192
------------RepartitionExec: partitioning=Hash([Column { name: "id",
index: 0 }, Column { name: "name", index: 1 }], 4), input_partitions=4
--------------AggregateExec: mode=Partial, gby=[id@0 as id, name@1 as
name], aggr=[]
----------------MemoryExec: partitions=4, partition_sizes=[1, 0, 0, 0]
--------CoalesceBatchesExec: target_batch_size=8192
- ----------RepartitionExec: partitioning=Hash([Column { name: "CAST(t2.id
AS Int32)", index: 2 }, Column { name: "name", index: 1 }], 4),
input_partitions=4
- ------------ProjectionExec: expr=[id@0 as id, name@1 as name, CAST(id@0
AS Int32) as CAST(t2.id AS Int32)]
+ ----------RepartitionExec: partitioning=Hash([Column { name: "Cast(Cast
{ expr: Column(Column { relation: Some(Bare { table: \"t2\" }), name: \"id\"
}), data_type: Int32 })", index: 2 }, Column { name: "name", index: 1 }], 4),
input_partitions=4
+ ------------ProjectionExec: expr=[id@0 as id, name@1 as name, CAST(id@0
AS Int32) as Cast(Cast { expr: Column(Column { relation: Some(Bare { table:
"t2" }), name: "id" }), data_type: Int32 })]
--------------MemoryExec: partitions=4, partition_sizes=[1, 0, 0, 0]
--ProjectionExec: expr=[CAST(id@0 AS Int32) as id, name@1 as name]
----ProjectionExec: expr=[id@0 as id, name@1 as name]
------CoalesceBatchesExec: target_batch_size=8192
- --------HashJoinExec: mode=Partitioned, join_type=LeftAnti, on=[(Column
{ name: "CAST(t2.id AS Int32)", index: 2 }, Column { name: "id", index: 0 }),
(Column { name: "name", index: 1 }, Column { name: "name", index: 1 })]
+ --------HashJoinExec: mode=Partitioned, join_type=LeftAnti, on=[(Column
{ name: "Cast(Cast { expr: Column(Column { relation: Some(Bare { table: \"t2\"
}), name: \"id\" }), data_type: Int32 })", index: 2 }, Column { name: "id",
index: 0 }), (Column { name: "name", index: 1 }, Column { name: "name", index:
1 })]
----------CoalesceBatchesExec: target_batch_size=8192
- ------------RepartitionExec: partitioning=Hash([Column { name:
"CAST(t2.id AS Int32)", index: 2 }, Column { name: "name", index: 1 }], 4),
input_partitions=4
- --------------ProjectionExec: expr=[id@0 as id, name@1 as name,
CAST(id@0 AS Int32) as CAST(t2.id AS Int32)]
+ ------------RepartitionExec: partitioning=Hash([Column { name:
"Cast(Cast { expr: Column(Column { relation: Some(Bare { table: \"t2\" }),
name: \"id\" }), data_type: Int32 })", index: 2 }, Column { name: "name",
index: 1 }], 4), input_partitions=4
+ --------------ProjectionExec: expr=[id@0 as id, name@1 as name,
CAST(id@0 AS Int32) as Cast(Cast { expr: Column(Column { relation: Some(Bare {
table: "t2" }), name: "id" }), data_type: Int32 })]
----------------AggregateExec: mode=FinalPartitioned, gby=[id@0 as id,
name@1 as name], aggr=[]
------------------CoalesceBatchesExec: target_batch_size=8192
--------------------RepartitionExec: partitioning=Hash([Column { name:
"id", index: 0 }, Column { name: "name", index: 1 }], 4), input_partitions=4
----------------------AggregateExec: mode=Partial, gby=[id@0 as id,
name@1 as name], aggr=[]
------------------------MemoryExec: partitions=4, partition_sizes=[1, 0,
0, 0]
----------CoalesceBatchesExec: target_batch_size=8192
------------RepartitionExec: partitioning=Hash([Column { name: "id",
index: 0 }, Column { name: "name", index: 1 }], 4), input_partitions=4
--------------MemoryExec: partitions=4, partition_sizes=[1, 0, 0, 0]
at tests/sqllogictests/test_files/union.slt:178
Error: Execution("2 failures")
error: test failed, to rerun pass `-p datafusion --test sqllogictests`
```
I am not sure to change the `slt` file or change the code. Thanks for your
answer @crepererum
--
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]