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

Function test_quoted_parameter_case_sensitive

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

Source from the content-addressed store, hash-verified

257
258 #[test]
259 fn test_quoted_parameter_case_sensitive() {
260 // Parameter names in function signature (lowercase)
261 let param_names = vec!["str".to_string(), "start_pos".to_string()];
262
263 // Quoted identifiers with wrong case should fail
264 let args = vec![lit("hello"), lit(1)];
265 let arg_names = vec![
266 Some(ArgumentName {
267 value: "STR".to_string(),
268 is_quoted: true,
269 }),
270 Some(ArgumentName {
271 value: "start_pos".to_string(),
272 is_quoted: true,
273 }),
274 ];
275
276 let result = resolve_function_arguments(&param_names, args, arg_names);
277 assert!(result.is_err());
278 assert!(
279 result
280 .unwrap_err()
281 .to_string()
282 .contains("Unknown parameter")
283 );
284
285 // Quoted identifiers with correct case should succeed
286 let args2 = vec![lit("hello"), lit(1)];
287 let arg_names2 = vec![
288 Some(ArgumentName {
289 value: "str".to_string(),
290 is_quoted: true,
291 }),
292 Some(ArgumentName {
293 value: "start_pos".to_string(),
294 is_quoted: true,
295 }),
296 ];
297
298 let result2 =
299 resolve_function_arguments(&param_names, args2, arg_names2).unwrap();
300 assert_eq!(result2.len(), 2);
301 assert_eq!(result2[0], lit("hello"));
302 assert_eq!(result2[1], lit(1));
303 }
304
305 #[test]
306 fn test_named_reordering() {

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…