Add 1.15.1 changelist and fix upgrade util

Upgrade was failing when functions without any arguments were added to
the changelist. This commit fixes the issue by setting the argument list
to empty string.

Closes #329


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

Branch: refs/heads/master
Commit: 754725962580b37424e27e584ee5001ee1311c79
Parents: cdba8c5
Author: Orhan Kislal <[email protected]>
Authored: Thu Oct 4 11:14:25 2018 +0300
Committer: Orhan Kislal <[email protected]>
Committed: Thu Oct 4 11:14:25 2018 +0300

----------------------------------------------------------------------
 src/madpack/changelist_1.15_1.15.1.yaml | 59 ++++++++++++++++++++++++++++
 src/madpack/upgrade_util.py             |  3 +-
 2 files changed, 61 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/madlib/blob/75472596/src/madpack/changelist_1.15_1.15.1.yaml
----------------------------------------------------------------------
diff --git a/src/madpack/changelist_1.15_1.15.1.yaml 
b/src/madpack/changelist_1.15_1.15.1.yaml
new file mode 100644
index 0000000..daca2bd
--- /dev/null
+++ b/src/madpack/changelist_1.15_1.15.1.yaml
@@ -0,0 +1,59 @@
+# 
------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+# 
------------------------------------------------------------------------------
+
+# Changelist for MADlib version rel/v1.15 to rel/v1.15.1
+
+# This file contains all changes that were introduced in a new version of
+# MADlib. This changelist is used by the upgrade script to detect what objects
+# should be upgraded (while retaining all other objects from the previous 
version)
+
+# New modules (actually .sql_in files) added in upgrade version
+# For these files the sql_in code is retained as is with the functions in the
+# file installed on the upgrade version. All other files (that don't have
+# updates), are cleaned up to remove object replacements
+new module:
+
+# Changes in the types (UDT) including removal and modification
+udt:
+
+# List of the UDF changes that affect the user externally. This includes change
+# in function name, return type, argument order or types, or removal of
+# the function. In each case, the original function is as good as removed and a
+# new function is created. In such cases, we should abort the upgrade if there
+# are user views dependent on this function, since the original function will
+# not be present in the upgraded version.
+udf:
+    - __knn_validate_src:
+        rettype: integer
+        argument: character varying, character varying, character varying, 
character varying, character varying, character varying, character varying, 
character varying, integer
+    - stratified_sample_help:
+        rettype: character varying
+        argument:
+    - stratified_sample_help:
+        rettype: character varying
+        argument: character varying
+
+# Changes to aggregates (UDA) including removal and modification
+# Overloaded functions should be mentioned separately
+uda:
+
+# List of the UDC, UDO and UDOC changes.
+udc:
+udo:
+udoc:

http://git-wip-us.apache.org/repos/asf/madlib/blob/75472596/src/madpack/upgrade_util.py
----------------------------------------------------------------------
diff --git a/src/madpack/upgrade_util.py b/src/madpack/upgrade_util.py
index 53ff748..e50e7b9 100644
--- a/src/madpack/upgrade_util.py
+++ b/src/madpack/upgrade_util.py
@@ -11,6 +11,7 @@ from utilities import get_rev_num
 from utilities import remove_comments_from_sql
 from utilities import run_query
 
+
 if not __name__ == "__main__":
     def run_sql(sql, portid, con_args):
         """
@@ -180,7 +181,7 @@ class ChangeHandler(UpgradeBase):
                 for obj_name, obj_details in each_config.iteritems():
                     formatted_obj = {}
                     for k, v in obj_details.items():
-                        v = v.lower().replace('schema_madlib', self._schema)
+                        v = v.lower().replace('schema_madlib', self._schema) 
if v else ""
                         formatted_obj[k] = v
                     _return_obj[obj_name].append(formatted_obj)
         return _return_obj

Reply via email to