You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@madlib.apache.org by ri...@apache.org on 2016/04/01 03:21:21 UTC

[02/11] incubator-madlib git commit: Build: Add support for HAWQ 2.0

http://git-wip-us.apache.org/repos/asf/incubator-madlib/blob/96f9ac04/src/ports/postgres/modules/utilities/in_mem_group_control.py_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/utilities/in_mem_group_control.py_in b/src/ports/postgres/modules/utilities/in_mem_group_control.py_in
index 35ea306..67667ba 100644
--- a/src/ports/postgres/modules/utilities/in_mem_group_control.py_in
+++ b/src/ports/postgres/modules/utilities/in_mem_group_control.py_in
@@ -343,15 +343,16 @@ class GroupIterationController:
         insert_plan = plpy.prepare(insert_sql,
                                    ["text[]", group_param.grouped_state_type,
                                     "text[]", "bigint[]"])
-
         plpy.execute(insert_plan, [self.finished_states.keys,
                                    self.finished_states.values,
                                    self.grp_to_n_tuples.keys(),
                                    self.grp_to_n_tuples.values()])
-        plpy.execute(insert_plan, [self.failed_grp_keys,
-                                   [],
-                                   self.grp_to_n_tuples.keys(),
-                                   self.grp_to_n_tuples.values()])
+        if self.failed_grp_keys:
+            plpy.execute(insert_plan,
+                         [self.failed_grp_keys,
+                          [],
+                          self.grp_to_n_tuples.keys(),
+                          self.grp_to_n_tuples.values()])
 
     def __exit__(self, type, value, tb):
         self.in_with = False
@@ -470,7 +471,8 @@ class GroupIterationController:
                 select_n_tuples=group_param.select_n_tuples,
                 **self.kwargs)
         update_plan = plpy.prepare(run_sql,
-            ["text[]", group_param.grouped_state_type, "text[]", "integer[]"])
+                                   ["text[]", group_param.grouped_state_type,
+                                    "text[]", "integer[]"])
         res_tuples = plpy.execute(update_plan, [self.new_states.keys,
                                                 self.new_states.values,
                                                 self.grp_to_n_tuples.keys(),

http://git-wip-us.apache.org/repos/asf/incubator-madlib/blob/96f9ac04/src/ports/postgres/modules/utilities/utilities.py_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/utilities/utilities.py_in b/src/ports/postgres/modules/utilities/utilities.py_in
index 31ba6da..6ecc907 100644
--- a/src/ports/postgres/modules/utilities/utilities.py_in
+++ b/src/ports/postgres/modules/utilities/utilities.py_in
@@ -38,7 +38,7 @@ def get_seg_number():
     return plpy.execute(
         """
         SELECT count(*) from gp_segment_configuration
-        WHERE content >= 0 and role = 'p'
+        WHERE role = 'p'
         """)[0]['count']
     !>)
 # ------------------------------------------------------------
@@ -354,9 +354,9 @@ class __mad_version:
         """ Return True if self is a HAWQ database and self.version
         is less than compare_version
 
-        @param compare_version: str, String form of the comparison version. Expected
-                                    format is Semantic Versioning.
-                                    examples of versions: 1.0, 2.3, 9.3.5
+        @param compare_version: str, String form of the comparison version.
+                    Expected format is Semantic Versioning.
+                        examples of versions: 1.0, 2.3, 9.3.5
         """
         regex = re.compile('HAWQ\s*([0-9.]+)', re.IGNORECASE)
         version = regex.findall(self.version)

http://git-wip-us.apache.org/repos/asf/incubator-madlib/blob/96f9ac04/src/ports/postgres/modules/utilities/utilities.sql_in
----------------------------------------------------------------------
diff --git a/src/ports/postgres/modules/utilities/utilities.sql_in b/src/ports/postgres/modules/utilities/utilities.sql_in
index ce46eff..0ec864d 100644
--- a/src/ports/postgres/modules/utilities/utilities.sql_in
+++ b/src/ports/postgres/modules/utilities/utilities.sql_in
@@ -306,7 +306,7 @@ m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `CONTAINS SQL', `');
 /*
  * Create type bytea8 with 8-byte alignment.
  */
-m4_ifdef(`__HAWQ__', `', `
+m4_ifdef(`__UDT_NOT_ALLOWED__', `', `
 CREATE TYPE MADLIB_SCHEMA.bytea8;
 ')
 
@@ -333,7 +333,7 @@ LANGUAGE internal IMMUTABLE STRICT
 m4_ifdef(`__HAS_FUNCTION_PROPERTIES__', `NO SQL', `');
 
 
-m4_ifdef(`__HAWQ__', `', `
+m4_ifdef(`__UDT_NOT_ALLOWED__', `', `
 CREATE TYPE MADLIB_SCHEMA.bytea8(
     INPUT = MADLIB_SCHEMA.bytea8in,
     OUTPUT = MADLIB_SCHEMA.bytea8out,