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

Function values_stats_with_nulls_only

datafusion/datasource/src/memory.rs:976–1004  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

974
975 #[test]
976 fn values_stats_with_nulls_only() -> Result<()> {
977 let data = vec![
978 vec![lit(ScalarValue::Null)],
979 vec![lit(ScalarValue::Null)],
980 vec![lit(ScalarValue::Null)],
981 ];
982 let rows = data.len();
983 let schema =
984 Arc::new(Schema::new(vec![Field::new("col0", DataType::Null, true)]));
985 let values = MemorySourceConfig::try_new_as_values(schema, data)?;
986
987 assert_eq!(
988 *values.partition_statistics(None)?,
989 Statistics {
990 num_rows: Precision::Exact(rows),
991 total_byte_size: Precision::Exact(8), // not important
992 column_statistics: vec![ColumnStatistics {
993 null_count: Precision::Exact(rows), // there are only nulls
994 distinct_count: Precision::Absent,
995 max_value: Precision::Absent,
996 min_value: Precision::Absent,
997 sum_value: Precision::Absent,
998 byte_size: Precision::Absent,
999 },],
1000 }
1001 );
1002
1003 Ok(())
1004 }
1005
1006 fn batch(row_size: usize) -> RecordBatch {
1007 let a: ArrayRef = Arc::new(Int32Array::from(vec![1; row_size]));

Callers

nothing calls this directly

Calls 2

newFunction · 0.85
lenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…