Skip to content

Commit 741f907

Browse files
committed
fix cast for ZSTD
Signed-off-by: Andrew Duffy <[email protected]>
1 parent 6afc7c7 commit 741f907

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

encodings/zstd/src/compute/cast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use crate::{ZstdArray, ZstdVTable};
1010

1111
impl CastKernel for ZstdVTable {
1212
fn cast(&self, array: &ZstdArray, dtype: &DType) -> VortexResult<Option<ArrayRef>> {
13-
if !dtype.is_nullable() || !array.all_valid() {
14-
// We cannot cast to non-nullable since the validity containing nulls is used to decode
15-
// the ZSTD array, this would require rewriting tables.
13+
if !dtype.is_nullable() && !array.all_valid() {
14+
// If there are nulls, then the cast is not trivial and requires decoding
15+
// to rewrite the tables.
1616
return Ok(None);
1717
}
1818
// ZstdArray is a general-purpose compression encoding using Zstandard compression.

0 commit comments

Comments
 (0)