Github user iyerr3 commented on a diff in the pull request:
https://github.com/apache/madlib/pull/206#discussion_r154242141
--- Diff: src/ports/postgres/modules/stats/correlation.py_in ---
@@ -180,31 +180,29 @@ def _populate_output_table(schema_madlib,
source_table, output_table,
function_name = "Correlation"
agg_str = "{0}.correlation_agg(x, mean)".format(schema_madlib)
+ cols = ','.join(["coalesce(" + col + ", avg_"+col+") "
+ for col in col_names])
+ avgs = ','.join(["avg(" + col + ") AS avg_" + col + ""
+ for col in col_names])
+ avg_array = ','.join(["avg_" + col + " " for col in col_names])
--- End diff --
Can add the trailing space in the `','` of the join.
---