Helper function for building NLJoin filter, returning intermediate schema as a union of origin filter intermediate schema and on-condition schema
(&self)
| 699 | /// schema as a union of origin filter intermediate schema and |
| 700 | /// on-condition schema |
| 701 | fn intermediate_schema(&self) -> Schema { |
| 702 | let filter_schema = if let Some(filter) = self.join_filter() { |
| 703 | filter.schema().as_ref().to_owned() |
| 704 | } else { |
| 705 | Schema::empty() |
| 706 | }; |
| 707 | |
| 708 | let schema1 = self.input1[0].schema(); |
| 709 | let schema2 = self.input2[0].schema(); |
| 710 | |
| 711 | let on_schema = Schema::new(vec![ |
| 712 | schema1 |
| 713 | .field_with_name("a") |
| 714 | .unwrap() |
| 715 | .to_owned() |
| 716 | .with_nullable(true), |
| 717 | schema1 |
| 718 | .field_with_name("b") |
| 719 | .unwrap() |
| 720 | .to_owned() |
| 721 | .with_nullable(true), |
| 722 | schema2.field_with_name("a").unwrap().to_owned(), |
| 723 | schema2.field_with_name("b").unwrap().to_owned(), |
| 724 | ]); |
| 725 | |
| 726 | Schema::new( |
| 727 | filter_schema |
| 728 | .fields |
| 729 | .into_iter() |
| 730 | .cloned() |
| 731 | .chain(on_schema.fields.into_iter().cloned()) |
| 732 | .collect_vec(), |
| 733 | ) |
| 734 | } |
| 735 | |
| 736 | /// Helper function for building NLJoin filter, returns the union |
| 737 | /// of original filter expression and on-condition expression |
no test coverage detected