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

Function GetArrowType

cpp/src/arrow/flight/sql/example/sqlite_server.cc:171–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169} // namespace
170
171arrow::Result<std::shared_ptr<DataType>> GetArrowType(const char* sqlite_type) {
172 if (sqlite_type == nullptr || std::strlen(sqlite_type) == 0) {
173 // SQLite may not know the column type yet.
174 return null();
175 }
176
177 if (boost::iequals(sqlite_type, "int") || boost::iequals(sqlite_type, "integer")) {
178 return int64();
179 } else if (boost::iequals(sqlite_type, "REAL")) {
180 return float64();
181 } else if (boost::iequals(sqlite_type, "BLOB")) {
182 return binary();
183 } else if (boost::iequals(sqlite_type, "TEXT") || boost::iequals(sqlite_type, "DATE") ||
184 boost::istarts_with(sqlite_type, "char") ||
185 boost::istarts_with(sqlite_type, "varchar")) {
186 return utf8();
187 }
188 return Status::Invalid("Invalid SQLite type: ", sqlite_type);
189}
190
191int32_t GetSqlTypeFromTypeName(const char* sqlite_type) {
192 if (sqlite_type == NULLPTR) {

Callers 2

GetSchemaMethod · 0.70
ReadNextMethod · 0.70

Calls 1

InvalidFunction · 0.50

Tested by

no test coverage detected