You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by ml...@apache.org on 2015/12/29 04:44:42 UTC
[1/2] incubator-hawq git commit: HAWQ-283. Remove the content column
from the catalog pg_aoseg.pg_aoseg_xxxxx
Repository: incubator-hawq
Updated Branches:
refs/heads/master 2e604a223 -> b015b0fc2
HAWQ-283. Remove the content column from the catalog pg_aoseg.pg_aoseg_xxxxx
Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/b9dc5a69
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/b9dc5a69
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/b9dc5a69
Branch: refs/heads/master
Commit: b9dc5a69e109c48d0c1866144927f9e7817938cc
Parents: 2e604a2
Author: Ming LI <ml...@pivotal.io>
Authored: Fri Dec 25 16:13:39 2015 +0800
Committer: Ming LI <ml...@pivotal.io>
Committed: Tue Dec 29 11:42:56 2015 +0800
----------------------------------------------------------------------
src/backend/access/appendonly/aosegfiles.c | 16 +---------------
.../access/appendonly/appendonlywriter.c | 3 ---
src/backend/access/parquet/parquetsegfiles.c | 20 ++------------------
src/backend/catalog/aoseg.c | 10 +---------
src/backend/cdb/cdbdatabaseinfo.c | 2 --
src/include/access/aosegfiles.h | 7 ++-----
src/include/access/parquetsegfiles.h | 7 ++-----
7 files changed, 8 insertions(+), 57 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b9dc5a69/src/backend/access/appendonly/aosegfiles.c
----------------------------------------------------------------------
diff --git a/src/backend/access/appendonly/aosegfiles.c b/src/backend/access/appendonly/aosegfiles.c
index 6b1b232..08ce53a 100644
--- a/src/backend/access/appendonly/aosegfiles.c
+++ b/src/backend/access/appendonly/aosegfiles.c
@@ -108,7 +108,6 @@ InsertInitialSegnoEntry(AppendOnlyEntry *aoEntry, int segno)
values[Anum_pg_aoseg_varblockcount - 1] = Float8GetDatum(0);
values[Anum_pg_aoseg_eof - 1] = Float8GetDatum(0);
values[Anum_pg_aoseg_eofuncompressed - 1] = Float8GetDatum(0);
- values[Anum_pg_aoseg_content - 1] = Int32GetDatum(-1);
/*
* form the tuple and insert it
@@ -250,7 +249,6 @@ GetFileSegInfo(Relation parentrel, AppendOnlyEntry *aoEntry, Snapshot appendOnly
fsinfo->eof = (int64)DatumGetFloat8(eof);
fsinfo->tupcount = (int64)DatumGetFloat8(tupcount);
fsinfo->varblockcount = (int64)DatumGetFloat8(varbcount);
- fsinfo->content = MASTER_CONTENT_ID;
ItemPointerSetInvalid(&fsinfo->sequence_tid);
@@ -335,12 +333,6 @@ aoFileSegInfoCmp(const void *left, const void *right)
FileSegInfo *leftSegInfo = *((FileSegInfo **)left);
FileSegInfo *rightSegInfo = *((FileSegInfo **)right);
- if (leftSegInfo->content < rightSegInfo->content)
- return -1;
-
- if (leftSegInfo->content > rightSegInfo->content)
- return 1;
-
if (leftSegInfo->segno < rightSegInfo->segno)
return -1;
@@ -370,8 +362,7 @@ FileSegInfo **GetAllFileSegInfo_pg_aoseg_rel(
eof,
eof_uncompressed,
tupcount,
- varblockcount,
- content;
+ varblockcount;
bool isNull;
pg_aoseg_dsc = RelationGetDescr(pg_aoseg_rel);
@@ -383,9 +374,6 @@ FileSegInfo **GetAllFileSegInfo_pg_aoseg_rel(
allseginfo = (FileSegInfo **) palloc0(sizeof(FileSegInfo*) * seginfo_slot_no);
seginfo_no = 0;
- ScanKeyInit(&key[numOfKey++], (AttrNumber) Anum_pg_aoseg_content,
- BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(MASTER_CONTENT_ID));
-
if(expectedSegno>=0)
{
ScanKeyInit(&key[numOfKey++], (AttrNumber) Anum_pg_aoseg_segno,
@@ -441,8 +429,6 @@ FileSegInfo **GetAllFileSegInfo_pg_aoseg_rel(
else
oneseginfo->eof_uncompressed = (int64)DatumGetFloat8(eof);
- content = fastgetattr(tuple, Anum_pg_aoseg_content, pg_aoseg_dsc, &isNull);
- oneseginfo->content = DatumGetInt32(content);
seginfo_no++;
oneseginfo = NULL;
CHECK_FOR_INTERRUPTS();
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b9dc5a69/src/backend/access/appendonly/appendonlywriter.c
----------------------------------------------------------------------
diff --git a/src/backend/access/appendonly/appendonlywriter.c b/src/backend/access/appendonly/appendonlywriter.c
index cd5c011..1c00818 100644
--- a/src/backend/access/appendonly/appendonlywriter.c
+++ b/src/backend/access/appendonly/appendonlywriter.c
@@ -1768,7 +1768,6 @@ AORelLookupSegfileStatus(int segno, AORelHashEntry entry)
struct SegFileMap
{
- int32 contentid;
int64 eof;
bool ok;
};
@@ -1801,7 +1800,6 @@ GetSegmentFileLengthMapping(Relation rel, Oid segrelid, int segno, int *totalseg
for (i = 0; i < *totalsegs; ++i)
{
- retval[i].contentid = fsinfo[i]->content;
retval[i].eof = fsinfo[i]->eof;
retval[i].ok = false;
}
@@ -1826,7 +1824,6 @@ GetSegmentFileLengthMapping(Relation rel, Oid segrelid, int segno, int *totalseg
for (i = 0; i < *totalsegs; ++i)
{
- retval[i].contentid = fsinfo[i]->content;
retval[i].eof = fsinfo[i]->eof;
retval[i].ok = false;
}
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b9dc5a69/src/backend/access/parquet/parquetsegfiles.c
----------------------------------------------------------------------
diff --git a/src/backend/access/parquet/parquetsegfiles.c b/src/backend/access/parquet/parquetsegfiles.c
index 98ca2e5..cf8d140 100644
--- a/src/backend/access/parquet/parquetsegfiles.c
+++ b/src/backend/access/parquet/parquetsegfiles.c
@@ -158,7 +158,6 @@ GetParquetFileSegInfo(Relation parentrel, AppendOnlyEntry *aoEntry,
fsinfo->segno = segno;
fsinfo->eof = (int64) DatumGetFloat8(eof);
fsinfo->tupcount = (int64) DatumGetFloat8(tupcount);
- fsinfo->content = -1;
ItemPointerSetInvalid(&fsinfo->sequence_tid);
@@ -222,7 +221,6 @@ void InsertInitialParquetSegnoEntry(AppendOnlyEntry *aoEntry, int segno) {
values[Anum_pg_parquetseg_tupcount - 1] = Float8GetDatum(0);
values[Anum_pg_parquetseg_eof - 1] = Float8GetDatum(0);
values[Anum_pg_parquetseg_eofuncompressed - 1] = Float8GetDatum(0);
- values[Anum_pg_parquetseg_content - 1] = Int32GetDatum(-1);
/*
* form the tuple and insert it
@@ -543,8 +541,7 @@ ParquetFileSegInfo **GetAllParquetFileSegInfo_pg_paqseg_rel(
Datum segno,
eof,
eof_uncompressed,
- tupcount,
- content;
+ tupcount;
bool isNull;
pg_parquetseg_dsc = RelationGetDescr(pg_parquetseg_rel);
@@ -556,9 +553,6 @@ ParquetFileSegInfo **GetAllParquetFileSegInfo_pg_paqseg_rel(
allseginfo = (ParquetFileSegInfo **) palloc0(sizeof(ParquetFileSegInfo*) * seginfo_slot_no);
seginfo_no = 0;
- ScanKeyInit(&key[numOfKey++], (AttrNumber) Anum_pg_parquetseg_content,
- BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(-1));
-
if(expectedSegno>=0){
ScanKeyInit(&key[numOfKey++], (AttrNumber) Anum_pg_parquetseg_segno,
BTEqualStrategyNumber, F_INT4EQ, Int32GetDatum(expectedSegno));
@@ -609,12 +603,8 @@ ParquetFileSegInfo **GetAllParquetFileSegInfo_pg_paqseg_rel(
else
oneseginfo->eof_uncompressed = (int64)DatumGetFloat8(eof);
- content = fastgetattr(tuple, Anum_pg_parquetseg_content, pg_parquetseg_dsc, &isNull);
- oneseginfo->content = DatumGetInt32(content);
-
if (Debug_appendonly_print_scan)
- elog(LOG,"Parquet found existing contentid %d segno %d with eof " INT64_FORMAT " for table '%s' out of total %d segs",
- oneseginfo->content,
+ elog(LOG,"Parquet found existing segno %d with eof " INT64_FORMAT " for table '%s' out of total %d segs",
oneseginfo->segno,
oneseginfo->eof,
relationName,
@@ -657,12 +647,6 @@ parquetFileSegInfoCmp(const void *left, const void *right)
ParquetFileSegInfo *leftSegInfo = *((ParquetFileSegInfo **)left);
ParquetFileSegInfo *rightSegInfo = *((ParquetFileSegInfo **)right);
- if (leftSegInfo->content < rightSegInfo->content)
- return -1;
-
- if (leftSegInfo->content > rightSegInfo->content)
- return 1;
-
if (leftSegInfo->segno < rightSegInfo->segno)
return -1;
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b9dc5a69/src/backend/catalog/aoseg.c
----------------------------------------------------------------------
diff --git a/src/backend/catalog/aoseg.c b/src/backend/catalog/aoseg.c
index 11cf2b4..18778b7 100644
--- a/src/backend/catalog/aoseg.c
+++ b/src/backend/catalog/aoseg.c
@@ -157,8 +157,6 @@ create_aoseg_table(Relation rel, Oid aosegOid, Oid aosegIndexOid, Oid * comptype
TupleDescInitEntry(tupdesc,
(AttrNumber) Anum_pg_aoseg_eofuncompressed,
"eofuncompressed", FLOAT8OID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) Anum_pg_aoseg_content,
- "content", INT4OID, -1, 0);
}
else
{
@@ -183,8 +181,6 @@ create_aoseg_table(Relation rel, Oid aosegOid, Oid aosegIndexOid, Oid * comptype
TupleDescInitEntry(tupdesc,
(AttrNumber) Anum_pg_parquetseg_eofuncompressed,
"eofuncompressed", FLOAT8OID, -1, 0);
- TupleDescInitEntry(tupdesc, (AttrNumber) Anum_pg_parquetseg_content,
- "content", INT4OID, -1, 0);
}
/*
@@ -224,12 +220,8 @@ create_aoseg_table(Relation rel, Oid aosegOid, Oid aosegIndexOid, Oid * comptype
* Create unique index on segno.
*/
indexInfo = makeNode(IndexInfo);
- indexInfo->ii_NumIndexAttrs = 2;
+ indexInfo->ii_NumIndexAttrs = 1;
indexInfo->ii_KeyAttrNumbers[0] = 1;
- if (RelationIsAoRows(rel))
- indexInfo->ii_KeyAttrNumbers[1] = Anum_pg_aoseg_content;
- else
- indexInfo->ii_KeyAttrNumbers[1] = Anum_pg_parquetseg_content;
indexInfo->ii_Expressions = NIL;
indexInfo->ii_ExpressionsState = NIL;
indexInfo->ii_Predicate = NIL;
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b9dc5a69/src/backend/cdb/cdbdatabaseinfo.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbdatabaseinfo.c b/src/backend/cdb/cdbdatabaseinfo.c
index 31d892d..520a107 100644
--- a/src/backend/cdb/cdbdatabaseinfo.c
+++ b/src/backend/cdb/cdbdatabaseinfo.c
@@ -491,7 +491,6 @@ static void DatabaseInfo_AddExtraSegmentFile(
static void DatabaseInfo_AddAppendOnlyCatalogSegmentInfo(
DbInfoRel *dbInfoRel,
- int4 contentid,
int32 segmentFileNum,
int64 logicalEof)
{
@@ -1103,7 +1102,6 @@ DatabaseInfo_HandleAppendOnly(
{
DatabaseInfo_AddAppendOnlyCatalogSegmentInfo(
dbInfoRel,
- aoSegfileArray[i]->content,
aoSegfileArray[i]->segno,
aoSegfileArray[i]->eof);
}
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b9dc5a69/src/include/access/aosegfiles.h
----------------------------------------------------------------------
diff --git a/src/include/access/aosegfiles.h b/src/include/access/aosegfiles.h
index 5631512..6e22b71 100644
--- a/src/include/access/aosegfiles.h
+++ b/src/include/access/aosegfiles.h
@@ -14,13 +14,12 @@
#include "utils/tqual.h"
#include "catalog/pg_appendonly.h"
-#define Natts_pg_aoseg 6
+#define Natts_pg_aoseg 5
#define Anum_pg_aoseg_segno 1
#define Anum_pg_aoseg_eof 2
#define Anum_pg_aoseg_tupcount 3
#define Anum_pg_aoseg_varblockcount 4
#define Anum_pg_aoseg_eofuncompressed 5
-#define Anum_pg_aoseg_content 6
#define InvalidFileSegNumber -1
#define InvalidUncompressedEof -1
@@ -38,8 +37,7 @@
{ -1, {"eof"}, 701, -1, 8, 2, 0, -1, -1, true, 'p', 'd', false, false, false, true, 0 }, \
{ -1, {"tupcount"}, 701, -1, 8, 3, 0, -1, -1, true, 'p', 'd', false, false, false, true, 0 }, \
{ -1, {"varblockcount"}, 701, -1, 8, 4, 0, -1, -1, true, 'p', 'd', false, false, false, true, 0 }, \
-{ -1, {"eofuncompressed"}, 701, -1, 8, 5, 0, -1, -1, true, 'p', 'd', false, false, false, true, 0 }, \
-{ -1, {"contentid"}, 23, -1, 4, 21, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0 }
+{ -1, {"eofuncompressed"}, 701, -1, 8, 5, 0, -1, -1, true, 'p', 'd', false, false, false, true, 0 }
/*
* pg_aoseg_nnnnnn table values for FormData_pg_class.
@@ -64,7 +62,6 @@ typedef struct FileSegInfo
TupleVisibilitySummary tupleVisibilitySummary;
int segno; /* the file segment number */
- int content; /* content id of this tuple */
int64 tupcount; /* total number of tuples in this fileseg */
int64 varblockcount; /* total number of varblocks in this fileseg */
ItemPointerData sequence_tid; /* tid for the unique sequence number for this fileseg */
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b9dc5a69/src/include/access/parquetsegfiles.h
----------------------------------------------------------------------
diff --git a/src/include/access/parquetsegfiles.h b/src/include/access/parquetsegfiles.h
index 70d7b4f..37b8aab 100644
--- a/src/include/access/parquetsegfiles.h
+++ b/src/include/access/parquetsegfiles.h
@@ -30,12 +30,11 @@
#include "utils/rel.h"
#include "utils/tqual.h"
-#define Natts_pg_parquetseg 5
+#define Natts_pg_parquetseg 4
#define Anum_pg_parquetseg_segno 1
#define Anum_pg_parquetseg_eof 2
#define Anum_pg_parquetseg_tupcount 3
#define Anum_pg_parquetseg_eofuncompressed 4
-#define Anum_pg_parquetseg_content 5
#define InvalidFileSegNumber -1
#define InvalidUncompressedEof -1
@@ -50,8 +49,7 @@
{ -1, {"segno"}, 23, -1, 4, 1, 0, -1, -1, true, 'p', 'i', false, false, false, true, 0 }, \
{ -1, {"eof"}, 701, -1, 8, 2, 0, -1, -1, true, 'p', 'd', false, false, false, true, 0 }, \
{ -1, {"tupcount"}, 701, -1, 8, 3, 0, -1, -1, true, 'p', 'd', false, false, false, true, 0 }, \
-{ -1, {"eofuncompressed"}, 701, -1, 8, 5, 0, -1, -1, true, 'p', 'd', false, false, false, true, 0 }, \
-{ -1, {"contentid"}, 23, -1, 4, 21, 0, -1, -1, true, 'p', 'i', true, false, false, true, 0 }
+{ -1, {"eofuncompressed"}, 701, -1, 8, 5, 0, -1, -1, true, 'p', 'd', false, false, false, true, 0 }
/*
* pg_parquetseg_nnnnnn table values for FormData_pg_class.
@@ -69,7 +67,6 @@ typedef struct ParquetFileSegInfo {
TupleVisibilitySummary tupleVisibilitySummary;
int segno; /* the file segment number */
- int content; /* content id of this tuple */
int64 tupcount; /* total number of tuples in this fileseg */
ItemPointerData sequence_tid; /* tid for the unique sequence number for this fileseg */
[2/2] incubator-hawq git commit: HAWQ-219. Rebuild
gp_persistent_relation_node when calling gp_persistent_build_all()
Posted by ml...@apache.org.
HAWQ-219. Rebuild gp_persistent_relation_node when calling gp_persistent_build_all()
Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/b015b0fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/b015b0fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/b015b0fc
Branch: refs/heads/master
Commit: b015b0fc25b3b82391bf08050e7396b14349337c
Parents: b9dc5a6
Author: Ming LI <ml...@pivotal.io>
Authored: Tue Dec 29 11:18:22 2015 +0800
Committer: Ming LI <ml...@pivotal.io>
Committed: Tue Dec 29 11:43:41 2015 +0800
----------------------------------------------------------------------
src/backend/cdb/cdbpersistentbuild.c | 7 +++++++
1 file changed, 7 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/b015b0fc/src/backend/cdb/cdbpersistentbuild.c
----------------------------------------------------------------------
diff --git a/src/backend/cdb/cdbpersistentbuild.c b/src/backend/cdb/cdbpersistentbuild.c
index 25fe38a..0033769 100644
--- a/src/backend/cdb/cdbpersistentbuild.c
+++ b/src/backend/cdb/cdbpersistentbuild.c
@@ -303,6 +303,13 @@ static void PersistentBuild_PopulateGpRelationNode(
dbInfoRel->relname);
}*/
+ //rebuild gp_persistent_relation_node for AO tables
+ PersistentRelation_AddCreated(
+ &relFileNode,
+ &persistentTid,
+ &persistentSerialNum,
+ false);
+
/*
* Merge physical file existence and ao[cs]seg catalog logical EOFs .
*/