Skip to content

Commit d6ca3e2

Browse files
drabastomeklidavidm
authored andcommitted
ARROW-16408: [C++] Add support for DATE type in SQLite FlightSQL example
While it works in the integration tests, some SQLite databases have been created (erroneously) with `DATE` data type (instead of `TEXT`). This minor fix handle this edge case. Closes apache#13027 from drabastomek/flight-sqlite-example Authored-by: Tom Drabas <drabas.t@gmail.com> Signed-off-by: David Li <li.davidm96@gmail.com>
1 parent c8339b7 commit d6ca3e2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

cpp/src/arrow/flight/sql/example/sqlite_server.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ std::shared_ptr<DataType> GetArrowType(const char* sqlite_type) {
206206
return float64();
207207
} else if (boost::iequals(sqlite_type, "BLOB")) {
208208
return binary();
209-
} else if (boost::iequals(sqlite_type, "TEXT") ||
209+
} else if (boost::iequals(sqlite_type, "TEXT") || boost::iequals(sqlite_type, "DATE") ||
210210
boost::istarts_with(sqlite_type, "char") ||
211211
boost::istarts_with(sqlite_type, "varchar")) {
212212
return utf8();
@@ -227,7 +227,7 @@ int32_t GetSqlTypeFromTypeName(const char* sqlite_type) {
227227
return SQLITE_FLOAT;
228228
} else if (boost::iequals(sqlite_type, "BLOB")) {
229229
return SQLITE_BLOB;
230-
} else if (boost::iequals(sqlite_type, "TEXT") ||
230+
} else if (boost::iequals(sqlite_type, "TEXT") || boost::iequals(sqlite_type, "DATE") ||
231231
boost::istarts_with(sqlite_type, "char") ||
232232
boost::istarts_with(sqlite_type, "varchar")) {
233233
return SQLITE_TEXT;

0 commit comments

Comments
 (0)