hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject incubator-hawq git commit: HAWQ-793. Temporarily remove the snappy info in metadata but keep the snappy support for row oriented storage.
Date Wed, 08 Jun 2016 07:04:21 GMT
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 2e7b8d749 -> fe22ef428


HAWQ-793. Temporarily remove the snappy info in metadata but keep the snappy support for row
oriented storage.


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

Branch: refs/heads/master
Commit: fe22ef4288fd9f08db67512740004922f7d71f51
Parents: 2e7b8d7
Author: Paul Guo <paulguo@gmail.com>
Authored: Wed Jun 8 13:48:44 2016 +0800
Committer: Paul Guo <paulguo@gmail.com>
Committed: Wed Jun 8 13:53:30 2016 +0800

----------------------------------------------------------------------
 src/backend/catalog/pg_compression.c | 27 +++++++++++++++++++++++++--
 src/include/catalog/pg_compression.h |  2 +-
 src/include/catalog/pg_proc.h        | 20 ++++++++++----------
 3 files changed, 36 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/fe22ef42/src/backend/catalog/pg_compression.c
----------------------------------------------------------------------
diff --git a/src/backend/catalog/pg_compression.c b/src/backend/catalog/pg_compression.c
index 8eb51d5..b073d00 100644
--- a/src/backend/catalog/pg_compression.c
+++ b/src/backend/catalog/pg_compression.c
@@ -113,6 +113,24 @@ GetCompressionImplementation(char *comptype)
 
 	compname = comptype_to_name(comptype);
 
+	/*
+	 * This is a hack: We added the snappy support for row oriented storage, however
+	 * to make the feature friendly to upgradation in short term, we decide to not
+	 * modify the system table to implement this. Following ugly hack is to
+	 * complete this. Let's remove this piece of code after snappy support is
+	 * added to the related system tables.
+	 */
+	if (strcmp(NameStr(compname), "snappy") == 0)
+	{
+		funcs = palloc0(sizeof(PGFunction) * NUM_COMPRESS_FUNCS);
+		funcs[COMPRESSION_CONSTRUCTOR] = snappy_constructor;
+		funcs[COMPRESSION_DESTRUCTOR] = snappy_destructor;
+		funcs[COMPRESSION_COMPRESS] = snappy_compress_internal;
+		funcs[COMPRESSION_DECOMPRESS] = snappy_decompress_internal;
+		funcs[COMPRESSION_VALIDATOR] = snappy_validator;
+		return funcs;
+	}
+
 	tuple = caql_getfirst(
 			NULL,
 			cql("SELECT * FROM pg_compression "
@@ -555,10 +573,15 @@ compresstype_is_valid(char *comptype)
 						 " WHERE compname = :1 ",
 						 NameGetDatum(&compname))));
 
-	/* FIXME: This is a hack. Should register gzip handlers into pg_compression table. */
+	/*
+	 * FIXME: This is a hack. Should implement related handlers and register 
+	 * in system tables instead. snappy handlers have already been implemented
+	 * but not registerd in system tables (see comment in GetCompressionImplement()
+	 * for details).
+	 */
 	if(!found)
 	{
-		if(strcmp(comptype, "gzip") == 0)
+		if(strcmp(comptype, "snappy") == 0 || strcmp(comptype, "gzip") == 0)
 			found = true;
 	}
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/fe22ef42/src/include/catalog/pg_compression.h
----------------------------------------------------------------------
diff --git a/src/include/catalog/pg_compression.h b/src/include/catalog/pg_compression.h
index eb39ba1..6c34280 100644
--- a/src/include/catalog/pg_compression.h
+++ b/src/include/catalog/pg_compression.h
@@ -117,7 +117,7 @@ typedef FormData_pg_compression *Form_pg_compression;
 /* TIDYCAT_END_CODEGEN */
 
 /* Initial contents */
-DATA(insert OID = 3069 ( snappy gp_snappy_constructor gp_snappy_destructor gp_snappy_compress
gp_snappy_decompress gp_snappy_validator PGUID ));
+/* DATA(insert OID = 3069 ( snappy gp_snappy_constructor gp_snappy_destructor gp_snappy_compress
gp_snappy_decompress gp_snappy_validator PGUID )); */
 
 DATA(insert OID = 3060 ( zlib gp_zlib_constructor gp_zlib_destructor gp_zlib_compress gp_zlib_decompress
gp_zlib_validator PGUID ));
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/fe22ef42/src/include/catalog/pg_proc.h
----------------------------------------------------------------------
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 4441126..5393282 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -10313,24 +10313,24 @@ DATA(insert OID = 3055 ( anytable_out  PGNSP PGUID 12 f f t f i
1 2275 f "3053"
 DESCR("anytable type serialization output function");
 
 /* gp_snappy_constructor(internal, internal, bool) => internal */
-DATA(insert OID = 5080 ( gp_snappy_constructor  PGNSP PGUID 12 f f f f v 3 2281 f "2281 2281
16" _null_ _null_ _null_ snappy_constructor - _null_ n ));
-DESCR("snappy constructor");
+/* DATA(insert OID = 5080 ( gp_snappy_constructor  PGNSP PGUID 12 f f f f v 3 2281 f "2281
2281 16" _null_ _null_ _null_ snappy_constructor - _null_ n )); */
+/* DESCR("snappy constructor"); */
 
 /* gp_snappy_destructor(internal) => void */
-DATA(insert OID = 5081 ( gp_snappy_destructor  PGNSP PGUID 12 f f f f v 1 2278 f "2281" _null_
_null_ _null_ snappy_destructor - _null_ n ));
-DESCR("snappy destructor");
+/* DATA(insert OID = 5081 ( gp_snappy_destructor  PGNSP PGUID 12 f f f f v 1 2278 f "2281"
_null_ _null_ _null_ snappy_destructor - _null_ n )); */
+/* DESCR("snappy destructor"); */
 
 /* gp_snappy_compress(internal, int4, internal, int4, internal, internal) => void */
-DATA(insert OID = 5082 ( gp_snappy_compress  PGNSP PGUID 12 f f f f i 6 2278 f "2281 23 2281
23 2281 2281" _null_ _null_ _null_ snappy_compress_internal - _null_ n ));
-DESCR("snappy compressor");
+/* DATA(insert OID = 5082 ( gp_snappy_compress  PGNSP PGUID 12 f f f f i 6 2278 f "2281 23
2281 23 2281 2281" _null_ _null_ _null_ snappy_compress_internal - _null_ n )); */
+/* DESCR("snappy compressor"); */
 
 /* gp_snappy_decompress(internal, int4, internal, int4, internal, internal) => void */
-DATA(insert OID = 5083 ( gp_snappy_decompress  PGNSP PGUID 12 f f f f i 6 2278 f "2281 23
2281 23 2281 2281" _null_ _null_ _null_ snappy_decompress_internal - _null_ n ));
-DESCR("snappy decompressor");
+/* DATA(insert OID = 5083 ( gp_snappy_decompress  PGNSP PGUID 12 f f f f i 6 2278 f "2281
23 2281 23 2281 2281" _null_ _null_ _null_ snappy_decompress_internal - _null_ n )); */
+/* DESCR("snappy decompressor"); */
 
 /* gp_snappy_validator(internal) => void */
-DATA(insert OID = 9926 ( gp_snappy_validator  PGNSP PGUID 12 f f f f i 1 2278 f "2281" _null_
_null_ _null_ snappy_validator - _null_ n ));
-DESCR("snappy compression validator");
+/* DATA(insert OID = 9926 ( gp_snappy_validator  PGNSP PGUID 12 f f f f i 1 2278 f "2281"
_null_ _null_ _null_ snappy_validator - _null_ n )); */
+/* DESCR("snappy compression validator"); */
 
 /* gp_quicklz_constructor(internal, internal, bool) => internal */
 DATA(insert OID = 5076 ( gp_quicklz_constructor  PGNSP PGUID 12 f f f f v 3 2281 f "2281
2281 16" _null_ _null_ _null_ quicklz_constructor - _null_ n ));


Mime
View raw message