Github user mktal commented on a diff in the pull request:

    https://github.com/apache/incubator-madlib/pull/22#discussion_r54284271
  
    --- Diff: methods/array_ops/src/pg_gp/array_ops.c ---
    @@ -702,8 +702,14 @@ array_sub(PG_FUNCTION_ARGS){
     PG_FUNCTION_INFO_V1(array_mult);
     Datum
     array_mult(PG_FUNCTION_ARGS){
    -    if (PG_ARGISNULL(0)) { PG_RETURN_NULL(); }
    -    if (PG_ARGISNULL(1)) { PG_RETURN_NULL(); }
    +    if (PG_ARGISNULL(0) && PG_ARGISNULL(1)) { PG_RETURN_NULL(); }
    --- End diff --
    
    This change is made so that array_mult can be used as SFUNC in UDA, e.g., 
madlib.prod() to make sure that the null state is initialized with the first 
tuple in the table. This is consistent with array_add that NULL + X = X


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to