You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by li...@apache.org on 2016/09/22 08:17:09 UTC

[1/2] incubator-hawq git commit: HAWQ-1061. Bugfix for --force mode of hawq register.

Repository: incubator-hawq
Updated Branches:
  refs/heads/master 107b79dfe -> dc12e94b4


HAWQ-1061. Bugfix for --force mode of hawq register.


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

Branch: refs/heads/master
Commit: 25e082aaf24df7a8b54fae930d633cb20c0373d5
Parents: 107b79d
Author: xunzhang <xu...@gmail.com>
Authored: Thu Sep 22 14:38:48 2016 +0800
Committer: xunzhang <xu...@gmail.com>
Committed: Thu Sep 22 14:38:48 2016 +0800

----------------------------------------------------------------------
 tools/bin/hawqregister | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/25e082aa/tools/bin/hawqregister
----------------------------------------------------------------------
diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister
index bef1460..1a6b5d3 100755
--- a/tools/bin/hawqregister
+++ b/tools/bin/hawqregister
@@ -301,9 +301,9 @@ class HawqRegister(object):
                     sys.exit(1)
                 return 'repair'
             else:
-                return 'second_normal'
+                return 'usage2_table_not_exist'
         else:
-            return 'first'
+            return 'usage1'
 
     def _init(self):
         def check_hash_type():
@@ -463,7 +463,7 @@ class HawqRegister(object):
             check_database_encoding()
             if self.mode != 'force' and self.mode != 'repair':
                 if not create_table():
-                    self.mode = 'second_exist'
+                    self.mode = 'usage2_table_exist'
             check_bucket_number()
             check_distribution_policy()
             check_policy_consistency()
@@ -471,7 +471,7 @@ class HawqRegister(object):
             self.file_format = 'Parquet'
             check_hash_type() # Usage1 only support randomly distributed table
         if not self.filepath:
-            if self.mode == 'first':
+            if self.mode == 'usage1':
                 logger.info('Please specify filepath with -f option.')
             else:
                 logger.info('Hawq Register Succeed.')
@@ -496,7 +496,7 @@ class HawqRegister(object):
                     logger.error('Can not register in repair mode since giving larger file size: %s' % self.sizes[k])
                     sys.exit(1)
 
-        if self.mode == 'second_exist':
+        if self.mode == 'usage2_table_exist':
             if self.tabledir.strip('/') == self.filepath.strip('/'):
                 logger.error('Files to be registered should not be the same with table path.')
                 sys.exit(1)
@@ -511,6 +511,9 @@ class HawqRegister(object):
                 else:
                     self.do_not_move, self.files_update, self.sizes_update = True, self.files, self.sizes
                     self.files, self.sizes = [], []
+            elif len(self.files) < len(existed_files):
+                logger.error('In force mode, you should include existing table files in yaml configuration file. Otherwise you should drop the previous table before register --force.')
+                sys.exit(1)
             else:
                 files_old, sizes_old = [f for f in self.files], [sz for sz in self.sizes]
                 for k, f in enumerate(files_old):
@@ -519,6 +522,10 @@ class HawqRegister(object):
                         self.sizes_update.append(sizes_old[k])
                         self.files.remove(files_old[k])
                         self.sizes.remove(sizes_old[k])
+                if sorted(self.files_update) != sorted(existed_files):
+                    logger.error('In force mode, you should include existing table files in yaml configuration file. Otherwise you should drop the previous table before register --force.')
+                    sys.exit(1)
+
         elif self.mode == 'repair':
             self.do_not_move = True
             self.files_update, self.sizes_update = [fn for fn in self.files], [sz for sz in self.sizes]


[2/2] incubator-hawq git commit: HAWQ-991. Disable --repair mode and partiton table support of hawq register for 2.0.1.0 release.

Posted by li...@apache.org.
HAWQ-991. Disable --repair mode and partiton table support of hawq register for 2.0.1.0 release.


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

Branch: refs/heads/master
Commit: dc12e94b43bddb2a9c71189efe284bb81d81afd3
Parents: 25e082a
Author: xunzhang <xu...@gmail.com>
Authored: Thu Sep 22 14:39:21 2016 +0800
Committer: xunzhang <xu...@gmail.com>
Committed: Thu Sep 22 15:57:41 2016 +0800

----------------------------------------------------------------------
 .../ManagementTool/test_hawq_register_usage2_case3.cpp       | 2 +-
 tools/bin/hawqregister                                       | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dc12e94b/src/test/feature/ManagementTool/test_hawq_register_usage2_case3.cpp
----------------------------------------------------------------------
diff --git a/src/test/feature/ManagementTool/test_hawq_register_usage2_case3.cpp b/src/test/feature/ManagementTool/test_hawq_register_usage2_case3.cpp
index 1d021d3..8e8fb6d 100644
--- a/src/test/feature/ManagementTool/test_hawq_register_usage2_case3.cpp
+++ b/src/test/feature/ManagementTool/test_hawq_register_usage2_case3.cpp
@@ -14,7 +14,7 @@ using hawq::test::SQLUtility;
 using hawq::test::Command;
 using hawq::test::HdfsConfig;
 
-TEST_F(TestHawqRegister, TestUsage2Case3Expected) {
+TEST_F(TestHawqRegister, DISABLED_TestUsage2Case3Expected) {
     SQLUtility util;
     string test_root(util.getTestRootPath());
     std::vector<string> create_table_matrix = {"distributed by (i)", "distributed randomly"};

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dc12e94b/tools/bin/hawqregister
----------------------------------------------------------------------
diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister
index 1a6b5d3..09b8532 100755
--- a/tools/bin/hawqregister
+++ b/tools/bin/hawqregister
@@ -296,6 +296,8 @@ class HawqRegister(object):
             if force:
                 return 'force'
             elif repair:
+                logger.info('--repair mode is not supported in current release of hawq register.')
+                sys.exit(0)
                 if not table_existed():
                     logger.error('--repair mode asserts the table has been already created.')
                     sys.exit(1)
@@ -405,6 +407,9 @@ class HawqRegister(object):
 
             if params['FileFormat'].lower() == 'parquet':
                 partitionby = params.get('Parquet_FileLocations').get('PartitionBy')
+                if partitionby:
+                    logger.info('Partition table is not supported in current release of hawq register.')
+                    sys.exit(0)
                 if params.get('Parquet_FileLocations').get('Partitions') and len(params['Parquet_FileLocations']['Partitions']):
                     partitions_checksum = [d['Checksum'] for d in params['Parquet_FileLocations']['Partitions']]
                     partitions_compression_level = [d['CompressionLevel'] for d in params['Parquet_FileLocations']['Partitions']]
@@ -424,6 +429,9 @@ class HawqRegister(object):
 
             else: #AO format
                 partitionby = params.get('AO_FileLocations').get('PartitionBy')
+                if partitionby:
+                    logger.info('Partition table is not supported in current release of hawq register.')
+                    sys.exit(0)
                 if params.get('AO_FileLocations').get('Partitions') and len(params['AO_FileLocations']['Partitions']):
                     partitions_checksum = [d['Checksum'] for d in params['AO_FileLocations']['Partitions']]
                     partitions_compressionLevel = [d['CompressionLevel'] for d in params['AO_FileLocations']['Partitions']]