MCPcopy Create free account
hub / github.com/apache/arrow / GetTime32Cast

Function GetTime32Cast

cpp/src/arrow/compute/kernels/scalar_cast_temporal.cc:593–612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

591}
592
593std::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
614std::shared_ptr<CastFunction> GetTime64Cast() {
615 auto func = std::make_shared<CastFunction>("cast_time64", Type::TIME64);

Callers 1

GetTemporalCastsFunction · 0.85

Calls 4

AddCommonCastsFunction · 0.85
AddZeroCopyCastFunction · 0.85
InputTypeFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected