| 591 | } |
| 592 | |
| 593 | std::shared_ptr<CastFunction> GetTime32Cast() { |
| 594 | auto func = std::make_shared<CastFunction>("cast_time32", Type::TIME32); |
| 595 | AddCommonCasts(Type::TIME32, kOutputTargetType, func.get()); |
| 596 | |
| 597 | // Zero copy when the unit is the same or same integer representation |
| 598 | AddZeroCopyCast(Type::INT32, /*in_type=*/int32(), kOutputTargetType, func.get()); |
| 599 | |
| 600 | // time64 -> time32 |
| 601 | AddSimpleCast<Time64Type, Time32Type>(InputType(Type::TIME64), kOutputTargetType, |
| 602 | func.get()); |
| 603 | |
| 604 | // time32 -> time32 |
| 605 | AddCrossUnitCast<Time32Type>(func.get()); |
| 606 | |
| 607 | // timestamp -> time32 |
| 608 | AddSimpleCast<TimestampType, Time32Type>(InputType(Type::TIMESTAMP), kOutputTargetType, |
| 609 | func.get()); |
| 610 | |
| 611 | return func; |
| 612 | } |
| 613 | |
| 614 | std::shared_ptr<CastFunction> GetTime64Cast() { |
| 615 | auto func = std::make_shared<CastFunction>("cast_time64", Type::TIME64); |
no test coverage detected