MCPcopy Create free account
hub / github.com/apache/arrow / GeneratePhoneNumber

Function GeneratePhoneNumber

cpp/src/arrow/acero/tpch_node.cc:617–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615}
616
617void GeneratePhoneNumber(char* out, random::pcg32_fast& rng, int32_t country) {
618 std::uniform_int_distribution<int32_t> three_digit(100, 999);
619 std::uniform_int_distribution<int32_t> four_digit(1000, 9999);
620
621 int32_t country_code = country + 10;
622 int32_t l1 = three_digit(rng);
623 int32_t l2 = three_digit(rng);
624 int32_t l3 = four_digit(rng);
625
626 out += 15;
627 arrow::internal::detail::FormatAllDigits(l3, &out);
628 *(--out) = '-';
629 arrow::internal::detail::FormatAllDigits(l2, &out);
630 *(--out) = '-';
631 arrow::internal::detail::FormatAllDigits(l1, &out);
632 *(--out) = '-';
633 arrow::internal::detail::FormatTwoDigits(country_code, &out);
634}
635
636using GenerateColumnFn = std::function<Status(size_t)>;
637class PartAndPartSupplierGenerator {

Callers 2

S_PHONEMethod · 0.85
C_PHONEMethod · 0.85

Calls 2

FormatAllDigitsFunction · 0.85
FormatTwoDigitsFunction · 0.85

Tested by

no test coverage detected