Jackie-Jiang opened a new pull request, #19981:
URL: https://github.com/apache/pinot/pull/19981

   ## Summary
   The array scalar functions that combine inputs return `NULL` as soon as any 
argument is `NULL`. This adds `*IgnoreNulls` variants that skip a `NULL` 
argument instead:
   - `arrayUnionIntIgnoreNulls`, `arrayUnionStringIgnoreNulls`
   - `arrayConcat{Int,Long,Float,Double,String}IgnoreNulls`
   - `arrayPushBack{Int,Long,Float,Double,String}IgnoreNulls`
   - `arrayPushFront{Int,Long,Float,Double,String}IgnoreNulls`
   
   Semantics (SQL names follow the usual snake case, e.g. 
`array_concat_int_ignore_nulls`):
   - A `NULL` array is ignored: `arrayConcatIntIgnoreNulls(a, NULL)` returns 
`a`, and `arrayUnionIntIgnoreNulls(a, NULL)` returns the distinct values of `a`.
   - A `NULL` element is not added: `arrayPushBackIntIgnoreNulls(a, NULL)` 
returns `a`, and `arrayPushBackIntIgnoreNulls(NULL, 7)` returns `[7]`.
   - The result is `NULL` only when every input is `NULL`, matching PostgreSQL 
`array_cat`.
   
   The functions are declared with `nullableParameters = true` and annotated 
`@Nullable`, so the multi-stage engine infers a nullable return type.
   
   ## Limitations
   The single-stage engine does not honor `nullableParameters` today: with null 
handling enabled, `ScalarTransformFunctionWrapper` passes default values for 
null rows and marks the result null whenever any argument is null (its 
null-aware path was removed in #11008). In that mode these functions behave 
like the existing ones; this will be addressed in a separate PR. They work as 
described in the multi-stage engine and in ingestion transforms.
   
   `all-functions.yaml` is updated by hand, since `UdfTest`, which generates 
and checks it, is currently excluded from CI.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to