MCPcopy Create free account
hub / github.com/apache/datafusion / intermediate_schema

Method intermediate_schema

datafusion/core/tests/fuzz_cases/join_fuzz.rs:701–734  ·  view source on GitHub ↗

Helper function for building NLJoin filter, returning intermediate schema as a union of origin filter intermediate schema and on-condition schema

(&self)

Source from the content-addressed store, hash-verified

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

Callers 1

nested_loop_joinMethod · 0.80

Calls 7

newFunction · 0.85
join_filterMethod · 0.80
emptyFunction · 0.50
as_refMethod · 0.45
schemaMethod · 0.45
clonedMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected