Repository: madlib
Updated Branches:
  refs/heads/master bb4b54205 -> ccc3a1832


DT: Fix sparse vector to float8[] casting bug

JIRA: MADLIB-1234

The cast to float array (float8[]) should be evaluated before we access
the individual elements of the array, otherwise we encounter a strange
notation such as feature::madlib.svec::float8[][1]. A simple addition of
parentheses should fix the issue ((feature::madlib.svec::float8[])[1]).

Co-authored-by: Orhan Kislal <okis...@pivotal.io>


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

Branch: refs/heads/master
Commit: ccc3a1832be1d0dc3cbf8a43c66b019a583c3b8b
Parents: bb4b542
Author: Nandish Jayaram <njaya...@apache.org>
Authored: Mon May 14 11:54:26 2018 -0700
Committer: Orhan Kislal <okis...@pivotal.io>
Committed: Thu May 17 15:57:34 2018 -0700

----------------------------------------------------------------------
 .../postgres/modules/recursive_partitioning/decision_tree.py_in    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/madlib/blob/ccc3a183/src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in
----------------------------------------------------------------------
diff --git 
a/src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in 
b/src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in
index 99ddce2..6f64234 100644
--- a/src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in
+++ b/src/ports/postgres/modules/recursive_partitioning/decision_tree.py_in
@@ -147,7 +147,7 @@ def _get_features_to_use(schema_madlib, training_table_name,
                                         FROM {tbl}
                                         LIMIT 1
                                      """.format(f=feat, 
tbl=training_table_name))[0]
-            final_feature_list += ["{f}[{i}]".format(f=feat, i=i)
+            final_feature_list += ["({f})[{i}]".format(f=feat, i=i)
                                    for i in range(feat_dims['l'], 
feat_dims['u'] + 1)]
         else:
             final_feature_list.append(feat)

Reply via email to