You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@madlib.apache.org by "Frank McQuillan (JIRA)" <ji...@apache.org> on 2019/08/12 18:33:00 UTC

[jira] [Commented] (MADLIB-1377) Pivot documentation is wrong about some optional parameters

    [ https://issues.apache.org/jira/browse/MADLIB-1377?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16905476#comment-16905476 ] 

Frank McQuillan commented on MADLIB-1377:
-----------------------------------------

MADlib does not currently support postgres named notation, i.e., where the argument's name is specified using := to separate it from the argument expression.  This is because Greenplum does not (yet) support  named notation.  When it does, we will add it.

It means you need to put NULLs in for optional parameters to maintain the order.  So for your example:

For example, try:
{code}
SELECT madlib.pivot('pivset',   -- source table
'pivout',  -- out_table
'id',  -- index
'piv',  -- pivot cols
'val',  -- pivot vals
NULL, -- agg function
NULL, -- fill value
NULL, -- keep NULLs
NULL, -- output col dictionary 
'array' -- output type
);
{code}

> Pivot documentation is wrong about some optional parameters
> -----------------------------------------------------------
>
>                 Key: MADLIB-1377
>                 URL: https://issues.apache.org/jira/browse/MADLIB-1377
>             Project: Apache MADlib
>          Issue Type: Bug
>          Components: Documentation
>            Reporter: Juan Ignacio Saitua
>            Priority: Major
>             Fix For: v1.16
>
>
> I tried to output an array column instead of multiple columns using the optional parameter _output_type_, but it throws an error:
> {code:sql}
> --This is based on the example from the documentation page
> --This works ok
> SELECT madlib.pivot(source_table := 'pivset', out_table := 'pivout', index := 'id', pivot_cols := 'piv', pivot_values := 'val');
>  pivot 
> -------
>  
> (1 row)
> --Adding the optional parameter, output_type, doesn't work:
> SELECT madlib.pivot(source_table := 'pivset', out_table := 'pivout', index := 'id', pivot_cols := 'piv', pivot_values := 'val', output_type := 'array');
> ERROR:  function madlib.pivot(source_table => unknown, out_table => unknown, index => unknown, pivot_cols => unknown, pivot_values => unknown, output_type => unknown) does not exist
> {code}
> Looking at the corresponding _madlib.pivot()_ function, there's no parameter defined as _default_, so it seems that you can't have optional parameters as stated on the documentation?



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)