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

Commit

Permalink
fix(df-repr): join schema inference (#199)
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi <[email protected]>
  • Loading branch information
skyzh authored Oct 29, 2024
1 parent 34bfb62 commit 1000e13
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions optd-datafusion-repr/src/properties/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,20 @@ impl PropertyBuilder<OptRelNodeTyp> for SchemaPropertyBuilder {
}
OptRelNodeTyp::Projection => children[1].clone(),
OptRelNodeTyp::Filter => children[0].clone(),
OptRelNodeTyp::DepJoin(_) => children[0].clone(),
OptRelNodeTyp::Join(_) => {
let mut schema = children[0].clone();
let schema2 = children[1].clone();
schema.fields.extend(schema2.fields);
schema
OptRelNodeTyp::RawDepJoin(join_type)
| OptRelNodeTyp::Join(join_type)
| OptRelNodeTyp::DepJoin(join_type) => {
use crate::plan_nodes::JoinType::*;
match join_type {
Inner | LeftOuter | RightOuter | FullOuter | Cross => {
let mut schema = children[0].clone();
let schema2 = children[1].clone();
schema.fields.extend(schema2.fields);
schema
}
LeftSemi | LeftAnti => children[0].clone(),
RightSemi | RightAnti => children[1].clone(),
}
}
OptRelNodeTyp::EmptyRelation => {
let data = data.unwrap().as_slice();
Expand Down

0 comments on commit 1000e13

Please sign in to comment.