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

Function GetUnitFromString

cpp/src/arrow/integration/json_internal.cc:869–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

867};
868
869Result<TimeUnit::type> GetUnitFromString(const std::string& unit_str) {
870 if (unit_str == "SECOND") {
871 return TimeUnit::SECOND;
872 } else if (unit_str == "MILLISECOND") {
873 return TimeUnit::MILLI;
874 } else if (unit_str == "MICROSECOND") {
875 return TimeUnit::MICRO;
876 } else if (unit_str == "NANOSECOND") {
877 return TimeUnit::NANO;
878 } else {
879 return Status::Invalid("Invalid time unit: ", unit_str);
880 }
881}
882
883template <typename IntType = int>
884Result<IntType> GetMemberInt(const RjObject& obj, const std::string& key) {

Callers 1

GetMemberTimeUnitFunction · 0.85

Calls 1

InvalidFunction · 0.50

Tested by

no test coverage detected