You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by wl...@apache.org on 2016/09/23 11:32:39 UTC

incubator-hawq git commit: HAWQ-1061. Fix register with empty folder in usage1. Fix policy check for hawq register with the case from randomly into hash.

Repository: incubator-hawq
Updated Branches:
  refs/heads/master a4f57020c -> 1aa0fbf5a


HAWQ-1061. Fix register with empty folder in usage1. Fix policy check for hawq register with the case from randomly into hash.


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

Branch: refs/heads/master
Commit: 1aa0fbf5a72f966c41e61fe0844b0c4e4340af08
Parents: a4f5702
Author: xunzhang <xu...@gmail.com>
Authored: Fri Sep 23 17:22:30 2016 +0800
Committer: Wen Lin <wl...@pivotal.io>
Committed: Fri Sep 23 19:32:05 2016 +0800

----------------------------------------------------------------------
 tools/bin/hawqregister | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/1aa0fbf5/tools/bin/hawqregister
----------------------------------------------------------------------
diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister
index b2c85ea..c7c207d 100755
--- a/tools/bin/hawqregister
+++ b/tools/bin/hawqregister
@@ -320,7 +320,7 @@ class HawqRegister(object):
                 return 'usage2_table_not_exist'
         else:
             if not table_existed():
-                logger.error('You should create table before registering the data.')
+                logger.error('Table %s does not exist.\nYou should create table before registering the data.' % self.tablename)
                 sys.exit(1)
             else:
                 return 'usage1'
@@ -368,6 +368,10 @@ class HawqRegister(object):
             policy = get_distribution_policy() # "" or "{1,3}"
             if policy is None:
                 return
+            if self.distribution_policy == 'DISTRIBUTED RANDOMLY':
+                logger.error('Distribution policy of %s from yaml is not consistent with the policy of existing table.' % self.tablename)
+                self.failure_handler.rollback()
+                sys.exit(1)
             tmp_dict = {}
             for i, d in enumerate(self.schema):
                 tmp_dict[d['name']] = i + 1
@@ -659,6 +663,10 @@ class HawqRegister(object):
             if len(lineargs) == 8 and lineargs[0].find("d") == -1:
                 files.append(lineargs[7])
                 sizes.append(int(lineargs[4]))
+        if len(files) == 0 and self.mode == 'usage1':
+            logger.info('No files to be registered.')
+            logger.info('Hawq Register Succeed.')
+            sys.exit(0)
         if len(files) == 0 and self.mode != 'force':
             logger.error("Dir '%s' is empty" % filepath)
             self.failure_handler.rollback()