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

Function GetUnitFromString

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

Source from the content-addressed store, hash-verified

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