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/08/29 20:41:57 UTC

[20/50] [abbrv] incubator-madlib git commit: Fix failures caused due to code cleanup (d487df3)

Fix failures caused due to code cleanup (d487df3)

Minor issues while processing query strings in WCC after code
refactoring done as part of #148 are fixed.


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

Branch: refs/heads/latest_release
Commit: e9e365a6823a92853d5465b9be98980475a89ed0
Parents: d487df3
Author: Nandish Jayaram <nj...@apache.org>
Authored: Thu Jul 20 15:27:52 2017 -0700
Committer: Nandish Jayaram <nj...@apache.org>
Committed: Thu Jul 20 15:27:52 2017 -0700

----------------------------------------------------------------------
 src/ports/postgres/modules/graph/wcc.py_in | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-madlib/blob/e9e365a6/src/ports/postgres/modules/graph/wcc.py_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/graph/wcc.py_in b/src/ports/postgres/modules/graph/wcc.py_in
index 1f6a81f..7027b29 100644
--- a/src/ports/postgres/modules/graph/wcc.py_in
+++ b/src/ports/postgres/modules/graph/wcc.py_in
@@ -114,6 +114,7 @@ def wcc(schema_madlib, vertex_table, vertex_id, edge_table, edge_args,
     INT_MAX = 2147483647
     component_id = 'component_id'
     grouping_cols_comma = '' if not grouping_cols else grouping_cols + ','
+    comma_grouping_cols = '' if not grouping_cols else ',' + grouping_cols
 
     if grouping_cols:
         distribution = ('' if is_platform_pg() else
@@ -136,7 +137,7 @@ def wcc(schema_madlib, vertex_table, vertex_id, edge_table, edge_args,
         new_to_update_where_condition = ' AND ' + gwc(newupdate, toupdate, grouping_cols_list)
         edge_to_update_where_condition = ' AND ' + gwc(edge_table, toupdate, grouping_cols_list)
         join_grouping_cols = gwc(subq, distinct_grp_table, grouping_cols_list)
-        group_by_clause = ('' if not grouping_cols else
+        group_by_clause_newupdate = ('' if not grouping_cols else
                            '{0}, {1}.{2}'.format(subq_prefixed_grouping_cols,
                                                  subq, vertex_id))
         plpy.execute("""
@@ -152,7 +153,7 @@ def wcc(schema_madlib, vertex_table, vertex_id, edge_table, edge_args,
                     FROM {edge_table}
                 ) {subq}
                 ON {join_grouping_cols}
-                GROUP BY {group_by_clause}
+                GROUP BY {group_by_clause_newupdate}
                 {distribution}
             """.format(select_grouping_cols=',' + subq_prefixed_grouping_cols,
                        select_grouping_cols_clause=grouping_cols_comma,
@@ -164,7 +165,7 @@ def wcc(schema_madlib, vertex_table, vertex_id, edge_table, edge_args,
                         {select_grouping_cols_clause}
                 FROM {newupdate}
                 {distribution}
-            """.format(select_grouping_cols_clause=grouping_cols_comma,
+            """.format(select_grouping_cols_clause=comma_grouping_cols,
                        **locals()))
     else:
         plpy.execute("""