hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ztao1...@apache.org
Subject incubator-hawq git commit: HAWQ-147. Fix a bug of creating database failed due to parquet table exist in template1
Date Tue, 26 Jan 2016 08:44:07 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 379cb11eb -> 095368465


HAWQ-147. Fix a bug of creating database failed due to parquet table exist in template1


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

Branch: refs/heads/master
Commit: 09536846541e09a9595ea7549f8cf516d8b41c00
Parents: 379cb11
Author: zhenglin tao <zhenglin.taozl@gmail.com>
Authored: Tue Jan 26 16:23:37 2016 +0800
Committer: zhenglin tao <zhenglin.taozl@gmail.com>
Committed: Tue Jan 26 16:43:59 2016 +0800

----------------------------------------------------------------------
 src/backend/cdb/cdbdatabaseinfo.c | 59 ++++++++++++++++------------------
 1 file changed, 28 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/09536846/src/backend/cdb/cdbdatabaseinfo.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbdatabaseinfo.c b/src/backend/cdb/cdbdatabaseinfo.c
index 520a107..062c4d3 100644
--- a/src/backend/cdb/cdbdatabaseinfo.c
+++ b/src/backend/cdb/cdbdatabaseinfo.c
@@ -1037,7 +1037,7 @@ DatabaseInfo_HandleAppendOnly(
 		if (dbInfoRel == NULL)
 			break;
 	
-		if (dbInfoRel->relstorage == RELSTORAGE_AOROWS)
+		if (dbInfoRel->relstorage == RELSTORAGE_AOROWS || dbInfoRel->relstorage == RELSTORAGE_PARQUET)
 		{
 			AppendOnlyEntry 	*aoEntry;
 			DbInfoRel 			*aosegDbInfoRel;
@@ -1076,38 +1076,35 @@ DatabaseInfo_HandleAppendOnly(
 												aoEntry->segrelid);
 			Assert(aosegDbInfoRel != NULL);
 
-			if (dbInfoRel->relstorage == RELSTORAGE_AOROWS)
+			FileSegInfo **aoSegfileArray;
+			int totalAoSegFiles;
+
+			Relation pg_aoseg_rel;
+
+			pg_aoseg_rel =
+					DirectOpen_PgAoSegOpenDynamic(
+										aoEntry->segrelid,
+										MyDatabaseTableSpace,
+										info->database,
+										aosegDbInfoRel->relfilenodeOid);
+
+			aoSegfileArray =
+					GetAllFileSegInfo_pg_aoseg_rel(
+											dbInfoRel->relname,
+											aoEntry,
+											pg_aoseg_rel,
+											SnapshotNow,
+											-1,
+											&totalAoSegFiles);
+			for (i = 0; i < totalAoSegFiles; i++)
 			{
-				FileSegInfo **aoSegfileArray;
-				int totalAoSegFiles;
-
-				Relation pg_aoseg_rel;
-
-				pg_aoseg_rel = 
-						DirectOpen_PgAoSegOpenDynamic(
-											aoEntry->segrelid,
-											MyDatabaseTableSpace,
-											info->database,
-											aosegDbInfoRel->relfilenodeOid);
-				
-				aoSegfileArray = 
-						GetAllFileSegInfo_pg_aoseg_rel(
-												dbInfoRel->relname, 
-												aoEntry,
-												pg_aoseg_rel,
-												SnapshotNow, 
-                                                -1,
-												&totalAoSegFiles);
-				for (i = 0; i < totalAoSegFiles; i++)
-				{
-					DatabaseInfo_AddAppendOnlyCatalogSegmentInfo(
-															dbInfoRel,
-															aoSegfileArray[i]->segno,
-															aoSegfileArray[i]->eof);
-				}
+				DatabaseInfo_AddAppendOnlyCatalogSegmentInfo(
+														dbInfoRel,
+														aoSegfileArray[i]->segno,
+														aoSegfileArray[i]->eof);
+			}
 
-				DirectOpen_PgAoSegClose(pg_aoseg_rel);
-			}			
+			DirectOpen_PgAoSegClose(pg_aoseg_rel);
 		}
 	}
 }


Mime
View raw message