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

Function i64string_batch

datafusion/core/tests/fuzz_cases/limit_fuzz.rs:271–281  ·  view source on GitHub ↗

Create a record batch with i64 column "x" and utf8 column "y"

(
    values: impl IntoIterator<Item = &'a (Option<i64>, Option<String>)> + Clone,
)

Source from the content-addressed store, hash-verified

269
270/// Create a record batch with i64 column "x" and utf8 column "y"
271fn i64string_batch<'a>(
272 values: impl IntoIterator<Item = &'a (Option<i64>, Option<String>)> + Clone,
273) -> RecordBatch {
274 let ints = values.clone().into_iter().map(|(i, _)| *i);
275 let strings = values.into_iter().map(|(_, s)| s);
276 RecordBatch::try_from_iter(vec![
277 ("x", Arc::new(Int64Array::from_iter(ints)) as _),
278 ("y", Arc::new(StringArray::from_iter(strings)) as _),
279 ])
280 .unwrap()
281}
282
283/// Run the TopK test, sorting the input batches with the specified fetch
284/// (limit) and compares the results to the expected values.

Callers 2

new_i64strMethod · 0.85
topk_valuesMethod · 0.85

Calls 3

mapMethod · 0.45
into_iterMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…