in analytical_engine/core/object/fragment_wrapper.h [156:226]
gs::rpc::graph::DataTypePb PropertyTypeToPb(const std::string& type) {
if (type == "bool") {
return gs::rpc::graph::DataTypePb::BOOL;
} else if (type == "short" || type == "int16" || type == "int16_t") {
return gs::rpc::graph::DataTypePb::SHORT;
} else if (type == "int" || type == "int32" || type == "int32_t") {
return gs::rpc::graph::DataTypePb::INT;
} else if (type == "long" || type == "int64" || type == "int64_t") {
return gs::rpc::graph::DataTypePb::LONG;
} else if (type == "uint" || type == "uint32" || type == "uint32_t") {
return gs::rpc::graph::DataTypePb::UINT;
} else if (type == "ulong" || type == "uint64" || type == "uint64_t") {
return gs::rpc::graph::DataTypePb::ULONG;
} else if (type == "float") {
return gs::rpc::graph::DataTypePb::FLOAT;
} else if (type == "double") {
return gs::rpc::graph::DataTypePb::DOUBLE;
} else if (type == "bytes") {
return gs::rpc::graph::DataTypePb::BYTES;
} else if (type == "string" || type == "std::string" || type == "str") {
return gs::rpc::graph::DataTypePb::STRING;
} else if (type == "int_list") {
return gs::rpc::graph::DataTypePb::INT_LIST;
} else if (type == "long_list") {
return gs::rpc::graph::DataTypePb::LONG_LIST;
} else if (type == "float_list") {
return gs::rpc::graph::DataTypePb::FLOAT_LIST;
} else if (type == "date32[day]") {
return gs::rpc::graph::DataTypePb::DATE32;
} else if (type == "date64[ms]") {
return gs::rpc::graph::DataTypePb::DATE64;
} else if (type == "time32[s]") {
return gs::rpc::graph::DataTypePb::TIME32_S;
} else if (type == "time32[ms]") {
return gs::rpc::graph::DataTypePb::TIME32_MS;
} else if (type == "time32[us]") {
return gs::rpc::graph::DataTypePb::TIME32_US;
} else if (type == "time32[ns]") {
return gs::rpc::graph::DataTypePb::TIME32_NS;
} else if (type == "time64[s]") {
return gs::rpc::graph::DataTypePb::TIME64_S;
} else if (type == "time64[ms]") {
return gs::rpc::graph::DataTypePb::TIME64_MS;
} else if (type == "time64[us]") {
return gs::rpc::graph::DataTypePb::TIME64_US;
} else if (type == "time64[ns]") {
return gs::rpc::graph::DataTypePb::TIME64_NS;
} else if (type.substr(0, std::string("timestamp[s]").length()) ==
"timestamp[s]") {
return gs::rpc::graph::DataTypePb::TIMESTAMP_S;
} else if (type.substr(0, std::string("timestamp[ms]").length()) ==
"timestamp[ms]") {
return gs::rpc::graph::DataTypePb::TIMESTAMP_MS;
} else if (type.substr(0, std::string("timestamp[us]").length()) ==
"timestamp[us]") {
return gs::rpc::graph::DataTypePb::TIMESTAMP_US;
} else if (type.substr(0, std::string("timestamp[ns]").length()) ==
"timestamp[ns]") {
return gs::rpc::graph::DataTypePb::TIMESTAMP_NS;
} else if (type == "double_list") {
return gs::rpc::graph::DataTypePb::DOUBLE_LIST;
} else if (type == "string_list" || type == "str_list") {
return gs::rpc::graph::DataTypePb::STRING_LIST;
} else if (type == "grape::EmptyType" || type == "null") {
return gs::rpc::graph::DataTypePb::NULLVALUE;
} else if (type == "dynamic::Value") {
return gs::rpc::graph::DataTypePb::DYNAMIC;
}
LOG(ERROR) << "Unsupported type " << type;
return gs::rpc::graph::DataTypePb::UNKNOWN;
}