13 m4_include(`SQLCommon.m4
')
110 CREATE TYPE MADLIB_SCHEMA.profile_result AS (
124 CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.profile( input_table text)
125 RETURNS SETOF MADLIB_SCHEMA.profile_result
128 PythonFunctionBodyOnly(`data_profile', `
profile')
130 # schema_madlib comes from PythonFunctionBodyOnly
131 return profile.profile( schema_madlib, input_table, 'bas
', None);
133 $$ LANGUAGE plpythonu;
142 CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.profile_full( input_table text, buckets integer)
143 RETURNS SETOF MADLIB_SCHEMA.profile_result
146 PythonFunctionBodyOnly(`data_profile', `
profile')
148 # schema_madlib comes from PythonFunctionBodyOnly
149 return profile.profile( schema_madlib, input_table, 'all
', buckets);
151 $$ LANGUAGE plpythonu;
161 CREATE OR REPLACE FUNCTION MADLIB_SCHEMA.array_collapse( input anyarray)
168 IF array_lower( input, 1) is NULL OR array_upper( input, 1) is NULL THEN
172 FOR i IN array_lower( input, 1)..array_upper( input, 1) LOOP
173 x[i] := array_to_string( input[i:i][array_lower( input, 2):array_upper( input, 2)], ':
');