Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ version; patch releases remain backward compatible.

## Unreleased

- Fix `encode_block` rejecting `SimpleAggregateFunction(f, Nullable(T))` inside
Array, Tuple, Map, Nested, and Variant with a mismatched-column error. Alias
chains below Nullable now encode and decode in any position. Type headers and
nullability checks are unchanged.
- ZSTD compression frames (method byte 0x90) now decode. Before, they returned
`CompressionError::UnsupportedCodec`. A ZSTD frame that claims more output
than its payload can hold fails early with `InvalidUncompressedSize`. Real
Expand Down
20 changes: 6 additions & 14 deletions src/native/decode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1691,11 +1691,8 @@ fn decode_values(
None
};

// A geo alias legal directly inside `Nullable` is only `Nullable(Point)`
// (the array-based kinds and `Nested` are rejected by the parser); expand it
// to its `Tuple` so the Tuple arm below handles the body after the null map,
// the ordinary `Nullable(Tuple(...))` framing.
let delegate = inner.physical_delegate_ref();
// Resolve aliases below Nullable before dispatching the physical body.
let delegate = inner.resolved_physical_delegate_ref();
let inner = delegate.as_deref().unwrap_or(inner);

// Tuple is a container of element columns decoded as a unit (each element
Expand Down Expand Up @@ -4307,13 +4304,9 @@ fn is_resumable(ch_type: &ChType) -> bool {
}
}

/// Whether `Nullable(inner)` walks the same bytes in the task walker as in
/// [`skip_values`]. That walker unwraps the null map, expands at most ONE alias
/// level, then accepts only a Tuple or a leaf body; anything else (a nested
/// wrapper or container, a chained alias) is an `UnsupportedType` there, so it
/// must stay on that path here too rather than be silently accepted.
/// Whether the task walker supports the resolved physical body below Nullable.
fn is_resumable_nullable_inner(inner: &ChType) -> bool {
let delegate = inner.physical_delegate_ref();
let delegate = inner.resolved_physical_delegate_ref();
let inner = delegate.as_deref().unwrap_or(inner);
match inner {
ChType::Tuple(elements) => elements.iter().all(|(_, element)| is_resumable(element)),
Expand Down Expand Up @@ -5941,9 +5934,8 @@ fn skip_values(
other => other,
};

// Expand a geo alias legal directly inside `Nullable` (only `Nullable(Point)`
// -> `Tuple`), the scan-side mirror of `decode_values`.
let delegate = inner.physical_delegate_ref();
// Resolve aliases below Nullable, matching `decode_values`.
let delegate = inner.resolved_physical_delegate_ref();
let inner = delegate.as_deref().unwrap_or(inner);

// Tuple after the Nullable unwrap, mirroring `decode_values`: a
Expand Down
5 changes: 2 additions & 3 deletions src/native/encode/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -859,9 +859,8 @@ fn encode_column_values(
} else {
ch_type
};
// Expand a geo alias legal directly inside `Nullable` (only `Nullable(Point)`
// -> `Tuple`), so the Tuple arm below writes its body after the null map.
let delegate = value_type.physical_delegate_ref();
// Resolve aliases below Nullable before writing the value body.
let delegate = value_type.resolved_physical_delegate_ref();
let value_type = delegate.as_deref().unwrap_or(value_type);
// Tuple after the Nullable unwrap, mirroring the decode side: a
// `Nullable(Tuple(...))` writes its per-row null map above, then the tuple
Expand Down
Loading
Loading