New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unnest 2d array #116
Unnest 2d array #116
Conversation
Can one of the admins verify this patch? |
* | ||
*/ | ||
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) | ||
RETURNS SETOF RECORD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please try to have at most 80 chars in a line wherever possible, based on MADlib's coding convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"?
) t2 | ||
GROUP BY t2.r | ||
$BODY$ | ||
LANGUAGE sql IMMUTABLE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having online docs with usage/example for this function would be helpful. We can have something similar to what is present in .../incubator-madlib/methods/stemmer/src/pg_gp/porter_stemmer.sql_in
…ges to install-check; added online docs
Jenkins, OK to test. |
Refer to this link for build results (access rights to CI server needed): |
Refer to this link for build results (access rights to CI server needed): |
Array Operations: Add function to unnest 2-D arrays into rows of 1-D arrays
JIRA: MADLIB-1086
Function to unnest 2-D array by one level (i.e. into rows of 1-D arrays).
This is needed, for instance, in K-means, so that we can get one centroid per row for follow on operations.