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

Function test_join_metadata

datafusion/expr/src/logical_plan/builder.rs:2891–2915  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2889
2890 #[test]
2891 fn test_join_metadata() -> Result<()> {
2892 let left_schema = DFSchema::new_with_metadata(
2893 vec![(None, Arc::new(Field::new("a", DataType::Int32, false)))],
2894 HashMap::from([("key".to_string(), "left".to_string())]),
2895 )?;
2896 let right_schema = DFSchema::new_with_metadata(
2897 vec![(None, Arc::new(Field::new("b", DataType::Int32, false)))],
2898 HashMap::from([("key".to_string(), "right".to_string())]),
2899 )?;
2900
2901 let join_schema =
2902 build_join_schema(&left_schema, &right_schema, &JoinType::Left)?;
2903 assert_eq!(
2904 join_schema.metadata(),
2905 &HashMap::from([("key".to_string(), "left".to_string())])
2906 );
2907 let join_schema =
2908 build_join_schema(&left_schema, &right_schema, &JoinType::Right)?;
2909 assert_eq!(
2910 join_schema.metadata(),
2911 &HashMap::from([("key".to_string(), "right".to_string())])
2912 );
2913
2914 Ok(())
2915 }
2916
2917 #[test]
2918 fn test_values_metadata() -> Result<()> {

Callers

nothing calls this directly

Calls 2

build_join_schemaFunction · 0.70
to_stringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…