Skip to content

Commit 858b2c1

Browse files
Remove and replace IsComplexType wiht is_nested
1 parent fed23f3 commit 858b2c1

File tree

1 file changed

+2
-14
lines changed
  • cpp/src/arrow/flight/sql/odbc/odbc_impl

1 file changed

+2
-14
lines changed

cpp/src/arrow/flight/sql/odbc/odbc_impl/util.cc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "arrow/compute/api.h"
2727
#include "arrow/type.h"
2828
#include "arrow/type_fwd.h"
29+
#include "arrow/type_traits.h"
2930

3031
#include "arrow/flight/sql/odbc/odbc_impl/json_converter.h"
3132

@@ -37,19 +38,6 @@
3738
namespace arrow::flight::sql::odbc {
3839
namespace util {
3940
namespace {
40-
bool IsComplexType(Type::type type_id) {
41-
switch (type_id) {
42-
case Type::LIST:
43-
case Type::LARGE_LIST:
44-
case Type::FIXED_SIZE_LIST:
45-
case Type::MAP:
46-
case Type::STRUCT:
47-
return true;
48-
default:
49-
return false;
50-
}
51-
}
52-
5341
SqlDataType GetDefaultSqlCharType(bool use_wide_char) {
5442
return use_wide_char ? SqlDataType_WCHAR : SqlDataType_CHAR;
5543
}
@@ -998,7 +986,7 @@ ArrayConvertTask GetConverter(Type::type original_type_id, CDataType target_type
998986

999987
return finish.ValueOrDie();
1000988
};
1001-
} else if (IsComplexType(original_type_id) &&
989+
} else if (is_nested(original_type_id) &&
1002990
(target_type == CDataType_CHAR || target_type == CDataType_WCHAR)) {
1003991
return [=](const std::shared_ptr<Array>& original_array) {
1004992
const auto& json_conversion_result = ConvertToJson(original_array);

0 commit comments

Comments
 (0)