You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by ok...@apache.org on 2017/10/12 23:22:51 UTC

madlib git commit: KNN: Fix hardcoded point label

Repository: madlib
Updated Branches:
  refs/heads/master 0a7efca73 -> a32c01c0b


KNN: Fix hardcoded point label


Project: http://git-wip-us.apache.org/repos/asf/madlib/repo
Commit: http://git-wip-us.apache.org/repos/asf/madlib/commit/a32c01c0
Tree: http://git-wip-us.apache.org/repos/asf/madlib/tree/a32c01c0
Diff: http://git-wip-us.apache.org/repos/asf/madlib/diff/a32c01c0

Branch: refs/heads/master
Commit: a32c01c0b827f23c3955d30210a152ac21773c87
Parents: 0a7efca
Author: Orhan Kislal <ok...@pivotal.io>
Authored: Thu Oct 12 16:21:52 2017 -0700
Committer: Orhan Kislal <ok...@pivotal.io>
Committed: Thu Oct 12 16:21:52 2017 -0700

----------------------------------------------------------------------
 src/ports/postgres/modules/knn/knn.py_in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/madlib/blob/a32c01c0/src/ports/postgres/modules/knn/knn.py_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/knn/knn.py_in b/src/ports/postgres/modules/knn/knn.py_in
index 477c18d..dec3f1f 100644
--- a/src/ports/postgres/modules/knn/knn.py_in
+++ b/src/ports/postgres/modules/knn/knn.py_in
@@ -151,7 +151,7 @@ def knn(schema_madlib, point_source, point_column_name, point_id, label_column_n
                     FROM
                         (
                         SELECT test.{test_id} AS {test_id_temp} ,
-                            train.id as train_id ,
+                            train.{point_id} as train_id ,
                             {schema_madlib}.squared_dist_norm2(
                                 train.{point_column_name},
                                 test.{test_column_name})
@@ -196,7 +196,7 @@ def knn(schema_madlib, point_source, point_column_name, point_id, label_column_n
                 FROM
                     (
                     SELECT test.{test_id} AS {test_id_temp} ,
-                        train.id as train_id ,
+                        train.{point_id} as train_id ,
                         {schema_madlib}.squared_dist_norm2(
                             train.{point_column_name},
                             test.{test_column_name})