MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / mask_nulls

Function mask_nulls

src/repr/src/row/encode.rs:1291–1306  ·  view source on GitHub ↗

Merge the provided null buffer with the existing array's null buffer, if any.

(column: &ArrayRef, null_mask: Option<&NullBuffer>)

Source from the content-addressed store, hash-verified

1289
1290/// Merge the provided null buffer with the existing array's null buffer, if any.
1291fn mask_nulls(column: &ArrayRef, null_mask: Option<&NullBuffer>) -> ArrayRef {
1292 if null_mask.is_none() {
1293 Arc::clone(column)
1294 } else {
1295 // We calculate stats on the nested arrays, so make sure we don't count entries
1296 // that are masked off at a higher level.
1297 let nulls = NullBuffer::union(null_mask, column.nulls());
1298 let data = column
1299 .to_data()
1300 .into_builder()
1301 .nulls(nulls)
1302 .build()
1303 .expect("changed only null mask");
1304 make_array(data)
1305 }
1306}
1307
1308impl RowColumnarDecoder {
1309 /// Creates a [`RowColumnarDecoder`] that decodes from the provided [`StructArray`].

Callers 2

newMethod · 0.70
array_to_decoderFunction · 0.70

Calls 4

cloneFunction · 0.85
is_noneMethod · 0.80
expectMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected