Github user hpandeycodeit commented on a diff in the pull request: https://github.com/apache/madlib/pull/225#discussion_r164593774 --- Diff: src/ports/postgres/modules/knn/knn.py_in --- @@ -212,22 +244,27 @@ def knn(schema_madlib, point_source, point_column_name, point_id, WHERE {y_temp_table}.r <= {k_val} """.format(**locals())) - plpy.execute( - """ + plpy.execute(""" CREATE TABLE {output_table} AS - SELECT {test_id_temp} AS id, {test_column_name} + {view_def} + SELECT knn_temp.{test_id_temp} AS id , + knn_test.data {pred_out} --- End diff -- Updated the pred_out as per our discussion.
---