MCPcopy Create free account
hub / github.com/apache/datafusion / interesting_cases

Method interesting_cases

test-utils/src/string_gen.rs:61–84  ·  view source on GitHub ↗

Return a set of `BatchGenerator`s that cover a range of interesting cases

()

Source from the content-addressed store, hash-verified

59 /// Return a set of `BatchGenerator`s that cover a range of interesting
60 /// cases
61 pub fn interesting_cases() -> Vec<Self> {
62 let mut cases = vec![];
63 let mut rng = rng();
64 for null_pct in [0.0, 0.01, 0.1, 0.5] {
65 for _ in 0..10 {
66 // max length of generated strings
67 let max_len = rng.random_range(1..50);
68 let num_strings = rng.random_range(1..100);
69 let num_distinct_strings = if num_strings > 1 {
70 rng.random_range(1..num_strings)
71 } else {
72 num_strings
73 };
74 cases.push(StringBatchGenerator(StringArrayGenerator {
75 max_len,
76 num_strings,
77 num_distinct_strings,
78 null_pct,
79 rng: StdRng::from_seed(rng.random()),
80 }))
81 }
82 }
83 cases
84 }
85}

Callers

nothing calls this directly

Calls 2

pushMethod · 0.45

Tested by

no test coverage detected