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

Commit a945abf

Browse files
committed
Merge
2 parents f4108b3 + 228e7ba commit a945abf

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

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

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -117,22 +117,19 @@ impl SchemaPropertyBuilder {
117117
Schema { fields }
118118
}
119119
DfPredType::LogOp(_) => Schema {
120-
fields: vec![Field::placeholder(); children.len()],
120+
fields: vec![Field {
121+
typ: ConstantType::Bool,
122+
..Field::placeholder()
123+
}],
124+
},
125+
DfPredType::BinOp(_) => Schema {
126+
fields: vec![Field::placeholder()],
121127
},
122-
DfPredType::BinOp(_) => {
123-
let mut fields = children[0].fields.clone();
124-
fields.extend(children[1].fields.clone());
125-
Schema { fields }
126-
}
127128
DfPredType::Cast => Schema {
128-
fields: children[0]
129-
.fields
130-
.iter()
131-
.map(|field| Field {
132-
typ: children[1].fields[0].typ,
133-
..field.clone()
134-
})
135-
.collect(),
129+
fields: vec![Field {
130+
typ: children[1].fields[0].typ,
131+
..children[0].fields[0].clone()
132+
}],
136133
},
137134
DfPredType::DataType(data_type) => Schema {
138135
fields: vec![Field {
@@ -148,7 +145,9 @@ impl SchemaPropertyBuilder {
148145
// The real type should be the column type.
149146
fields: vec![Field::placeholder()],
150147
},
151-
_ => Schema { fields: vec![] },
148+
_ => Schema {
149+
fields: vec![Field::placeholder()], // all predicates produce at least one column
150+
},
152151
}
153152
}
154153
}

0 commit comments

Comments
 (0)