Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Commit 1000e13

Browse files
authored
fix(df-repr): join schema inference (#199)
Signed-off-by: Alex Chi <[email protected]>
1 parent 34bfb62 commit 1000e13

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

optd-datafusion-repr/src/properties/schema.rs

+14-6
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,20 @@ impl PropertyBuilder<OptRelNodeTyp> for SchemaPropertyBuilder {
7373
}
7474
OptRelNodeTyp::Projection => children[1].clone(),
7575
OptRelNodeTyp::Filter => children[0].clone(),
76-
OptRelNodeTyp::DepJoin(_) => children[0].clone(),
77-
OptRelNodeTyp::Join(_) => {
78-
let mut schema = children[0].clone();
79-
let schema2 = children[1].clone();
80-
schema.fields.extend(schema2.fields);
81-
schema
76+
OptRelNodeTyp::RawDepJoin(join_type)
77+
| OptRelNodeTyp::Join(join_type)
78+
| OptRelNodeTyp::DepJoin(join_type) => {
79+
use crate::plan_nodes::JoinType::*;
80+
match join_type {
81+
Inner | LeftOuter | RightOuter | FullOuter | Cross => {
82+
let mut schema = children[0].clone();
83+
let schema2 = children[1].clone();
84+
schema.fields.extend(schema2.fields);
85+
schema
86+
}
87+
LeftSemi | LeftAnti => children[0].clone(),
88+
RightSemi | RightAnti => children[1].clone(),
89+
}
8290
}
8391
OptRelNodeTyp::EmptyRelation => {
8492
let data = data.unwrap().as_slice();

0 commit comments

Comments
 (0)