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

Function test_named_reordering

datafusion/expr/src/arguments.rs:306–333  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

304
305 #[test]
306 fn test_named_reordering() {
307 let param_names = vec!["a".to_string(), "b".to_string(), "c".to_string()];
308
309 // Call with: func(c => 3.0, a => 1, b => "hello")
310 let args = vec![lit(3.0), lit(1), lit("hello")];
311 let arg_names = vec![
312 Some(ArgumentName {
313 value: "c".to_string(),
314 is_quoted: false,
315 }),
316 Some(ArgumentName {
317 value: "a".to_string(),
318 is_quoted: false,
319 }),
320 Some(ArgumentName {
321 value: "b".to_string(),
322 is_quoted: false,
323 }),
324 ];
325
326 let result = resolve_function_arguments(&param_names, args, arg_names).unwrap();
327
328 // Should be reordered to [a, b, c] = [1, "hello", 3.0]
329 assert_eq!(result.len(), 3);
330 assert_eq!(result[0], lit(1));
331 assert_eq!(result[1], lit("hello"));
332 assert_eq!(result[2], lit(3.0));
333 }
334
335 #[test]
336 fn test_mixed_positional_and_named() {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…