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

Function preserve_cast

datafusion/expr/src/expr_rewriter/order_by.rs:457–482  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

455
456 #[test]
457 fn preserve_cast() {
458 let plan = make_input()
459 .project(vec![col("c2").alias("c2")])
460 .unwrap()
461 .project(vec![col("c2").alias("c2")])
462 .unwrap()
463 .build()
464 .unwrap();
465
466 let cases = vec![
467 TestCase {
468 desc: "Cast is preserved by rewrite_sort_cols_by_aggs",
469 input: sort(cast(col("c2"), DataType::Int64)),
470 expected: sort(cast(col("c2"), DataType::Int64)),
471 },
472 TestCase {
473 desc: "TryCast is preserved by rewrite_sort_cols_by_aggs",
474 input: sort(try_cast(col("c2"), DataType::Int64)),
475 expected: sort(try_cast(col("c2"), DataType::Int64)),
476 },
477 ];
478
479 for case in cases {
480 case.run(&plan)
481 }
482 }
483
484 struct TestCase {
485 desc: &'static str,

Callers

nothing calls this directly

Calls 4

make_inputFunction · 0.85
buildMethod · 0.45
projectMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…