(
predicate: Expr,
null_columns: impl IntoIterator<Item = &'a Column>,
)
| 160 | } |
| 161 | |
| 162 | fn evaluate_expr_with_null_column<'a>( |
| 163 | predicate: Expr, |
| 164 | null_columns: impl IntoIterator<Item = &'a Column>, |
| 165 | ) -> Result<ColumnarValue> { |
| 166 | static DUMMY_COL_NAME: &str = "?"; |
| 167 | let schema = Arc::new(Schema::new(vec![Field::new( |
| 168 | DUMMY_COL_NAME, |
| 169 | DataType::Null, |
| 170 | true, |
| 171 | )])); |
| 172 | let input_schema = DFSchema::try_from(Arc::clone(&schema))?; |
| 173 | let column = new_null_array(&DataType::Null, 1); |
| 174 | let input_batch = RecordBatch::try_new(schema, vec![column])?; |
| 175 | let execution_props = ExecutionProps::default(); |
| 176 | let null_column = Column::from_name(DUMMY_COL_NAME); |
| 177 | |
| 178 | let join_cols_to_replace = null_columns |
| 179 | .into_iter() |
| 180 | .map(|column| (column, &null_column)) |
| 181 | .collect::<HashMap<_, _>>(); |
| 182 | |
| 183 | let replaced_predicate = replace_col(predicate, &join_cols_to_replace)?; |
| 184 | let coerced_predicate = coerce(replaced_predicate, &input_schema)?; |
| 185 | create_physical_expr(&coerced_predicate, &input_schema, &execution_props)? |
| 186 | .evaluate(&input_batch) |
| 187 | } |
| 188 | |
| 189 | fn coerce(expr: Expr, schema: &DFSchema) -> Result<Expr> { |
| 190 | let mut expr_rewrite = TypeCoercionRewriter { schema }; |
no test coverage detected
searching dependent graphs…