will-lauer commented on issue #145: URL: https://github.com/apache/datasketches-bigquery/issues/145#issuecomment-2729685815
For completeness for aggregates, I think there is one other case you want to define: no rows aggregated. So, I think the cases are Input | Treatment ------ | ----------- No rows to aggregate | NULL (This appears to be standard SQL semantics) Only NULL rows to aggregate | NULL (This appears to be standard SQL semantics) Some NULL, some valid sketches | Skip the nulls and aggregate the rest All valid, non-null sketches | aggregate everything At least 1 Invalid (error) sketch | error I haven't found a clear definition for what should happen in SQL with single row (scalar) functions that receive NULL arguments. I _think_ standard behavior is that if any argument is NULL, the result should be NULL, but I think that's probably not what we want for some of our functions. For the theta functions, I think we want something like this: Function | Arguments | Treatment ---------- | ------------ | ----------- Set functions (union, intersection, a Not B) | All arguments NULL | NULL Set functions | Some arguments NULL | Treat NULLs as empty, so `A ∪ NULL ∪ C` is the same as `A ∪ C` and `A ∩ NULL ∩ C` is the same as `A ∩ Empty ∩ C`, which results in the empty set Set functions | All non-null arguments | Normal treatment Status functions (getEstimate, num retained, etc) | All arguments NULL | NULL Status functions | Some arguments NULL | NULL (I think there is a special case here, where the `seed` or `lgk` argument is null. Those _may_ deserve special handling, such that NULL causes an error) Status functions | ALl non-null arguments | Normal treatment -- 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: dev-unsubscr...@datasketches.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@datasketches.apache.org For additional commands, e-mail: dev-h...@datasketches.apache.org