BinaryArrayFromStrings: construct an Array of any binary-like type from string values, dispatching on the runtime type id
| 95 | // BinaryArrayFromStrings: construct an Array of any binary-like type from |
| 96 | // string values, dispatching on the runtime type id |
| 97 | inline std::shared_ptr<Array> BinaryArrayFromStrings( |
| 98 | const std::shared_ptr<DataType>& type, const std::vector<std::string>& values) { |
| 99 | std::shared_ptr<Array> array; |
| 100 | switch (type->id()) { |
| 101 | case Type::BINARY: |
| 102 | ArrayFromVector<BinaryType, std::string>(type, values, &array); |
| 103 | break; |
| 104 | case Type::STRING: |
| 105 | ArrayFromVector<StringType, std::string>(type, values, &array); |
| 106 | break; |
| 107 | case Type::LARGE_BINARY: |
| 108 | ArrayFromVector<LargeBinaryType, std::string>(type, values, &array); |
| 109 | break; |
| 110 | case Type::LARGE_STRING: |
| 111 | ArrayFromVector<LargeStringType, std::string>(type, values, &array); |
| 112 | break; |
| 113 | case Type::BINARY_VIEW: |
| 114 | ArrayFromVector<BinaryViewType, std::string>(type, values, &array); |
| 115 | break; |
| 116 | case Type::STRING_VIEW: |
| 117 | ArrayFromVector<StringViewType, std::string>(type, values, &array); |
| 118 | break; |
| 119 | case Type::FIXED_SIZE_BINARY: |
| 120 | ArrayFromVector<FixedSizeBinaryType, std::string>(type, values, &array); |
| 121 | break; |
| 122 | default: |
| 123 | ADD_FAILURE() << "unsupported type for binary test data: " << type->ToString(); |
| 124 | break; |
| 125 | } |
| 126 | return array; |
| 127 | } |
| 128 | |
| 129 | // ChunkedArrayFromVector: construct a ChunkedArray from vectors of C values |
| 130 |