| 352 | } |
| 353 | |
| 354 | Status MakeRandomStringArray(int64_t length, bool include_nulls, MemoryPool* pool, |
| 355 | std::shared_ptr<Array>* out) { |
| 356 | const std::vector<std::string> values = {"", "", "abc", "123", |
| 357 | "efg", "456!@#!@#", "12312"}; |
| 358 | StringBuilder builder(pool); |
| 359 | const size_t values_len = values.size(); |
| 360 | for (int64_t i = 0; i < length; ++i) { |
| 361 | int64_t values_index = i % values_len; |
| 362 | if (include_nulls && values_index == 0) { |
| 363 | RETURN_NOT_OK(builder.AppendNull()); |
| 364 | } else { |
| 365 | const auto& value = values[values_index]; |
| 366 | RETURN_NOT_OK(builder.Append(value)); |
| 367 | } |
| 368 | } |
| 369 | return builder.Finish(out); |
| 370 | } |
| 371 | |
| 372 | template <std::derived_from<ArrayBuilder> BuilderType> |
| 373 | static Result<std::shared_ptr<Array>> MakeBinaryArrayWithUniqueValues( |
no test coverage detected