Repository navigation
change pipe-level none handling, empty subquery, and add has() - #7635
Conversation
This commit changes none handling at the output of relevant pipe operators to drop singleton nones. If a none is created, the query writer knows what they are doing, and if they didn't want to drop it, they should use ??. We also changed the behavior of pipe expression subqueries to return none instead of null for empty result. SQL subqueries still return null. In agg output, none values are dropped. For single column output with a none column, the output is a singleton none, which must be handled by the query or it fails type check. To implement this, we needed an expression that could check the existence of a field so we brought back the has() function with new semantics.
There was a problem hiding this comment.
We are just return the inner type here but in reality this should doing what the runtime is doing: Filtering plain nones from the type and returning that.
Also (not having to do with this pr but generally) should probably have a TypeSet check here as well.
There was a problem hiding this comment.
unnest now drops plain none from the element type, and sets are supported.
| func isPlainNone(typ super.Type) bool { | ||
| return defuse(typ) == super.TypeNone | ||
| } |
There was a problem hiding this comment.
You've already got isNoneType you could/should use that instead of adding this.
There was a problem hiding this comment.
isNoneType now means plain none (it was unwrapping named types, which also fixed a bug with named-none fields); removed isPlainNone.
| if isNoneVec(vec) { | ||
| return allSlots(vec.Len()) | ||
| } |
There was a problem hiding this comment.
We probably don't want to allocate n of uint32 for a batch that is entirely none right? Maybe just return a bool/skip in this case?
There was a problem hiding this comment.
plainNoneSlots now returns “all none” without allocating.
This commit changes none handling at the output of relevant pipe operators to drop singleton nones. If a none is created, the query writer knows what they are doing, and if they didn't want to drop it, they should use ??. We also changed the behavior of pipe expression subqueries to return none instead of null for empty result. SQL subqueries still return null.
In agg output, none values are dropped. For single column output with a none column, the output is a singleton none, which must be handled by the query or it fails type check. To implement this, we needed an expression that could check the existence of a field so we brought back the has() function with new semantics.
Closes #7599