madlib-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From iyerr3 <>
Subject [GitHub] incubator-madlib pull request #116: Unnest 2d array
Date Tue, 18 Apr 2017 19:18:26 GMT
Github user iyerr3 commented on a diff in the pull request:
    --- Diff: methods/array_ops/src/pg_gp/array_ops.sql_in ---
    @@ -636,3 +663,30 @@ CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.array_cum_prod(x anyarray)
     AS 'MODULE_PATHNAME', 'array_cum_prod'
     m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `NO SQL', `');
    + * @brief This function takes a 2-D array as the input and unnests it
    + *        by one level.
    + *        It returns a set of 1-D arrays that correspond to rows of
    + *        the input array as well as an ID column with values corresponding
    + *        to positions occupied by the 1-D arrays within the 2-D array.
    + *
    + * @param x Array x
    + * @returns Set of 1-D arrays that corrspond to rows of x and an ID column.
    + *
    + */
    +CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.array_unnest_2d_to_1d(x ANYARRAY, OUT unnest_2d_to_1d_id
BIGINT, OUT unnest_2d_to_1d_result ANYARRAY)
    --- End diff --
    The "unnest_2d_to_1d_id" can be an INTEGER, we won't have indices bigger than that. 
    Also maybe call it just "id" or "row_id/row_num"?

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 or file a JIRA ticket
with INFRA.

View raw message