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

    https://github.com/apache/incubator-madlib/pull/35#discussion_r58963175
  
    --- Diff: src/modules/convex/utils_regularization.cpp ---
    @@ -79,8 +79,13 @@ class ScalesState
     AnyType utils_var_scales_transition::run (AnyType& args)
     {
         ScalesState<MutableArrayHandle<double> > state = args[0];
    +    try {
    +        args[1].getAs<MappedColumnVector>();
    +    } catch(const ArrayWithNullException &e) {
    +      //  warning("Input array contains NULL values, skipping it for mean 
and std computations");
    +        return state;
    +    }
    --- End diff --
    
    A more efficient way is to declare an empty handle outside the try block 
and rebind the memory later:
    
    ```c++
    MappedColumnVector x(NULL);
    try {
        new (&x) MappedColumnVector(args[1].getAs<MappedColumnVector>());
        // code ...
    }
    ```
    
    Save goes for other places where this applies.
    



---
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