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

Function test_try_decimal_cast_in_range

datafusion/expr-common/src/casts.rs:599–617  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

597
598 #[test]
599 fn test_try_decimal_cast_in_range() {
600 expect_cast(
601 ScalarValue::Decimal128(Some(12300), 5, 2),
602 DataType::Decimal128(3, 0),
603 ExpectedCast::Value(ScalarValue::Decimal128(Some(123), 3, 0)),
604 );
605
606 expect_cast(
607 ScalarValue::Decimal128(Some(12300), 5, 2),
608 DataType::Decimal128(8, 0),
609 ExpectedCast::Value(ScalarValue::Decimal128(Some(123), 8, 0)),
610 );
611
612 expect_cast(
613 ScalarValue::Decimal128(Some(12300), 5, 2),
614 DataType::Decimal128(8, 5),
615 ExpectedCast::Value(ScalarValue::Decimal128(Some(12300000), 8, 5)),
616 );
617 }
618
619 #[test]
620 fn test_try_decimal_cast_out_of_range() {

Callers

nothing calls this directly

Calls 3

expect_castFunction · 0.85
Decimal128Class · 0.50
ValueEnum · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…