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

    https://github.com/apache/incubator-madlib/pull/89#discussion_r98118503
  
    --- Diff: src/ports/postgres/modules/kmeans/kmeans.py_in ---
    @@ -34,6 +38,34 @@ def kmeans_validate_src(schema_madlib, rel_source, 
**kwargs):
     
     # ----------------------------------------------------------------------
     
    +def kmeans_validate_expr(schema_madlib, rel_source, expr_point, **kwargs):
    +    """
    +    Validation function for the expr_point parameter
    +    expr_point accepts 2 formats:
    +        - A single column name
    +        - An array expression
    +    If the array expression is used, we use the is_var_valid function to
    +    verify. This allows the regular array notation as well as any function
    +    that returns an array.
    +    """
    +
    +    if columns_exist_in_table(rel_source, [expr_point]):
    +        return rel_source, False
    +
    +    if is_var_valid(rel_source, expr_point):
    --- End diff --
    
    An alternative to this is to use `pg_typeof` to get the type of the 
expression. See `get_expr_type` in `validate_args.py_in` and check for '[]' in 
the result. 
    This allows rejecting non-array expressions. 
    @decibel any concerns with using `pg_typeof` here? 


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