Repository: incubator-hawq
Updated Branches:
  refs/heads/master a683b5c31 -> 50c1aa9ea


HAWQ-1061. Fix update catelog inconsistency issue.


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

Branch: refs/heads/master
Commit: 50c1aa9eab39868f11f8946d9564aa832f5eb96c
Parents: 8954090
Author: xunzhang <xunzhang...@gmail.com>
Authored: Tue Sep 20 12:37:56 2016 +0800
Committer: Lili Ma <ictmal...@gmail.com>
Committed: Tue Sep 20 15:56:49 2016 +0800

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


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/50c1aa9e/tools/bin/hawqregister
----------------------------------------------------------------------
diff --git a/tools/bin/hawqregister b/tools/bin/hawqregister
index 2b9b343..bdd6947 100755
--- a/tools/bin/hawqregister
+++ b/tools/bin/hawqregister
@@ -572,8 +572,12 @@ class HawqRegister(object):
             query = "set allow_system_table_mods='dml';"
             query += "begin transaction;"
             segno_lst = [f.split('/')[-1] for f in self.files_update]
-            for i, eof in enumerate(eofs):
-                query += "update pg_aoseg.%s set eof = '%s' where segno = 
'%s';" % (self.seg_name, eof, segno_lst[i])
+            if self.file_format == 'Parquet':
+                for i, eof in enumerate(eofs):
+                    query += "update pg_aoseg.%s set eof = '%s', tupcount = 
'%s', eofuncompressed = '%s' where segno = '%s';" % (self.seg_name, eof, -1, 
-1, segno_lst[i])
+            else:
+                for i, eof in enumerate(eofs):
+                    query += "update pg_aoseg.%s set eof = '%s', tupcount = 
'%s', varblockcount = '%s', eofuncompressed = '%s' where segno = '%s';" % 
(self.seg_name, eof, -1, -1, -1, segno_lst[i])
             query += "end transaction;"
         else: # update_and_insert
             eofs = self.sizes
@@ -590,8 +594,12 @@ class HawqRegister(object):
             query += ';'
 
             segno_lst = [f.split('/')[-1] for f in self.files_update]
-            for i, eof in enumerate(self.sizes_update):
-                query += "update pg_aoseg.%s set eof = '%s' where segno = 
'%s';" % (self.seg_name, eof, segno_lst[i])
+            if self.file_format == 'Parquet':
+                for i, eof in enumerate(self.sizes_update):
+                    query += "update pg_aoseg.%s set eof = '%s', tupcount = 
'%s', eofuncompressed = '%s' where segno = '%s';" % (self.seg_name, eof, -1, 
-1, segno_lst[i])
+            else:
+                for i, eof in enumerate(self.sizes_update):
+                    query += "update pg_aoseg.%s set eof = '%s', tupcount = 
'%s', varblockcount = '%s', eofuncompressed = '%s' where segno = '%s';" % 
(self.seg_name, eof, -1, -1, -1, segno_lst[i])
             query += "end transaction;"
         return self.utility_accessor.update_catalog(query)
 

Reply via email to