From 075852dc51f89b51664227a72666f3fc59f46314 Mon Sep 17 00:00:00 2001 From: Matthew Nibecker Date: Thu, 27 Aug 2026 14:47:24 -0700 Subject: [PATCH] DeoptionWithMissing: handle fusion none values --- runtime/ztests/expr/dot.yaml | 2 ++ vector/union.go | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/runtime/ztests/expr/dot.yaml b/runtime/ztests/expr/dot.yaml index bf125ec47..e8e1fbb73 100644 --- a/runtime/ztests/expr/dot.yaml +++ b/runtime/ztests/expr/dot.yaml @@ -7,6 +7,7 @@ input: | {a:{b:1}}::(int64|{a:{b:int64}}) {a:fusion({b:1}::(null|{b:int64}),<{b:int64}>)} {a:fusion(null::(null|{b:int64}),)} + {a:fusion({b:fusion(_::(int64|string|none) ,)},<{}>)} {a:1} {} null @@ -21,6 +22,7 @@ output: | error("missing") error("missing") error("missing") + error("missing") --- diff --git a/vector/union.go b/vector/union.go index 6240cbc4b..5b37d9d05 100644 --- a/vector/union.go +++ b/vector/union.go @@ -295,7 +295,7 @@ func noneLength(runlens []uint32) uint32 { } func DeoptionWithMissing(sctx *super.Context, vec Any) Any { - switch vec := vec.(type) { + switch vec := Super(vec).(type) { case *None: return NewMissing(sctx, vec.Len()) case *Dynamic: @@ -347,7 +347,11 @@ func hasOptionTypesOrNones(vecs []Any) bool { if vec, ok := vec.(*Dynamic); ok { return hasOptionTypesOrNones(vec.Values) } - return super.IsOptionType(vec.Type()) || vec.Type() == super.TypeNone + typ := vec.Type() + if fusion, ok := typ.(*super.TypeFusion); ok { + typ = fusion.Type + } + return super.IsOptionType(typ) || typ == super.TypeNone }) >= 0 }