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

Frank McQuillan commented on MADLIB-1376:
-----------------------------------------

We use "output_table" as the standard in other transform functions so we should 
change the name of the output table from "out_table" to "output_table" in the 
function to be consistent.

Also the on-line docs are missing the "aggregate_function" parameter:

{code}
madlib=# select madlib.pivot('usage');
                                        pivot                                   
     
-------------------------------------------------------------------------------------
                                                                                
    +
 -----------------------------------------------------------------------        
    +
                             USAGE                                              
    +
 -----------------------------------------------------------------------        
    +
  SELECT madlib.pivot(                                                          
    +
     source_table,           -- Name of source table containing data for 
pivoting   +
     out_table,              -- Name of output table taht contains pivoted data 
    +
     index,                  -- Comma-separated columns that will form the 
index    +
                             -- of the output pivot table                       
    +
     pivot_cols,             -- Comma-separated columns that will form the      
    +
                             -- columns of the output pivot table               
    +
     pivot_values,            -- Comma-separated columns that contain the 
values    +
                             -- to be summarized in the output pivot table      
    +
     fill_value,              -- If specified, determines how to fill NULL 
values   +
                             -- resulting from pivot operation                  
    +
     keep_null,               -- The flag for determining how to handle NULL    
    +
                             -- values in pivot columns                         
    +
     output_col_dictionary,   -- The flag for enabling the creation of the      
    +
                             -- output dictionary for shorter column names      
    +
     output_type             -- This parameter controls the output format       
    +
                             -- of the pivoted variables.                       
    +
                             -- If 'column', a column is created for each pivot 
    +
                             -- If 'array', an array is created combining all 
pivots+
                             -- If 'svec', the array is cast to madlib.svec     
    +
  );                                                                            
    +
                                                                                
    +
 -----------------------------------------------------------------------        
    +
                             OUTPUT                                             
    +
 -----------------------------------------------------------------------        
    +
 The output table ('output_table' above) has all the columns present in index   
    +
 column list, plus additional columns for each distinct value in pivot_cols.    
    +
 The column name for the pivot is                                               
    +
 set as '<pivot name>_<pivot value>'.                                           
    +
                                                                                
    +
 A dictionary table ('<output_table>_dictionary') is created if either          
    +
 'output_col_dictionary' is True or if the auto-generated column names exceed   
    +
 the PostgreSQL limit of 63 bytes . This table gives a mapping between short    
    +
 column names in 'output_table' and the meaning of those columns                
    +
 i.e. which index, value, agg and pivot column they belong to.                  
    +
 
(1 row)
{code}

> Pivot documentation should say "out_table" instead of "output_table"
> --------------------------------------------------------------------
>
>                 Key: MADLIB-1376
>                 URL: https://issues.apache.org/jira/browse/MADLIB-1376
>             Project: Apache MADlib
>          Issue Type: Bug
>          Components: Documentation
>            Reporter: Juan Ignacio Saitua
>            Priority: Major
>             Fix For: v1.17
>
>
> The pivot function uses incorrectly "output_table" (and not "out_table") as 
> the parameter for the name of the output table that contains the pivoted data.



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

Reply via email to