scalar values (numbers and strings) are parsed into a dictionary . This can be decoded for ease of comparison
| 223 | // scalar values (numbers and strings) are parsed into a |
| 224 | // dictionary<index:int32, value:string>. This can be decoded for ease of comparison |
| 225 | inline static Status DecodeStringDictionary(const DictionaryArray& dict_array, |
| 226 | std::shared_ptr<Array>* decoded) { |
| 227 | const StringArray& dict = checked_cast<const StringArray&>(*dict_array.dictionary()); |
| 228 | const Int32Array& indices = checked_cast<const Int32Array&>(*dict_array.indices()); |
| 229 | StringBuilder builder; |
| 230 | RETURN_NOT_OK(builder.Resize(indices.length())); |
| 231 | for (int64_t i = 0; i < indices.length(); ++i) { |
| 232 | if (indices.IsNull(i)) { |
| 233 | builder.UnsafeAppendNull(); |
| 234 | continue; |
| 235 | } |
| 236 | auto value = dict.GetView(indices.GetView(i)); |
| 237 | RETURN_NOT_OK(builder.ReserveData(value.size())); |
| 238 | builder.UnsafeAppend(value); |
| 239 | } |
| 240 | return builder.Finish(decoded); |
| 241 | } |
| 242 | |
| 243 | inline static Status ParseFromString(ParseOptions options, string_view src_str, |
| 244 | std::shared_ptr<Array>* parsed) { |
no test coverage detected