| 371 | |
| 372 | template <std::derived_from<ArrayBuilder> BuilderType> |
| 373 | static Result<std::shared_ptr<Array>> MakeBinaryArrayWithUniqueValues( |
| 374 | BuilderType builder, int64_t length, bool include_nulls) { |
| 375 | if constexpr (std::is_base_of_v<BinaryViewBuilder, BuilderType>) { |
| 376 | // Try to emit several variadic buffers by choosing a small block size. |
| 377 | builder.SetBlockSize(512); |
| 378 | } |
| 379 | for (int64_t i = 0; i < length; ++i) { |
| 380 | if (include_nulls && (i % 7 == 0)) { |
| 381 | RETURN_NOT_OK(builder.AppendNull()); |
| 382 | } else { |
| 383 | // Make sure that some strings are long enough to have non-inline binary views |
| 384 | const auto base = std::to_string(i); |
| 385 | std::string value; |
| 386 | for (int64_t j = 0; j < 3 * (i % 10); ++j) { |
| 387 | value += base; |
| 388 | } |
| 389 | RETURN_NOT_OK(builder.Append(value)); |
| 390 | } |
| 391 | } |
| 392 | return builder.Finish(); |
| 393 | } |
| 394 | |
| 395 | Status MakeStringTypesRecordBatch(std::shared_ptr<RecordBatch>* out, bool with_nulls, |
| 396 | bool with_view_types) { |
nothing calls this directly
no test coverage detected