| 639 | |
| 640 | template <TypeKind kind> |
| 641 | VectorPtr fuzzConstantPrimitiveImpl( |
| 642 | memory::MemoryPool* pool, |
| 643 | const TypePtr& type, |
| 644 | vector_size_t size, |
| 645 | FuzzerGenerator& rng, |
| 646 | const VectorFuzzer::Options& opts) { |
| 647 | using TCpp = typename TypeTraits<kind>::NativeType; |
| 648 | if constexpr (std::is_same_v<TCpp, StringView>) { |
| 649 | std::string buf; |
| 650 | auto stringView = randString( |
| 651 | rng, opts, buf, opts.enableStringIncrementalGeneration, "", 0); |
| 652 | |
| 653 | return std::make_shared<ConstantVector<TCpp>>( |
| 654 | pool, size, false, type, std::move(stringView)); |
| 655 | } |
| 656 | if constexpr (std::is_same_v<TCpp, Timestamp>) { |
| 657 | return std::make_shared<ConstantVector<TCpp>>( |
| 658 | pool, size, false, type, randTimestamp(rng, opts)); |
| 659 | } else if (type->isShortDecimal()) { |
| 660 | return std::make_shared<ConstantVector<int64_t>>( |
| 661 | pool, size, false, type, randDecimal<int64_t>(type, rng, true, false)); |
| 662 | } else if (type->isLongDecimal()) { |
| 663 | return std::make_shared<ConstantVector<int128_t>>( |
| 664 | pool, size, false, type, randDecimal<int128_t>(type, rng, false, true)); |
| 665 | } else { |
| 666 | return std::make_shared<ConstantVector<TCpp>>( |
| 667 | pool, size, false, type, rand<TCpp>(rng)); |
| 668 | } |
| 669 | } |
| 670 | |
| 671 | template <TypeKind kind> |
| 672 | void fuzzFlatPrimitiveImpl( |
nothing calls this directly
no test coverage detected