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

Function test_make_time

datafusion/functions/src/datetime/make_time.rs:240–267  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

238
239 #[test]
240 fn test_make_time() {
241 let hours = Arc::new((4..8).map(Some).collect::<Int32Array>());
242 let minutes = Arc::new((1..5).map(Some).collect::<Int32Array>());
243 let seconds = Arc::new((11..15).map(Some).collect::<Int32Array>());
244 let batch_len = hours.len();
245 let res = invoke_make_time_with_args(
246 vec![
247 ColumnarValue::Array(hours),
248 ColumnarValue::Array(minutes),
249 ColumnarValue::Array(seconds),
250 ],
251 batch_len,
252 )
253 .unwrap();
254
255 if let ColumnarValue::Array(array) = res {
256 assert_eq!(array.len(), 4);
257
258 let mut builder = Time32SecondArray::builder(4);
259 builder.append_value(14_471);
260 builder.append_value(18_132);
261 builder.append_value(21_793);
262 builder.append_value(25_454);
263 assert_eq!(&builder.finish() as &dyn Array, array.as_ref());
264 } else {
265 panic!("Expected a columnar array")
266 }
267 }
268}

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
mapMethod · 0.45
lenMethod · 0.45
append_valueMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…