incubator-hawq git commit: HAWQ-1208. Porting gpdb interconnect fix to hawq

2016-12-26 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 492e8b71c -> 2a077062d


HAWQ-1208. Porting gpdb interconnect fix to hawq

This commit includes below commits in gpdb:
--
commit ce9cf07073946644b9dbc9a2fa0c1ca1179c57ee
Author: xiongg1 
Date:   Wed Jun 10 19:31:05 2015 -0400

[JIRA: MPP-25589] interconnect timeout bug

commit 615934aa7cf87eab9b258cb56eae7766aabab979
Author: tangp4 
Date:   Tue Jul 7 22:00:24 2015 -0400

[JIRA: MPP-25497] Fix the coverity defect CIDs: 16672

commit ae75ad81020533e0acc69daba086581dbca68ed2
Author: TangPengzhou 
Date:   Thu May 21 17:36:30 2015 +0800

[JIRA: MPP-25497]  Shutdown interconnect thread before shmem_exit()

Sometimes, if a FATAL level error occurs, shmem_exit() freed contexts that
still being accessed by ic thread, this cause a segment fault unexpectedly.

commit 2d7d0735f5b862d62a84d446f6dd2ce44b0df250
Author: Gang Xiong 
Date:   Sun Jan 3 13:37:34 2016 -0500

[JIRA:MPP-26123] Handle corner case of interconnect ack packet

When the ack packet is resent with UDPIC_FLAGS_STOP set, we need to make
sure the sender is aware of that. Otherwise, the sender will hang there
forever.

commit ad8328423661cb64e7b905df4928e48d532653b9
Author: Heikki Linnakangas 
Date:   Sun Aug 30 00:11:17 2015 +0300

[MPP-25631] Remove unnecessary #includes.

No particular urgency to clean up just these, just something that caught my
eye while browsing the code.

commit 65809c0bf53a665a16e467331ea6e7d65aee54c6
Author: xiongg1 
Date:   Mon Jun 15 19:36:55 2015 -0400

[JIRA: MPP-25590] Wrong error message when socket is exhausted on master

commit a343ed5bfd992b10137ad232f241be72857d6ea2
Author: gpadmin 
Date:   Thu Oct 27 18:58:54 2016 +

Add GUC called gp_interconnect_tcp_listener_backlog for tcp interconnect to 
control the backlog param of listen call

commit eda343b5050e31764154698f25e88d6f3fa7e957
Author: Kenan Yao 
Date:   Tue Oct 25 16:10:05 2016 +0800

Fix a bug in function destroyConnHashTable which frees a wrong pointer and
should cause SIGSEGV.

Signed-off-by: Pengzhou Tang 

commit 616f3c8f0ea372e01d166f4a6c52c6075a74ecd3
Author: Pengzhou Tang 
Date:   Tue Apr 5 10:50:55 2016 +0800

Fix coverity issue for 7e8f391dfdd

commit 7e8f391dfdd8945573d8b621533626813f8f7684
Author: tangpengzhou 
Date:   Mon Mar 28 23:47:48 2016 +

Fix tcp socket/port leak when interconnect type is udp or udpifc

Since gpdb don't allow changing interconnect type after connection started, 
it's unnecessary to
allocate a tcp socket and port for hot switching from udp/udpifc to tcp.

commit 7e8f391dfdd8945573d8b621533626813f8f7684
Author: tangpengzhou 
Date:   Mon Mar 28 23:47:48 2016 +

Fix tcp socket/port leak when interconnect type is udp or udpifc

Since gpdb don't allow changing interconnect type after connection started, 
it's unnecessary to
allocate a tcp socket and port for hot switching from udp/udpifc to tcp.

commit 8ec73f12c99cae321c301a079f2cae2914fc
Author: Pengzhou Tang 
Date:   Thu Mar 3 15:36:06 2016 +0800

Fix incorrect EOS warning message generated by direct-dispatch type queries

QD should not expect end-of-stream comes from QEs who is not members of
direct dispatch and should not report warning message.

commit 21973ab2282701eff45f9b9448525da266843ca4
Author: Pengzhou Tang 
Date:   Thu Mar 24 16:16:11 2016 +0800

Fix ic thread waiting error in utility mode

Interconnect thread is not created in utility mode, ic_rx_thread_created is 
initialized to true which
cause WaitInterconnectQuitUDP() to wait a non-existent ic thread.

commit ba4b8ab4bce0cb62e7b1d3124012a20849434d81
Author: xiong-gang 
Date:   Fri Nov 18 17:10:41 2016 +0800

Correct 'extraSeq' in ack packet after stop is requested

If the ack packet in doSendStopMessageUDPIFC() is lost, QE will keep 
sending status packet,
and QD will ack it in handleDataPacket(). We need make sure the 'extraSeq' 
is equal to 'seq'
in the ack packet so that QE can update the capacity. Or else, QE will hang 
for ever.


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

Branch: refs/heads/master
Commit: 2a077062d30892d7c6372d1e7995234ae0aa95d5
Parents: 492e8b7
Author: Ming LI 
Authored: Fri Dec 9 19:35:12 2016 +0800
Committer: ivan 
Committed: Tue Dec 27 14:26:35 2016 +0800


incubator-hawq git commit: HAWQ-858. Fix parser to understand case / when expression in group by

2016-12-08 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master ca5d8de05 -> 093330fe6


HAWQ-858. Fix parser to understand case / when expression in group by


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

Branch: refs/heads/master
Commit: 093330fe604871c50e4bcfc459d33e57cb9985a9
Parents: ca5d8de
Author: amyrazz44 
Authored: Tue Nov 15 15:43:38 2016 +0800
Committer: ivan 
Committed: Fri Dec 9 10:20:18 2016 +0800

--
 src/backend/parser/parse_expr.c |   6 +
 src/test/feature/full_tests.txt |   2 +-
 .../feature/query/ans/parser-casegroupby.ans| 206 +++
 .../feature/query/sql/parser-casegroupby.sql| 109 ++
 src/test/feature/query/test_parser.cpp  |  28 +++
 5 files changed, 350 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/093330fe/src/backend/parser/parse_expr.c
--
diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c
index da199e5..eab5678 100644
--- a/src/backend/parser/parse_expr.c
+++ b/src/backend/parser/parse_expr.c
@@ -1385,6 +1385,12 @@ transformCaseExpr(ParseState *pstate, CaseExpr *c)
 */
if (isWhenIsNotDistinctFromExpr(warg))
{
+ /*
+* Make a copy before we change warg.
+* In transformation we don't want to change source 
(CaseExpr* Node).
+* Always create new node and do the transformation
+*/
+   warg = copyObject(warg);
A_Expr *top  = (A_Expr *) warg;
A_Expr *expr = (A_Expr *) top->rexpr;
expr->lexpr = (Node *) placeholder;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/093330fe/src/test/feature/full_tests.txt
--
diff --git a/src/test/feature/full_tests.txt b/src/test/feature/full_tests.txt
index e7dcc0c..7aa3f3d 100644
--- a/src/test/feature/full_tests.txt
+++ b/src/test/feature/full_tests.txt
@@ -2,5 +2,5 @@
 #SERIAL=* are the serial tests to run, optional but should not be empty
 #you can have several PARALLEL or SRRIAL
 
-PARALLEL=TestErrorTable.*:TestPreparedStatement.*:TestUDF.*:TestAOSnappy.*:TestAlterOwner.*:TestAlterTable.*:TestCreateTable.*:TestGuc.*:TestType.*:TestDatabase.*:TestParquet.*:TestPartition.*:TestSubplan.*:TestAggregate.*:TestCreateTypeComposite.*:TestGpDistRandom.*:TestInformationSchema.*:TestQueryInsert.*:TestQueryNestedCaseNull.*:TestQueryPolymorphism.*:TestQueryPortal.*:TestQueryPrepare.*:TestQuerySequence.*:TestCommonLib.*:TestToast.*:TestTransaction.*:TestCommand.*:TestCopy.*
+PARALLEL=TestErrorTable.*:TestPreparedStatement.*:TestUDF.*:TestAOSnappy.*:TestAlterOwner.*:TestAlterTable.*:TestCreateTable.*:TestGuc.*:TestType.*:TestDatabase.*:TestParquet.*:TestPartition.*:TestSubplan.*:TestAggregate.*:TestCreateTypeComposite.*:TestGpDistRandom.*:TestInformationSchema.*:TestQueryInsert.*:TestQueryNestedCaseNull.*:TestQueryPolymorphism.*:TestQueryPortal.*:TestQueryPrepare.*:TestQuerySequence.*:TestCommonLib.*:TestToast.*:TestTransaction.*:TestCommand.*:TestCopy.*:TestParser.*
 
SERIAL=TestHawqRegister.*:TestExternalOid.TestExternalOidAll:TestExternalTable.TestExternalTableAll:TestTemp.BasicTest:TestRowTypes.*

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/093330fe/src/test/feature/query/ans/parser-casegroupby.ans
--
diff --git a/src/test/feature/query/ans/parser-casegroupby.ans 
b/src/test/feature/query/ans/parser-casegroupby.ans
new file mode 100755
index 000..f1a8e69
--- /dev/null
+++ b/src/test/feature/query/ans/parser-casegroupby.ans
@@ -0,0 +1,206 @@
+-- start_ignore
+SET SEARCH_PATH=TestParser_TestParserCaseGroupBy;
+SET
+-- end_ignore
+--
+-- CASE ... WHEN IS NOT DISTINCT FROM ...
+--
+INSERT INTO mytable values (1,2,'t'),
+   (2,3,'e'),
+   (3,4,'o'),
+   (4,5,'o'),
+   (4,4,'o'),
+   (5,5,'t'),
+   (6,6,'t'),
+  

[2/2] incubator-hawq git commit: HAWQ-77. Fix source code comment for new ALTER/CREATE RESOURCE QUEUE ddl statements Fix contains: 1. start error message with a lowercase letter 2. avoid contractions

2016-12-05 Thread iweng
HAWQ-77. Fix source code comment for new ALTER/CREATE RESOURCE QUEUE ddl 
statements
Fix contains:
1. start error message with a lowercase letter
2. avoid contractions in error message
3. refine "can not" to "cannot"
4. add single quote to resource queue name
5. remove unused function "getLocalTmpDirFromMasterRM"


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

Branch: refs/heads/master
Commit: 10c5bb8a190ec7daa437dc6c608dd505e7da7ec2
Parents: 174673d
Author: stanlyxiang 
Authored: Wed Nov 16 21:58:12 2016 +1100
Committer: ivan 
Committed: Tue Dec 6 10:40:15 2016 +0800

--
 src/backend/commands/user.c |  18 +-
 .../communication/rmcomm_QD2RM.c| 115 ++
 src/backend/resourcemanager/requesthandler.c|  50 +--
 .../resourcemanager/requesthandler_ddl.c| 136 ---
 .../resourcebroker_LIBYARN_proc.c   |  31 +-
 src/backend/resourcemanager/resourcemanager.c   |  50 +--
 .../resourcemanager/resourcemanager_RMSEG.c |   2 +-
 src/backend/resourcemanager/resourcepool.c  |  18 +-
 src/backend/resourcemanager/resqueuecommand.c   |  12 +-
 src/backend/resourcemanager/resqueuemanager.c   | 352 +--
 10 files changed, 363 insertions(+), 421 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/10c5bb8a/src/backend/commands/user.c
--
diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c
index 65047f3..a132adb 100644
--- a/src/backend/commands/user.c
+++ b/src/backend/commands/user.c
@@ -565,7 +565,7 @@ CreateRole(CreateRoleStmt *stmt)
releaseResourceContextWithErrorReport(resourceid);
ereport(ERROR,
(errcode(ERRCODE_RESERVED_NAME),
-errmsg("Resource queue name \"%s\" is 
reserved",
+errmsg("resource queue name \"%s\" is 
reserved",
resqueue), 
errOmitLocation(true)));
}
 
@@ -576,7 +576,7 @@ CreateRole(CreateRoleStmt *stmt)
releaseResourceContextWithErrorReport(resourceid);
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
-errmsg("Resource queue \"%s\" does not 
exist",
+errmsg("resource queue \"%s\" does not 
exist",
resqueue), 
errOmitLocation(true)));
}
 
@@ -586,7 +586,7 @@ CreateRole(CreateRoleStmt *stmt)
releaseResourceContextWithErrorReport(resourceid);
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
-errmsg("Can't assign a branch resource 
queue \"%s\" to role",
+errmsg("cannot assign non-leaf 
resource queue \"%s\" to role",
resqueue), 
errOmitLocation(true)));
}
 
@@ -640,7 +640,7 @@ CreateRole(CreateRoleStmt *stmt)
(errcode(IS_TO_RM_RPC_ERROR(res) ?
 ERRCODE_INTERNAL_ERROR 
:
 
ERRCODE_INVALID_OBJECT_DEFINITION),
-errmsg("Can not apply CREATE ROLE 
because of %s", errorbuf)));
+errmsg("cannot apply CREATE ROLE 
because of %s", errorbuf)));
}
}
 
@@ -982,7 +982,7 @@ AlterRole(AlterRoleStmt *stmt)
Assert( res == COMM2RM_CLIENT_FULL_RESOURCECONTEXT );
ereport(ERROR,
(errcode(ERRCODE_INTERNAL_ERROR),
-errmsg("Too many existing resource 
context.")));
+errmsg("too many existing resource 
context.")));
 }
 
/* Here, using user oid is more convenient. */
@@ -1238,7 +1238,7 @@ AlterRole(AlterRoleStmt *stmt)

releaseResourceContextWithErrorReport(resourceid);
ereport(ERROR,

(errcode(ERRCODE_UNDEFINED_OBJECT),
-errmsg("can't assign a branch 
resource 

incubator-hawq git commit: HAWQ-1160. Hawq checkperf does not handle hostfile correctly

2016-12-05 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 10c5bb8a1 -> a9c1cee64


HAWQ-1160. Hawq checkperf does not handle hostfile correctly


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

Branch: refs/heads/master
Commit: a9c1cee64fcc0b470438e1fdc0cc29b07d007764
Parents: 10c5bb8
Author: stanlyxiang 
Authored: Wed Nov 16 15:54:59 2016 +0800
Committer: ivan 
Committed: Tue Dec 6 10:42:08 2016 +0800

--
 tools/bin/gpcheckperf | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a9c1cee6/tools/bin/gpcheckperf
--
diff --git a/tools/bin/gpcheckperf b/tools/bin/gpcheckperf
index f933c90..48850f3 100755
--- a/tools/bin/gpcheckperf
+++ b/tools/bin/gpcheckperf
@@ -351,6 +351,10 @@ def runSetup():
print ''
 okCount = 0
 try:
+#check hostfile if have -f opt
+if GV.opt['-f']:
+if not os.path.exists(GV.opt['-f']):
+sys.exit("[Error] unable to find hostfile: %s" % GV.opt['-f'])
#check python reachable
if GV.opt['-v']: print '[Info] verify python interpreter exists'
(ok, out) = gpssh('python -c print')



[1/2] incubator-hawq git commit: HAWQ-77. Fix source code comment for new ALTER/CREATE RESOURCE QUEUE ddl statements Fix contains: 1. start error message with a lowercase letter 2. avoid contractions

2016-12-05 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 174673d0d -> 10c5bb8a1


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/10c5bb8a/src/backend/resourcemanager/resqueuemanager.c
--
diff --git a/src/backend/resourcemanager/resqueuemanager.c 
b/src/backend/resourcemanager/resqueuemanager.c
index d98c11c..fe6d130 100644
--- a/src/backend/resourcemanager/resqueuemanager.c
+++ b/src/backend/resourcemanager/resqueuemanager.c
@@ -293,9 +293,9 @@ int shallowparseResourceQueueWithAttributes(List
*rawattr,
if ( attrindex == -1 )
{
snprintf(errorbuf, errorbufsize,
-"not defined DDL attribute name %s",
+"undefined DDL attribute name \'%s\'",
 property->Key.Str);
-   elog(WARNING, "Resource manager failed parsing 
attribute, %s",
+   elog(WARNING, "resource manager failed to parse 
attribute, %s",
  errorbuf);
return RMDDL_WRONG_ATTRNAME;
}
@@ -310,9 +310,9 @@ int shallowparseResourceQueueWithAttributes(List
*rawattr,
if ( parentque == NULL )
{
snprintf(errorbuf, errorbufsize,
-"cannot recognize parent 
resource queue name %s.",
+"cannot recognize parent 
resource queue name \'%s\'.",
 property->Val.Str);
-   elog(WARNING, "Resource manager failed parsing 
attribute, %s",
+   elog(WARNING, "resource manager failed to parse 
attribute, %s",
  errorbuf);
return RMDDL_WRONG_ATTRVALUE;
}
@@ -349,7 +349,7 @@ int shallowparseResourceQueueWithAttributes(List
*rawattr,
snprintf(errorbuf, errorbufsize,
 "the value of %s cannot be 
empty",
 RSQDDLAttrNames[attrindex]);
-   elog(WARNING, "Resource manager failed parsing 
attribute, %s",
+   elog(WARNING, "resource manager failed to parse 
attribute, %s",
  errorbuf);
return RMDDL_WRONG_ATTRVALUE;
}
@@ -449,7 +449,7 @@ int parseResourceQueueAttributes( List  
*attributes,
 
if ( SimpleStringEmpty(attrvalue) )
{
-   elog(DEBUG3, "No value for attribute %s.", 
attrname->Str);
+   elog(DEBUG3, "no value for attribute %s.", 
attrname->Str);
continue;
}
 
@@ -527,7 +527,7 @@ int parseResourceQueueAttributes( List  
*attributes,
 */
if ( res == FUNC_RETURN_OK )
{
-   elog(DEBUG3, "Resource manager 
parseResourceQueueAttributes() "
+   elog(DEBUG3, "resource manager 
parseResourceQueueAttributes() "
 "parsed 
segment resource quota %d MB",
 
queue->SegResourceQuotaMemoryMB);
 
@@ -556,7 +556,7 @@ int parseResourceQueueAttributes( List  
*attributes,
{
res = RESQUEMGR_WRONG_RES_QUOTA_EXP;
snprintf(errorbuf, errorbufsize,
-"%s format %s is not valid.",
+"%s format \'%s\' is invalid.",
 loadcatalog ?
 
RSQTBLAttrNames[RSQ_TBL_ATTR_VSEG_RESOURCE_QUOTA] :
 
RSQDDLAttrNames[RSQ_DDL_ATTR_VSEG_RESOURCE_QUOTA],
@@ -653,7 +653,7 @@ int parseResourceQueueAttributes( List  
*attributes,
 
RSQDDLAttrNames[attrindex],
 attrvalue->Str);
}
-   elog(WARNING, "Resource manager failed to parse 
resource queue "
+   elog(WARNING, "resource manager failed to parse 
resource queue "
  

incubator-hawq git commit: HAWQ-1188. Fix guc type issue for Gp_interconnect_transmit_timeout

2016-12-04 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 14c2d492d -> 7c05a23f0


HAWQ-1188. Fix guc type issue for Gp_interconnect_transmit_timeout


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

Branch: refs/heads/master
Commit: 7c05a23f0ef6ccb8d5d6d5f613683f8d18e29426
Parents: 14c2d49
Author: ivan 
Authored: Mon Dec 5 15:27:32 2016 +0800
Committer: ivan 
Committed: Mon Dec 5 15:27:32 2016 +0800

--
 src/backend/cdb/cdbvars.c   | 2 +-
 src/backend/cdb/motion/ic_udp.c | 4 ++--
 src/include/cdb/cdbvars.h   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/7c05a23f/src/backend/cdb/cdbvars.c
--
diff --git a/src/backend/cdb/cdbvars.c b/src/backend/cdb/cdbvars.c
index 026a765..c2fca21 100644
--- a/src/backend/cdb/cdbvars.c
+++ b/src/backend/cdb/cdbvars.c
@@ -148,7 +148,7 @@ int 
Gp_interconnect_timer_checking_period=20;
 intGp_interconnect_default_rtt=20;
 intGp_interconnect_min_rto=20;
 intGp_interconnect_fc_method=INTERCONNECT_FC_METHOD_LOSS;
-int64  Gp_interconnect_transmit_timeout=3600;
+intGp_interconnect_transmit_timeout=3600;
 intGp_interconnect_min_retries_before_timeout=100;
 
 intGp_interconnect_hash_multiplier=2;  /* sets the 
size of the hash table used by the UDP-IC */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/7c05a23f/src/backend/cdb/motion/ic_udp.c
--
diff --git a/src/backend/cdb/motion/ic_udp.c b/src/backend/cdb/motion/ic_udp.c
index 2b68f15..bcc959b 100644
--- a/src/backend/cdb/motion/ic_udp.c
+++ b/src/backend/cdb/motion/ic_udp.c
@@ -5202,7 +5202,7 @@ checkNetworkTimeout(ICBuffer *buf, uint64 now)
 * by OS for a long time. In this case, only a few times are tried.
 * Thus, the GUC Gp_interconnect_min_retries_before_timeout is added 
here.
 */
-   if ((buf->nRetry > Gp_interconnect_min_retries_before_timeout) && (now 
- buf->sentTime) > (Gp_interconnect_transmit_timeout * 1000 * 1000))
+   if ((buf->nRetry > Gp_interconnect_min_retries_before_timeout) && (now 
- buf->sentTime) > ((uint64)Gp_interconnect_transmit_timeout * 1000 * 1000))
{
ereport(ERROR, (errcode(ERRCODE_GP_INTERCONNECTION_ERROR),
errmsg("Interconnect 
encountered a network error, please check your network"),
@@ -5316,7 +5316,7 @@ checkDeadlock(ChunkTransportStateEntry *pEntry, 
MotionConn *conn)
ic_statistics.statusQueryMsgNum++;
 
/* check network error. */
-   if ((now - conn->deadlockCheckBeginTime) > 
(Gp_interconnect_transmit_timeout * 1000 * 1000))
+   if ((now - conn->deadlockCheckBeginTime) > 
((uint64)Gp_interconnect_transmit_timeout * 1000 * 1000))
{
ereport(ERROR, 
(errcode(ERRCODE_GP_INTERCONNECTION_ERROR),

errmsg("Interconnect encountered a network error, please check your network"),

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/7c05a23f/src/include/cdb/cdbvars.h
--
diff --git a/src/include/cdb/cdbvars.h b/src/include/cdb/cdbvars.h
index 8a15877..9f6c3b1 100644
--- a/src/include/cdb/cdbvars.h
+++ b/src/include/cdb/cdbvars.h
@@ -463,7 +463,7 @@ extern int  Gp_interconnect_timer_period;
 extern int Gp_interconnect_timer_checking_period;
 extern int Gp_interconnect_default_rtt;
 extern int Gp_interconnect_min_rto;
-extern int64  Gp_interconnect_transmit_timeout;
+extern int  Gp_interconnect_transmit_timeout;
 extern int Gp_interconnect_min_retries_before_timeout;
 
 /* UDP recv buf size in KB.  For testing */



incubator-hawq git commit: HAWQ-1162. Resource manager does not reference dynamic minimum water level of each segment when it times out YARN containers

2016-11-21 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 93f2983dc -> d8d597499


HAWQ-1162. Resource manager does not reference dynamic minimum water level of 
each segment when it times out YARN containers


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

Branch: refs/heads/master
Commit: d8d597499af46300e35590f18a65910df8a62fed
Parents: 93f2983
Author: amyrazz44 
Authored: Sun Nov 20 19:39:17 2016 +0800
Committer: amyrazz44 
Committed: Tue Nov 22 10:19:22 2016 +0800

--
 src/backend/resourcemanager/resourcepool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d8d59749/src/backend/resourcemanager/resourcepool.c
--
diff --git a/src/backend/resourcemanager/resourcepool.c 
b/src/backend/resourcemanager/resourcepool.c
index 567b295..22bc0eb 100644
--- a/src/backend/resourcemanager/resourcepool.c
+++ b/src/backend/resourcemanager/resourcepool.c
@@ -3545,7 +3545,7 @@ void timeoutIdleGRMResourceToRB(void)
timeoutIdleGRMResourceToRBByRatio(i,

  retcontnum,

  ,
-   
  mark->ClusterVCore > 0 ? 2 : 0 );
+   
  mark->ClusterVCore > 0 ? PQUEMGR->ActualMinGRMContainerPerSeg : 0 );
if ( realretcontnum > 0 )
{
/* Notify resource queue manager to minus 
allocated resource.*/



incubator-hawq git commit: HAWQ-1117.RM crash when init db after configure with param '--enable-cassert'

2016-11-02 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master eab1908b4 -> 0d2599462


HAWQ-1117.RM crash when init db after configure with param '--enable-cassert'


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

Branch: refs/heads/master
Commit: 0d2599462da8df97d1c91e3c3438adde2b8b66dc
Parents: eab1908
Author: stanlyxiang 
Authored: Wed Nov 2 16:14:40 2016 +0800
Committer: ivan 
Committed: Thu Nov 3 10:17:02 2016 +0800

--
 src/backend/postmaster/postmaster.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/0d259946/src/backend/postmaster/postmaster.c
--
diff --git a/src/backend/postmaster/postmaster.c 
b/src/backend/postmaster/postmaster.c
index cefcb86..023d382 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -5850,6 +5850,8 @@ BackendRun(Port *port)
if (port->cmdline_options)
maxac += (strlen(port->cmdline_options) + 1) / 2;
 
+   MemoryContextSwitchTo(TopMemoryContext);
+
av = (char **) MemoryContextAlloc(TopMemoryContext,
  maxac 
* sizeof(char *));
ac = 0;
@@ -5890,7 +5892,6 @@ BackendRun(Port *port)
 * data here.  Also, subsidiary data such as the username isn't lost
 * either; see ProcessStartupPacket().
 */
-   MemoryContextSwitchTo(TopMemoryContext);
MemoryContextDelete(PostmasterContext);
PostmasterContext = NULL;
 



incubator-hawq git commit: HAWQ-1125. Running pl/python related feature_test cases in parallel failed with error "cache lookup failed for language"

2016-10-27 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 6cefb5529 -> dc14ecbaf


HAWQ-1125. Running pl/python related feature_test cases in parallel failed with 
error "cache lookup failed for language"

Looks like an apparent race condition.


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

Branch: refs/heads/master
Commit: dc14ecbafc368a45cda5806ef7680ffe0825aef1
Parents: 6cefb55
Author: Paul Guo 
Authored: Thu Oct 27 12:32:10 2016 +0800
Committer: ivan 
Committed: Fri Oct 28 10:07:57 2016 +0800

--
 src/test/feature/UDF/ans/function_set_returning.ans | 4 
 src/test/feature/UDF/sql/function_set_returning.sql | 3 ---
 2 files changed, 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dc14ecba/src/test/feature/UDF/ans/function_set_returning.ans
--
diff --git a/src/test/feature/UDF/ans/function_set_returning.ans 
b/src/test/feature/UDF/ans/function_set_returning.ans
index 4544a2d..0a82b4b 100755
--- a/src/test/feature/UDF/ans/function_set_returning.ans
+++ b/src/test/feature/UDF/ans/function_set_returning.ans
@@ -2,10 +2,6 @@
 SET SEARCH_PATH=TestUDF_TestUDFSetReturning;
 SET
 -- end_ignore
-DROP LANGUAGE IF EXISTS plpythonu CASCADE;
-DROP LANGUAGE
-CREATE LANGUAGE plpythonu;
-CREATE LANGUAGE
 CREATE TABLE foo2(fooid int, f2 int);
 CREATE TABLE
 INSERT INTO foo2 VALUES(1, 11);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dc14ecba/src/test/feature/UDF/sql/function_set_returning.sql
--
diff --git a/src/test/feature/UDF/sql/function_set_returning.sql 
b/src/test/feature/UDF/sql/function_set_returning.sql
index 3beb31f..e3b2642 100755
--- a/src/test/feature/UDF/sql/function_set_returning.sql
+++ b/src/test/feature/UDF/sql/function_set_returning.sql
@@ -1,6 +1,3 @@
-DROP LANGUAGE IF EXISTS plpythonu CASCADE;
-CREATE LANGUAGE plpythonu;
-
 CREATE TABLE foo2(fooid int, f2 int);
 INSERT INTO foo2 VALUES(1, 11);
 INSERT INTO foo2 VALUES(2, 22);



[1/2] incubator-hawq git commit: HAWQ-1044. Enhance hawq register test cases for normal mode and force mode

2016-10-19 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 4af3768cd -> 3bcc55791


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3bcc5579/src/test/feature/ManagementTool/usage2case1/includedirectory.yml
--
diff --git a/src/test/feature/ManagementTool/usage2case1/includedirectory.yml 
b/src/test/feature/ManagementTool/usage2case1/includedirectory.yml
index c9f474d..00bfb56 100644
--- a/src/test/feature/ManagementTool/usage2case1/includedirectory.yml
+++ b/src/test/feature/ManagementTool/usage2case1/includedirectory.yml
@@ -13,7 +13,7 @@ Bucketnum: 6
 DBVersion: PostgreSQL 8.2.15 (Greenplum Database 4.2.0 build 1) (HAWQ 2.0.1.0 
build
   dev) on x86_64-apple-darwin14.5.0, compiled by GCC Apple LLVM version 6.1.0 
(clang-602.0.53)
   (based on LLVM 3.6.0svn) compiled on Jul  6 2016 10:22:33
-DFS_URL: hdfs://localhost:8020
+DFS_URL: hdfs://@PORT@
 Distribution_Policy: DISTRIBUTED RANDOMLY
 Encoding: UTF8
 FileFormat: AO

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3bcc5579/src/test/feature/ManagementTool/usage2case1/larger_eof_tpl.yml
--
diff --git a/src/test/feature/ManagementTool/usage2case1/larger_eof_tpl.yml 
b/src/test/feature/ManagementTool/usage2case1/larger_eof_tpl.yml
index a8f7911..ef9b6da 100644
--- a/src/test/feature/ManagementTool/usage2case1/larger_eof_tpl.yml
+++ b/src/test/feature/ManagementTool/usage2case1/larger_eof_tpl.yml
@@ -1,21 +1,33 @@
-AO_FileLocations:
-  Blocksize: 32768
+Bucketnum: 6
+DBVersion: PostgreSQL 8.2.15 (Greenplum Database 4.2.0 build 1) (HAWQ 2.0.1.0 
build
+  dev) on x86_64-apple-darwin14.5.0, compiled by GCC Apple LLVM version 6.1.0 
(clang-602.0.53)
+  (based on LLVM 3.6.0svn) compiled on Jul  6 2016 10:22:33
+DFS_URL: hdfs://@PORT@
+Distribution_Policy: DISTRIBUTED BY (i)
+Encoding: UTF8
+FileFormat: Parquet
+Parquet_FileLocations:
   Checksum: false
   CompressionLevel: 0
   CompressionType: null
+  EnableDictionary: false
   Files:
   - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/1
-size: 2016
-AO_Schema:
+size: 254
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/2
+size: 250
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/3
+size: 258
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/4
+size: 250
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/5
+size: 258
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/6
+size: 2700
+  PageSize: 1048576
+  RowGroupSize: 8388608
+Parquet_Schema:
 - name: i
   type: int4
-Bucketnum: 6
-DBVersion: PostgreSQL 8.2.15 (Greenplum Database 4.2.0 build 1) (HAWQ 2.0.1.0 
build
-  dev) on x86_64-apple-darwin14.5.0, compiled by GCC Apple LLVM version 6.1.0 
(clang-602.0.53)
-  (based on LLVM 3.6.0svn) compiled on Jul  6 2016 10:22:33
-DFS_URL: hdfs://localhost:8020
-Distribution_Policy: DISTRIBUTED RANDOMLY
-Encoding: UTF8
-FileFormat: AO
 TableName: public.t
 Version: 1.0.0

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3bcc5579/src/test/feature/ManagementTool/usage2case1/minus_eof_tpl.yml
--
diff --git a/src/test/feature/ManagementTool/usage2case1/minus_eof_tpl.yml 
b/src/test/feature/ManagementTool/usage2case1/minus_eof_tpl.yml
new file mode 100644
index 000..c2470b0
--- /dev/null
+++ b/src/test/feature/ManagementTool/usage2case1/minus_eof_tpl.yml
@@ -0,0 +1,33 @@
+Bucketnum: 6
+DBVersion: PostgreSQL 8.2.15 (Greenplum Database 4.2.0 build 1) (HAWQ 2.0.1.0 
build
+  dev) on x86_64-apple-darwin14.5.0, compiled by GCC Apple LLVM version 6.1.0 
(clang-602.0.53)
+  (based on LLVM 3.6.0svn) compiled on Jul  6 2016 10:22:33
+DFS_URL: hdfs://@PORT@
+Distribution_Policy: DISTRIBUTED BY (i)
+Encoding: UTF8
+FileFormat: Parquet
+Parquet_FileLocations:
+  Checksum: false
+  CompressionLevel: 0
+  CompressionType: null
+  EnableDictionary: false
+  Files:
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/1
+size: 254
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/2
+size: 250
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/3
+size: 258
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/4
+size: 250
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/5
+size: 258
+  - path: /hawq_default/16385/@DATABASE_OID@/@TABLE_OID@/6
+size: -270
+  PageSize: 1048576
+  RowGroupSize: 8388608
+Parquet_Schema:
+- name: i
+  type: int4
+TableName: public.t
+Version: 1.0.0

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3bcc5579/src/test/feature/ManagementTool/usage2case1/wrong_distributed_policy_tpl.yml
--
diff --git 
a/src/test/feature/ManagementTool/usage2case1/wrong_distributed_policy_tpl.yml 
b/src/test/feature/ManagementTool/usage2case1/wrong_distributed_policy_tpl.yml
index 

[2/2] incubator-hawq git commit: HAWQ-1044. Enhance hawq register test cases for normal mode and force mode

2016-10-19 Thread iweng
HAWQ-1044. Enhance hawq register test cases for normal mode and force mode


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

Branch: refs/heads/master
Commit: 3bcc557917cf8962d9963f59d634877f9c262d76
Parents: 4af3768
Author: Chunling Wang 
Authored: Wed Oct 19 18:35:09 2016 +0800
Committer: Chunling Wang 
Committed: Wed Oct 19 18:35:29 2016 +0800

--
 .../backup_usage2case1/bucket0_tpl.yml  |  31 ++
 .../contain_error_symbol_tpl.yml|  31 ++
 .../backup_usage2case1/error_blockszie_tpl.yml  |  31 ++
 .../backup_usage2case1/error_checksum_tpl.yml   |  31 ++
 .../error_compresslevel_tpl.yml |  31 ++
 .../error_compresstype_tpl.yml  |  31 ++
 .../backup_usage2case1/error_encoding_tpl.yml   |  31 ++
 .../backup_usage2case1/error_pagesize_tpl.yml   |  31 ++
 .../error_rowgroupsize_tpl.yml  |  31 ++
 .../backup_usage2case1/error_schema_tpl.yml |  33 +++
 .../backup_usage2case1/float_eof_tpl.yml|  31 ++
 .../backup_usage2case1/larger_eof_tpl.yml   |  31 ++
 .../backup_usage2case1/minus_eof_tpl.yml|  31 ++
 .../wrong_distributed_policy_tpl.yml|  31 ++
 .../feature/ManagementTool/test_hawq_register.h |   4 +
 .../test_hawq_register_rollback.cpp | 111 +++
 .../test_hawq_register_usage2_case1.cpp | 162 ---
 .../test_hawq_register_usage2_case2.cpp | 291 +++
 .../test_hawq_register_usage2_case3.cpp |   4 +
 .../ManagementTool/usage2case1/bucket0_tpl.yml  |  36 +--
 .../usage2case1/contain_error_symbol_tpl.yml|  33 +++
 .../usage2case1/error_blocksize_tpl.yml |  31 ++
 .../usage2case1/error_checksum_tpl.yml  |  33 +++
 .../usage2case1/error_columnnum_tpl.yml |  35 +++
 .../usage2case1/error_compresslevel_tpl.yml |  33 +++
 .../usage2case1/error_compresstype_tpl.yml  |  33 +++
 .../usage2case1/error_encoding_tpl.yml  |  36 ++-
 .../usage2case1/error_format_tpl.yml|  32 ++
 .../usage2case1/error_pagesize_tpl.yml  |  33 +++
 .../usage2case1/error_rowgroupsize_tpl.yml  |  33 +++
 .../usage2case1/error_schema_tpl.yml|  33 +++
 .../file_under_table_directory_tpl.yml  |  33 +++
 .../usage2case1/float_eof_tpl.yml   |  33 +++
 .../usage2case1/includedirectory.yml|   2 +-
 .../usage2case1/larger_eof_tpl.yml  |  36 ++-
 .../usage2case1/minus_eof_tpl.yml   |  33 +++
 .../wrong_distributed_policy_tpl.yml|  36 ++-
 .../ManagementTool/usage2case1/zero_eof_tpl.yml |  33 +++
 .../ManagementTool/usage2case2/bucket0_tpl.yml  |  45 +++
 .../usage2case2/contain_error_symbol_tpl.yml|  45 +++
 .../usage2case2/error_blocksize_tpl.yml |  43 +++
 .../usage2case2/error_checksum_tpl.yml  |  45 +++
 .../usage2case2/error_columnnum_tpl.yml |  47 +++
 .../usage2case2/error_compresslevel_tpl.yml |  45 +++
 .../usage2case2/error_compresstype_tpl.yml  |  45 +++
 .../usage2case2/error_encoding_tpl.yml  |  45 +++
 .../usage2case2/error_format_tpl.yml|  44 +++
 .../usage2case2/error_pagesize_tpl.yml  |  45 +++
 .../usage2case2/error_rowgroupsize_tpl.yml  |  45 +++
 .../usage2case2/file_in_yaml_not_exist_tpl.yml  |  45 +++
 .../file_not_included_in_yaml_config_tpl.yml|  43 +++
 .../usage2case2/float_eof_tpl.yml   |  45 +++
 .../usage2case2/hash_to_random_tpl.yml  |  35 +++
 .../usage2case2/larger_eof_tpl.yml  |  45 +++
 .../usage2case2/minus_eof_tpl.yml   |  45 +++
 .../usage2case2/normal_yaml_config_tpl.yml  |  45 +++
 .../normal_yaml_no_update_config_tpl.yml|  33 +++
 .../usage2case2/random_to_hash_tpl.yml  |  35 +++
 .../ManagementTool/usage2case2/t_tpl_1.yml  |   2 +-
 .../ManagementTool/usage2case2/t_tpl_2.yml  |   2 +-
 .../ManagementTool/usage2case2/t_tpl_3.yml  |   2 +-
 .../ManagementTool/usage2case2/t_tpl_4.yml  |   2 +-
 .../ManagementTool/usage2case2/t_tpl_new_1.yml  |   2 +-
 .../ManagementTool/usage2case2/t_tpl_new_2.yml  |   2 +-
 .../ManagementTool/usage2case2/t_tpl_new_3.yml  |   2 +-
 .../ManagementTool/usage2case2/t_tpl_new_4.yml  |   2 +-
 .../usage2case2/table_exist_no_data_tpl.yml |  33 +++
 .../usage2case2/table_not_exists_tpl.yml|  33 +++
 .../wrong_distributed_policy_tpl.yml|  45 +++
 .../ManagementTool/usage2case2/zero_eof_tpl.yml |  45 +++
 .../ManagementTool/usage2case3/t_tpl_old_1.yml  |   2 +-
 .../ManagementTool/usage2case3/t_tpl_old_2.yml  |   2 +-
 

incubator-hawq git commit: HAWQ-1017. Add feature test for goh_create_type_composite with new test framework

2016-09-13 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 0664852a8 -> 49ceb69e6


HAWQ-1017. Add feature test for goh_create_type_composite with new test 
framework


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

Branch: refs/heads/master
Commit: 49ceb69e62d5982eadad7dd75a2027abe7beebd2
Parents: 0664852
Author: ivan 
Authored: Tue Sep 13 09:15:36 2016 +0800
Committer: ivan 
Committed: Wed Sep 14 09:47:01 2016 +0800

--
 .../query/ans/goh_create_type_composite.ans | 202 +++
 .../query/sql/goh_create_type_composite.sql |  96 +
 .../query/test_create_type_composite.cpp|  20 ++
 3 files changed, 318 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/49ceb69e/src/test/feature/query/ans/goh_create_type_composite.ans
--
diff --git a/src/test/feature/query/ans/goh_create_type_composite.ans 
b/src/test/feature/query/ans/goh_create_type_composite.ans
new file mode 100644
index 000..6edd9a0
--- /dev/null
+++ b/src/test/feature/query/ans/goh_create_type_composite.ans
@@ -0,0 +1,202 @@
+--
+-- CREATE_TYPE
+--
+--
+-- Note: widget_in/out were created in create_function_1, without any
+-- prior shell-type creation.  These commands therefore complete a test
+-- of the "old style" approach of making the functions first.
+--
+-- start_ignore
+drop database hdfs;
+DROP DATABASE
+-- end_ignore
+create database hdfs;
+CREATE DATABASE
+\c hdfs
+You are now connected to database "hdfs" as user "ivan".
+-- Test stand-alone composite type
+create type temp_type_1 as (a int, b int);
+CREATE TYPE
+create type temp_type_2 as (a int, b int);
+CREATE TYPE
+create table temp_table (id int, a temp_type_1, b temp_type_2) distributed 
randomly;
+CREATE TABLE
+insert into temp_table values (1, (1,2), (3,4));
+INSERT 0 1
+insert into temp_table values (2, (5,6), (7,8));
+INSERT 0 1
+insert into temp_table values (3, (9,10), (11,12));
+INSERT 0 1
+\d temp_table
+Append-Only Table "public.temp_table"
+ Column |Type | Modifiers 
++-+---
+ id | integer | 
+ a  | temp_type_1 | 
+ b  | temp_type_2 | 
+Compression Type: None
+Compression Level: 0
+Block Size: 32768
+Checksum: f
+Distributed randomly
+
+select * from temp_table order by 1;
+ id |   a|b
+++-
+  1 | (1,2)  | (3,4)
+  2 | (5,6)  | (7,8)
+  3 | (9,10) | (11,12)
+(3 rows)
+
+drop table temp_table;
+DROP TABLE
+create type temp_type_3 as (a temp_type_1, b temp_type_2);
+CREATE TYPE
+CREATE table temp_table (id int, a temp_type_1, b temp_type_3) distributed 
randomly;
+CREATE TABLE
+insert into temp_table values (1, (9,10), ((11,12),(7,8)));
+INSERT 0 1
+insert into temp_table values (2, (1,2), ((3,4),(5,6)));
+INSERT 0 1
+select * from temp_table order by 1;
+ id |   a|  b  
+++-
+  1 | (9,10) | ("(11,12)","(7,8)")
+  2 | (1,2)  | ("(3,4)","(5,6)")
+(2 rows)
+
+-- check catalog entries for types
+select count(typrelid) from pg_type where typname like 'temp_type_%';
+ count 
+---
+ 3
+(1 row)
+
+comment on type temp_type_1 is 'test composite type';
+COMMENT
+\dT temp_type_1
+ List of data types
+ Schema |Name | Description 
++-+-
+ public | temp_type_1 | test composite type
+(1 row)
+
+select count(reltype) from pg_class where relname like 'temp_type%';
+ count 
+---
+ 3
+(1 row)
+
+create table test_func (foo temp_type_1);
+CREATE TABLE
+insert into test_func values((1,2));
+INSERT 0 1
+insert into test_func values((3,4));
+INSERT 0 1
+insert into test_func values((5,6));
+INSERT 0 1
+insert into test_func values((7,8));
+INSERT 0 1
+-- Functions with UDTs
+create function test_temp_func(temp_type_1, temp_type_2) RETURNS temp_type_1 
AS '
+  select foo from test_func where (foo).a = 3;
+' LANGUAGE SQL; 
+CREATE FUNCTION
+SELECT * FROM test_temp_func((7,8), (5,6));
+ a | b 
+---+---
+ 3 | 4
+(1 row)
+
+drop function test_temp_func(temp_type_1, temp_type_2);
+DROP FUNCTION
+-- UDT and UDA
+create or replace function test_temp_func_2(temp_type_1, temp_type_1) RETURNS 
temp_type_1 AS '
+  select ($1.a + $2.a, $1.b + $2.b)::temp_type_1;
+' LANGUAGE SQL; 
+CREATE FUNCTION
+CREATE AGGREGATE agg_comp_type (temp_type_1) (
+   sfunc = test_temp_func_2, stype = temp_type_1,
+   initcond = '(0,0)'
+);
+CREATE AGGREGATE
+select agg_comp_type(foo) from test_func;
+ agg_comp_type 
+---
+ (16,20)
+(1 row)
+
+-- Check 

[2/3] incubator-hawq git commit: HAWQ-1037. Get HDFS namenode host from HAWQ catalog tables instead of from HDFS configuration file

2016-09-08 Thread iweng
HAWQ-1037. Get HDFS namenode host from HAWQ catalog tables instead of from HDFS 
configuration file


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

Branch: refs/heads/master
Commit: 65b0e27c93dad8fce9e84fb0c8c1eb03e761cfdd
Parents: 4b202a2
Author: Chunling Wang 
Authored: Wed Sep 7 10:40:40 2016 +0800
Committer: ivan 
Committed: Fri Sep 9 10:00:14 2016 +0800

--
 .../feature/ManagementTool/test_hawq_register.cpp   | 16 +++-
 src/test/feature/lib/hdfs_config.cpp| 14 ++
 src/test/feature/lib/hdfs_config.h  |  7 +++
 3 files changed, 24 insertions(+), 13 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/65b0e27c/src/test/feature/ManagementTool/test_hawq_register.cpp
--
diff --git a/src/test/feature/ManagementTool/test_hawq_register.cpp 
b/src/test/feature/ManagementTool/test_hawq_register.cpp
index 2f4291b..385f959 100644
--- a/src/test/feature/ManagementTool/test_hawq_register.cpp
+++ b/src/test/feature/ManagementTool/test_hawq_register.cpp
@@ -19,19 +19,9 @@ class TestHawqRegister : public ::testing::Test {
   ~TestHawqRegister() {}
   string getHdfsLocation() {
 HdfsConfig hc;
-string hostname = "";
-int port = 0;
-if (hc.isHA()) {
-  hc.getActiveNamenode(hostname, port);
-}
-else {
-  std::vector hostList;
-  std::vector portList;
-  hc.getNamenodes(hostList, portList);
-  hostname = hostList[0];
-  port = portList[0];
-}
-return hawq::test::stringFormat("hdfs://%s:%d", hostname.c_str(), port);
+string namenodehost = "";
+EXPECT_EQ(true, hc.getNamenodeHost(namenodehost));
+return hawq::test::stringFormat("hdfs://%s", namenodehost.c_str());
   }
 };
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/65b0e27c/src/test/feature/lib/hdfs_config.cpp
--
diff --git a/src/test/feature/lib/hdfs_config.cpp 
b/src/test/feature/lib/hdfs_config.cpp
index cded21e..8a8ed81 100644
--- a/src/test/feature/lib/hdfs_config.cpp
+++ b/src/test/feature/lib/hdfs_config.cpp
@@ -172,6 +172,20 @@ string HdfsConfig::getHadoopHome() {
   return hadoopHome;
 }
 
+bool HdfsConfig::getNamenodeHost(string ) {
+  const hawq::test::PSQLQueryResult  = psql.getQueryResult(
+   "SELECT substring(fselocation from length('hdfs:// ') for (position('/' 
in substring(fselocation from length('hdfs:// ')))-1)::int) "
+   "FROM pg_filespace pgfs, pg_filespace_entry pgfse "
+   "WHERE pgfs.fsname = 'dfs_system' AND pgfse.fsefsoid=pgfs.oid ;");
+  std::vector table = result.getRows();
+  if (table.size() > 0) {
+namenodehost = table[0][0];
+return true;
+  }
+
+  return false;
+}
+
 bool HdfsConfig::getActiveNamenode(string ,
int ) {
 return getHANamenode("active", activenamenode, port);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/65b0e27c/src/test/feature/lib/hdfs_config.h
--
diff --git a/src/test/feature/lib/hdfs_config.h 
b/src/test/feature/lib/hdfs_config.h
index 2b68db1..6b57588 100644
--- a/src/test/feature/lib/hdfs_config.h
+++ b/src/test/feature/lib/hdfs_config.h
@@ -56,6 +56,13 @@ class HdfsConfig {
 std::string getHadoopHome();
 
 /**
+ * get HDFS namenode's host ('hostname:port' for non-HA, 'servicename' for 
HA)
+ * @ param namenodehost, namenode host reference which will be set
+ * @ return true if getNamenodeHost succeeded
+ */
+bool getNamenodeHost(std::string );
+
+/**
  * get HDFS active namenode's hostname and port information
  * @param activenamenode, active namenode hostname reference which will be 
set
  * @param port, active namenode port reference which will be set



[3/3] incubator-hawq git commit: HAWQ-1037. Modify way to get HDFS port in TestHawqRegister

2016-09-08 Thread iweng
HAWQ-1037. Modify way to get HDFS port in TestHawqRegister


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

Branch: refs/heads/master
Commit: 4b202a2baae5e3ecca0fc68f10a6d2e0f4cbecc9
Parents: 51cf863
Author: Chunling Wang 
Authored: Wed Aug 31 18:19:05 2016 +0800
Committer: ivan 
Committed: Fri Sep 9 10:00:14 2016 +0800

--
 .../ManagementTool/test_hawq_register.cpp   | 122 +--
 1 file changed, 87 insertions(+), 35 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/4b202a2b/src/test/feature/ManagementTool/test_hawq_register.cpp
--
diff --git a/src/test/feature/ManagementTool/test_hawq_register.cpp 
b/src/test/feature/ManagementTool/test_hawq_register.cpp
index 0952bd5..2f4291b 100644
--- a/src/test/feature/ManagementTool/test_hawq_register.cpp
+++ b/src/test/feature/ManagementTool/test_hawq_register.cpp
@@ -3,18 +3,36 @@
 #include "lib/command.h"
 #include "lib/sql_util.h"
 #include "lib/string_util.h"
+#include "lib/hdfs_config.h"
 
 #include "gtest/gtest.h"
 
 using std::string;
 using hawq::test::SQLUtility;
 using hawq::test::Command;
+using hawq::test::HdfsConfig;
 
 /* This test suite may consume more than 80 seconds. */
 class TestHawqRegister : public ::testing::Test {
  public:
   TestHawqRegister() {}
   ~TestHawqRegister() {}
+  string getHdfsLocation() {
+HdfsConfig hc;
+string hostname = "";
+int port = 0;
+if (hc.isHA()) {
+  hc.getActiveNamenode(hostname, port);
+}
+else {
+  std::vector hostList;
+  std::vector portList;
+  hc.getNamenodes(hostList, portList);
+  hostname = hostList[0];
+  port = portList[0];
+}
+return hawq::test::stringFormat("hdfs://%s:%d", hostname.c_str(), port);
+  }
 };
 
 TEST_F(TestHawqRegister, TestUsage1SingleHawqFile) {
@@ -23,12 +41,14 @@ TEST_F(TestHawqRegister, TestUsage1SingleHawqFile) {
string relativePath("/ManagementTool/test_hawq_register_hawq.paq");
string filePath = rootPath + relativePath;
 
-   EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath 
+ " hdfs://localhost:8020/hawq_register_hawq.paq"));
+auto cmd = hawq::test::stringFormat("hadoop fs -put -f %s 
%s/hawq_register_hawq.paq", filePath.c_str(), getHdfsLocation().c_str());
+   EXPECT_EQ(0, Command::getCommandStatus(cmd));
 
util.execute("create table hawqregister(i int) with (appendonly=true, 
orientation=parquet);");
util.query("select * from hawqregister;", 0);
 
-   EXPECT_EQ(0, Command::getCommandStatus("hawq register -d " + (string) 
HAWQ_DB + " -f hdfs://localhost:8020/hawq_register_hawq.paq hawqregister"));
+cmd = hawq::test::stringFormat("hawq register -d %s -f 
%s/hawq_register_hawq.paq hawqregister", HAWQ_DB, getHdfsLocation().c_str());
+   EXPECT_EQ(0, Command::getCommandStatus(cmd));
 
util.query("select * from hawqregister;", 3);
util.execute("insert into hawqregister values(1);");
@@ -42,12 +62,14 @@ TEST_F(TestHawqRegister, TestUsage1SingleHiveFile) {
string relativePath("/ManagementTool/test_hawq_register_hive.paq");
string filePath = rootPath + relativePath;
 
-   EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath 
+ " hdfs://localhost:8020/hawq_register_hive.paq"));
+auto cmd = hawq::test::stringFormat("hadoop fs -put -f %s 
%s/hawq_register_hive.paq", filePath.c_str(), getHdfsLocation().c_str());
+   EXPECT_EQ(0, Command::getCommandStatus(cmd));
 
util.execute("create table hawqregister(i int) with (appendonly=true, 
orientation=parquet);");
util.query("select * from hawqregister;", 0);
 
-   EXPECT_EQ(0, Command::getCommandStatus("hawq register -d " + (string) 
HAWQ_DB + " -f hdfs://localhost:8020/hawq_register_hive.paq hawqregister"));
+cmd = hawq::test::stringFormat("hawq register -d %s -f 
%s/hawq_register_hive.paq hawqregister", HAWQ_DB, getHdfsLocation().c_str());
+   EXPECT_EQ(0, Command::getCommandStatus(cmd));
 
util.query("select * from hawqregister;", 1);
util.execute("insert into hawqregister values(1);");
@@ -63,12 +85,14 @@ TEST_F(TestHawqRegister, TestDataTypes) {
string 
relativePath("/ManagementTool/test_hawq_register_data_types.paq");
string filePath = rootPath + relativePath;
 
-   EXPECT_EQ(0, Command::getCommandStatus("hadoop fs -put -f " + filePath 
+ " hdfs://localhost:8020/hawq_register_data_types.paq"));
+auto cmd = hawq::test::stringFormat("hadoop fs -put -f %s 

incubator-hawq git commit: HAWQ-1016. Add feature test for rowtypes with new test framework

2016-09-08 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master a3da49167 -> 51cf8634d


HAWQ-1016. Add feature test for rowtypes with new test framework


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

Branch: refs/heads/master
Commit: 51cf8634d2ce920e2eeaa8e9b65bcc8acb584156
Parents: a3da491
Author: ivan 
Authored: Wed Aug 31 11:31:28 2016 +0800
Committer: ivan 
Committed: Fri Sep 9 09:50:51 2016 +0800

--
 src/test/feature/query/ans/rowtypes.ans  | 283 ++
 src/test/feature/query/sql/rowtypes.sql  | 111 ++
 src/test/feature/query/test_rowtypes.cpp |  44 
 3 files changed, 438 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/51cf8634/src/test/feature/query/ans/rowtypes.ans
--
diff --git a/src/test/feature/query/ans/rowtypes.ans 
b/src/test/feature/query/ans/rowtypes.ans
new file mode 100755
index 000..d421581
--- /dev/null
+++ b/src/test/feature/query/ans/rowtypes.ans
@@ -0,0 +1,283 @@
+-- start_ignore
+SET SEARCH_PATH=TestRowTypes_BasicTest;
+SET
+-- end_ignore
+--
+-- ROWTYPES
+--
+-- Make both a standalone composite type and a table rowtype
+create type complex as (r float8, i float8);
+CREATE TYPE
+create temp table fullname (first text, last text);
+CREATE TABLE
+-- Nested composite
+create type quad as (c1 complex, c2 complex);
+CREATE TYPE
+-- Some simple tests of I/O conversions and row construction
+select (1.1,2.2)::complex, row((3.3,4.4),(5.5,null))::quad;
+row|  row   
+---+
+ (1.1,2.2) | ("(3.3,4.4)","(5.5,)")
+(1 row)
+
+select row('Joe', 'Blow')::fullname, '(Joe,Blow)'::fullname;
+row |  fullname  
++
+ (Joe,Blow) | (Joe,Blow)
+(1 row)
+
+select '(Joe,von Blow)'::fullname, '(Joe,d''Blow)'::fullname;
+ fullname |   fullname   
+--+--
+ (Joe,"von Blow") | (Joe,d'Blow)
+(1 row)
+
+select '(Joe,"von""Blow")'::fullname, E'(Joe,dBlow)'::fullname;
+ fullname  |fullname 
+---+-
+ (Joe,"von""Blow") | (Joe,"d\\Blow")
+(1 row)
+
+select '(Joe,"Blow,Jr")'::fullname;
+fullname 
+-
+ (Joe,"Blow,Jr")
+(1 row)
+
+select '(Joe,)'::fullname; -- ok, null 2nd column
+ fullname 
+--
+ (Joe,)
+(1 row)
+
+select '(Joe)'::fullname;  -- bad
+psql:/tmp/TestRowTypes_BasicTest.sql:31: ERROR:  malformed record literal: 
"(Joe)"
+LINE 1: select '(Joe)'::fullname;
+   ^
+DETAIL:  Too few columns.
+select '(Joe,,)'::fullname;-- bad
+psql:/tmp/TestRowTypes_BasicTest.sql:32: ERROR:  malformed record literal: 
"(Joe,,)"
+LINE 1: select '(Joe,,)'::fullname;
+   ^
+DETAIL:  Too many columns.
+create temp table quadtable(f1 int, q quad);
+CREATE TABLE
+insert into quadtable values (1, ((3.3,4.4),(5.5,6.6)));
+INSERT 0 1
+insert into quadtable values (2, ((null,4.4),(5.5,6.6)));
+INSERT 0 1
+select * from quadtable;
+ f1 | q 
++---
+  1 | ("(3.3,4.4)","(5.5,6.6)")
+  2 | ("(,4.4)","(5.5,6.6)")
+(2 rows)
+
+begin;
+BEGIN
+set local add_missing_from = false;
+SET
+select f1, q.c1 from quadtable;-- fails, q is a table reference
+psql:/tmp/TestRowTypes_BasicTest.sql:43: ERROR:  missing FROM-clause entry for 
table "q"
+LINE 1: select f1, q.c1 from quadtable;
+   ^
+rollback;
+ROLLBACK
+select f1, (q).c1, (qq.q).c1.i from quadtable qq;
+ f1 |c1 |  i  
++---+-
+  1 | (3.3,4.4) | 4.4
+  2 | (,4.4)| 4.4
+(2 rows)
+
+create temp table people (fn fullname, bd date);
+CREATE TABLE
+insert into people values ('(Joe,Blow)', '1984-01-10');
+INSERT 0 1
+select * from people;
+ fn | bd 
++
+ (Joe,Blow) | 01-10-1984
+(1 row)
+
+-- at the moment this will not work due to ALTER TABLE inadequacy:
+alter table fullname add column suffix text default '';
+psql:/tmp/TestRowTypes_BasicTest.sql:55: ERROR:  cannot alter table "fullname" 
because column "people"."fn" uses its rowtype
+-- Not supported in HAWQ
+alter table fullname add column suffix text default null;
+psql:/tmp/TestRowTypes_BasicTest.sql:58: ERROR:  cannot alter table "fullname" 
because column "people"."fn" uses its rowtype
+select * from people;
+ fn | bd 
++
+ (Joe,Blow) | 01-10-1984
+(1 row)
+
+-- test insertion/updating of subfields, not supported in HAWQ
+update people set fn.suffix = 'Jr';

[incubator-hawq] Git Push Summary

2016-09-05 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/2.0.0.0-incubating-HAWQ-958 [created] 9bdad43eb


incubator-hawq git commit: HAWQ-1018. Add feature test for goh_gp_dist_random with new test framework

2016-08-29 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master cb80c3331 -> 569f7545d


HAWQ-1018. Add feature test for goh_gp_dist_random with new test framework


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

Branch: refs/heads/master
Commit: 569f7545d289a396f9c002bb304b613a89c3cfc1
Parents: cb80c33
Author: ivan 
Authored: Tue Aug 30 09:52:52 2016 +0800
Committer: ivan 
Committed: Tue Aug 30 09:52:52 2016 +0800

--
 .../feature/query/ans/goh_gp_dist_random.ans | 15 +++
 .../feature/query/sql/goh_gp_dist_random.sql |  6 ++
 src/test/feature/query/test_gp_dist_random.cpp   | 19 +++
 3 files changed, 40 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/569f7545/src/test/feature/query/ans/goh_gp_dist_random.ans
--
diff --git a/src/test/feature/query/ans/goh_gp_dist_random.ans 
b/src/test/feature/query/ans/goh_gp_dist_random.ans
new file mode 100644
index 000..7c3adec
--- /dev/null
+++ b/src/test/feature/query/ans/goh_gp_dist_random.ans
@@ -0,0 +1,15 @@
+select count(*) > 0 as c from gp_dist_random('pg_class');
+ c 
+---
+ t
+(1 row)
+
+select relname from gp_dist_random('pg_class') c
+  inner join gp_dist_random('pg_namespace') n
+on c.gp_segment_id = n.gp_segment_id
+  and c.relnamespace = n.oid
+  where n.nspname = 'nonexistent';
+ relname 
+-
+(0 rows)
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/569f7545/src/test/feature/query/sql/goh_gp_dist_random.sql
--
diff --git a/src/test/feature/query/sql/goh_gp_dist_random.sql 
b/src/test/feature/query/sql/goh_gp_dist_random.sql
new file mode 100644
index 000..d476520
--- /dev/null
+++ b/src/test/feature/query/sql/goh_gp_dist_random.sql
@@ -0,0 +1,6 @@
+select count(*) > 0 as c from gp_dist_random('pg_class');
+select relname from gp_dist_random('pg_class') c
+  inner join gp_dist_random('pg_namespace') n
+on c.gp_segment_id = n.gp_segment_id
+  and c.relnamespace = n.oid
+  where n.nspname = 'nonexistent';

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/569f7545/src/test/feature/query/test_gp_dist_random.cpp
--
diff --git a/src/test/feature/query/test_gp_dist_random.cpp 
b/src/test/feature/query/test_gp_dist_random.cpp
new file mode 100644
index 000..476911d
--- /dev/null
+++ b/src/test/feature/query/test_gp_dist_random.cpp
@@ -0,0 +1,19 @@
+#include "gtest/gtest.h"
+
+#include "lib/sql_util.h"
+
+using std::string;
+
+class TestGpDistRandom: public ::testing::Test
+{
+   public:
+   TestGpDistRandom() { }
+   ~TestGpDistRandom() {}
+};
+
+TEST_F(TestGpDistRandom, BasicTest)
+{
+   hawq::test::SQLUtility util;
+   util.execSQLFile("query/sql/goh_gp_dist_random.sql",
+"query/ans/goh_gp_dist_random.ans");
+}



incubator-hawq git commit: HAWQ-1015. Add feature test for transactions with new test framework

2016-08-29 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 27022e561 -> cb80c3331


HAWQ-1015. Add feature test for transactions with new test framework


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

Branch: refs/heads/master
Commit: cb80c333176e38a29eba618b70440b12f1b4ab33
Parents: 27022e5
Author: ivan 
Authored: Mon Aug 29 11:01:31 2016 +0800
Committer: ivan 
Committed: Tue Aug 30 09:46:28 2016 +0800

--
 .../feature/transactions/ans/transactions.ans   | 558 +++
 .../feature/transactions/sql/transactions.sql   | 342 
 .../feature/transactions/test_transactions.cpp  |  19 +
 3 files changed, 919 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/cb80c333/src/test/feature/transactions/ans/transactions.ans
--
diff --git a/src/test/feature/transactions/ans/transactions.ans 
b/src/test/feature/transactions/ans/transactions.ans
new file mode 100755
index 000..35669f4
--- /dev/null
+++ b/src/test/feature/transactions/ans/transactions.ans
@@ -0,0 +1,558 @@
+--
+-- TRANSACTIONS
+--
+CREATE TABLE aggtest (
+a   int2,
+b   float4
+);
+CREATE TABLE
+INSERT INTO aggtest VALUES (56, 7.8), (100, 99.097), (0, 0.09561), (42, 
324.78);
+INSERT 0 4
+BEGIN;
+BEGIN
+SELECT * 
+   INTO TABLE xacttest
+   FROM aggtest;
+SELECT 4
+INSERT INTO xacttest (a, b) VALUES (777, 777.777);
+INSERT 0 1
+END;
+COMMIT
+-- should retrieve one value--
+SELECT a FROM xacttest WHERE a > 100;
+  a  
+-
+ 777
+(1 row)
+
+BEGIN;
+BEGIN
+CREATE TABLE disappear (a int4);
+CREATE TABLE
+TRUNCATE aggtest;
+TRUNCATE TABLE
+-- should be empty
+SELECT * FROM aggtest;
+ a | b 
+---+---
+(0 rows)
+
+ABORT;
+ROLLBACK
+-- should not exist 
+SELECT oid FROM pg_class WHERE relname = 'disappear';
+ oid 
+-
+(0 rows)
+
+-- should have members again 
+SELECT * FROM aggtest;
+  a  |b
+-+-
+  56 | 7.8
+ 100 |  99.097
+   0 | 0.09561
+  42 |  324.78
+(4 rows)
+
+drop table aggtest;
+DROP TABLE
+-- Read-only tests
+CREATE TABLE writetest (a int);
+CREATE TABLE
+CREATE TEMPORARY TABLE temptest (a int);
+CREATE TABLE
+SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY;
+SET
+DROP TABLE writetest; -- fail
+psql:/tmp/TestTransaction_BasicTest.sql:56: ERROR:  transaction is read-only
+INSERT INTO writetest VALUES (1); -- fail
+psql:/tmp/TestTransaction_BasicTest.sql:57: ERROR:  transaction is read-only
+SELECT * FROM writetest; -- ok
+ a 
+---
+(0 rows)
+
+-- DELETE FROM temptest; -- ok
+-- UPDATE temptest SET a = 0 FROM writetest WHERE temptest.a = 1 AND 
writetest.a = temptest.a; -- ok
+-- PREPARE test AS INSERT INTO writetest VALUES (1); -- ok
+-- EXECUTE test; -- fail
+SELECT * FROM writetest, temptest; -- ok
+ a | a 
+---+---
+(0 rows)
+
+CREATE TABLE test AS SELECT * FROM writetest; -- fail
+psql:/tmp/TestTransaction_BasicTest.sql:64: ERROR:  transaction is read-only
+START TRANSACTION READ WRITE;
+START TRANSACTION
+DROP TABLE writetest; -- ok
+DROP TABLE
+COMMIT;
+COMMIT
+-- Subtransactions, basic tests
+-- create & drop tables
+SET SESSION CHARACTERISTICS AS TRANSACTION READ WRITE;
+SET
+CREATE TABLE foobar (a int);
+CREATE TABLE
+BEGIN;
+BEGIN
+   CREATE TABLE foo (a int);
+CREATE TABLE
+   SAVEPOINT one;
+SAVEPOINT
+   DROP TABLE foo;
+DROP TABLE
+   CREATE TABLE bar (a int);
+CREATE TABLE
+   ROLLBACK TO SAVEPOINT one;
+ROLLBACK
+   RELEASE SAVEPOINT one;
+RELEASE
+   SAVEPOINT two;
+SAVEPOINT
+   CREATE TABLE baz (a int);
+CREATE TABLE
+   RELEASE SAVEPOINT two;
+RELEASE
+   drop TABLE foobar;
+DROP TABLE
+   CREATE TABLE barbaz (a int);
+CREATE TABLE
+COMMIT;
+COMMIT
+-- should exist: barbaz, baz, foo
+SELECT * FROM foo; -- should be empty
+ a 
+---
+(0 rows)
+
+SELECT * FROM bar; -- shouldn't exist
+psql:/tmp/TestTransaction_BasicTest.sql:89: ERROR:  relation "bar" does not 
exist
+LINE 1: SELECT * FROM bar;
+  ^
+SELECT * FROM barbaz;  -- should be empty
+ a 
+---
+(0 rows)
+
+SELECT * FROM baz; -- should be empty
+ a 
+---
+(0 rows)
+
+-- inserts
+BEGIN;
+BEGIN
+   INSERT INTO foo VALUES (1);
+INSERT 0 1
+   SAVEPOINT one;
+SAVEPOINT
+   INSERT into bar VALUES (1);
+psql:/tmp/TestTransaction_BasicTest.sql:97: ERROR:  relation "bar" does not 
exist
+   ROLLBACK TO one;
+ROLLBACK
+   RELEASE SAVEPOINT one;
+RELEASE
+   SAVEPOINT two;
+SAVEPOINT
+   INSERT into barbaz VALUES (1);
+INSERT 0 

incubator-hawq git commit: HAWQ-909. Add feature test for goh_database with new test framework

2016-08-29 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 48d3e26a3 -> 27022e561


HAWQ-909. Add feature test for goh_database with new test framework


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

Branch: refs/heads/master
Commit: 27022e5611f21d2d8e062cd8fc3181f592fcf27c
Parents: 48d3e26
Author: ivan 
Authored: Mon Aug 29 10:59:12 2016 +0800
Committer: ivan 
Committed: Tue Aug 30 09:44:30 2016 +0800

--
 src/test/feature/ddl/ans/goh_database.ans | 141 +
 src/test/feature/ddl/sql/goh_database.sql |  41 +++
 src/test/feature/ddl/sql/init_file|   5 +
 src/test/feature/ddl/test_database.cpp|  20 
 4 files changed, 207 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/27022e56/src/test/feature/ddl/ans/goh_database.ans
--
diff --git a/src/test/feature/ddl/ans/goh_database.ans 
b/src/test/feature/ddl/ans/goh_database.ans
new file mode 100644
index 000..90e211f
--- /dev/null
+++ b/src/test/feature/ddl/ans/goh_database.ans
@@ -0,0 +1,141 @@
+CREATE DATABASE goh_database;
+CREATE DATABASE
+DROP DATABASE goh_database;
+DROP DATABASE
+-- should be a clean databse
+CREATE DATABASE goh_database1;
+CREATE DATABASE
+\c goh_database1
+You are now connected to database "goh_database1" as user "ivan".
+CREATE TABLE x(c int);
+CREATE TABLE
+INSERT INTO x VALUES(generate_series(1, 10));
+INSERT 0 10
+SELECT * FROM x ORDER BY c;
+ c  
+
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+(10 rows)
+
+DROP TABLE x;
+DROP TABLE
+\c db_testdatabase_basictest 
+You are now connected to database "db_testdatabase_basictest" as user "ivan".
+-- table should be removed
+CREATE DATABASE goh_database2;
+CREATE DATABASE
+\c goh_database2
+You are now connected to database "goh_database2" as user "ivan".
+CREATE TABLE x(c int);
+CREATE TABLE
+INSERT INTO x VALUES(generate_series(1, 10));
+INSERT 0 10
+SELECT * FROM x ORDER BY c;
+ c  
+
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+(10 rows)
+
+\c db_testdatabase_basictest 
+You are now connected to database "db_testdatabase_basictest" as user "ivan".
+CREATE TABLESPACE goh_regression_tablespace1 FILESPACE dfs_system;
+CREATE TABLESPACE
+CREATE DATABASE goh_database3 TABLESPACE goh_regression_tablespace1;
+CREATE DATABASE
+\c goh_database3
+You are now connected to database "goh_database3" as user "ivan".
+CREATE TABLE x(c int);
+CREATE TABLE
+INSERT INTO x VALUES(generate_series(1, 10));
+INSERT 0 10
+SELECT * FROM x ORDER BY c;
+ c  
+
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+(10 rows)
+
+\d x
+ Append-Only Table "public.x"
+ Column |  Type   | Modifiers 
++-+---
+ c  | integer | 
+Compression Type: None
+Compression Level: 0
+Block Size: 32768
+Checksum: f
+Distributed randomly
+
+\c db_testdatabase_basictest 
+You are now connected to database "db_testdatabase_basictest" as user "ivan".
+BEGIN;
+BEGIN
+CREATE TABLESPACE goh_regression_tablespace2 FILESPACE dfs_system;
+CREATE TABLESPACE
+CREATE TABLE x(c int) TABLESPACE goh_regression_tablespace2;
+CREATE TABLE
+INSERT INTO x VALUES(generate_series(1, 10));
+INSERT 0 10
+SELECT * FROM x ORDER BY c;
+ c  
+
+  1
+  2
+  3
+  4
+  5
+  6
+  7
+  8
+  9
+ 10
+(10 rows)
+
+\d x
+ Append-Only Table "public.x"
+ Column |  Type   | Modifiers 
++-+---
+ c  | integer | 
+Compression Type: None
+Compression Level: 0
+Block Size: 32768
+Checksum: f
+Distributed randomly
+Tablespace: "goh_regression_tablespace2"
+
+ROLLBACK;
+ROLLBACK
+DROP DATABASE goh_database1;
+DROP DATABASE
+DROP DATABASE goh_database2;
+DROP DATABASE
+DROP DATABASE goh_database3;
+DROP DATABASE
+DROP TABLESPACE goh_regression_tablespace1;
+DROP TABLESPACE

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/27022e56/src/test/feature/ddl/sql/goh_database.sql
--
diff --git a/src/test/feature/ddl/sql/goh_database.sql 
b/src/test/feature/ddl/sql/goh_database.sql
new file mode 100644
index 000..1e8ccec
--- /dev/null
+++ b/src/test/feature/ddl/sql/goh_database.sql
@@ -0,0 +1,41 @@
+CREATE DATABASE goh_database;
+DROP DATABASE goh_database;
+
+-- should be a clean databse
+CREATE DATABASE goh_database1;
+\c goh_database1
+CREATE TABLE x(c int);
+INSERT INTO x VALUES(generate_series(1, 10));
+SELECT * FROM x ORDER BY c;
+DROP TABLE x;
+\c db_testdatabase_basictest 
+
+-- table should be removed
+CREATE DATABASE goh_database2;
+\c goh_database2
+CREATE TABLE 

[2/3] incubator-hawq git commit: HAWQ-969. fix bugs in last commit

2016-08-23 Thread iweng
HAWQ-969. fix bugs in last commit


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

Branch: refs/heads/master
Commit: 6617a8368e0123be16fd2bf44ff081b15da551b5
Parents: d1aafe6
Author: Chunling Wang 
Authored: Wed Aug 3 11:30:12 2016 +0800
Committer: ivan 
Committed: Wed Aug 24 09:50:40 2016 +0800

--
 src/test/feature/lib/hdfs_config.cpp  |  51 +++-
 src/test/feature/lib/hdfs_config.h|  11 ++-
 src/test/feature/lib/xml_parser.cpp   |   2 +-
 src/test/feature/lib/xml_parser.h |   2 +-
 src/test/feature/lib/yarn_config.cpp  |  63 ++-
 src/test/feature/lib/yarn_config.h|  13 ++-
 src/test/feature/testlib/test_lib.cpp | 125 -
 7 files changed, 161 insertions(+), 106 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/6617a836/src/test/feature/lib/hdfs_config.cpp
--
diff --git a/src/test/feature/lib/hdfs_config.cpp 
b/src/test/feature/lib/hdfs_config.cpp
index 90b1032..e59a02e 100644
--- a/src/test/feature/lib/hdfs_config.cpp
+++ b/src/test/feature/lib/hdfs_config.cpp
@@ -28,7 +28,7 @@ string HdfsConfig::getHdfsUser() {
 bool HdfsConfig::LoadFromHawqConfigFile() {
   const char *env = getenv("GPHOME");
   string confPath = env ? env : "";
-  if (!confPath.empty()) {
+  if (confPath != "") {
 confPath.append("/etc/hdfs-client.xml");
   } else {
 return false;
@@ -41,8 +41,9 @@ bool HdfsConfig::LoadFromHawqConfigFile() {
 
 bool HdfsConfig::LoadFromHdfsConfigFile() {
   string confPath=getHadoopHome();
-  if (confPath == "")
+  if (confPath == "") {
 return false;
+  }
   confPath.append("/etc/hadoop/hdfs-site.xml");
   hdfsxmlconf.reset(new XmlConfig(confPath));
   hdfsxmlconf->parse();
@@ -50,22 +51,26 @@ bool HdfsConfig::LoadFromHdfsConfigFile() {
 }
 
 bool HdfsConfig::isHA() {
-  bool ret = LoadFromHawqConfigFile();
-  if (!ret) {
-return false;
-  }
-  string nameservice = hawqxmlconf->getString("dfs.nameservices");
-  if (nameservice.length() > 0) {
-return true;
-  } else {
-return false;
+  const hawq::test::PSQLQueryResult  = psql.getQueryResult(
+   "SELECT substring(fselocation from length('hdfs:// ') for (position('/' 
in substring(fselocation from length('hdfs:// ')))-1)::int) "
+   "FROM pg_filespace pgfs, pg_filespace_entry pgfse "
+   "WHERE pgfs.fsname = 'dfs_system' AND pgfse.fsefsoid=pgfs.oid ;");
+  std::vector table = result.getRows();
+  if (table.size() > 0) {
+int find = table[0][0].find(":");
+if (find < 0) {
+  return true;
+} else {
+  return false;
+}
   }
+  return false;
 }
 
-bool HdfsConfig::isKerbos() {
+bool HdfsConfig::isConfigKerberos() {
   bool ret = LoadFromHawqConfigFile();
   if (!ret) {
-return false;
+throw GetHawqHomeException();
   }
   string authentication = 
hawqxmlconf->getString("hadoop.security.authentication");
   if (authentication == "kerberos") {
@@ -83,8 +88,9 @@ bool HdfsConfig::isTruncate() {
   if (lines.size() >= 1) {
 string valueLine = lines[0];
 int find = valueLine.find("-truncate: Unknown command");
-if (find < 0)
+if (find < 0) {
   return true;
+}
   }
   return false;
 }
@@ -122,8 +128,9 @@ bool HdfsConfig::getStandbyNamenode(string ,
 bool HdfsConfig::getHANamenode(const string ,
string ,
int ) {
-  if (!isHA())
+  if (!isHA()) {
 return false;
+  }
   string namenodeService = "";
   string nameServiceValue = hawqxmlconf->getString("dfs.nameservices");
   string haNamenodesName = "dfs.ha.namenodes.";
@@ -227,8 +234,9 @@ bool HdfsConfig::isSafemode() {
   if (lines.size() >= 1) {
 string valueLine = lines[0];
 int find = valueLine.find("Name node is in safe mode.");
-if (find >= 0)
+if (find >= 0) {
   return true;
+}
   }
   cmd = "hadoop fs -rm -r /tmp_hawq_test";
   Command c_teardown(cmd);
@@ -239,7 +247,7 @@ bool HdfsConfig::isSafemode() {
 string HdfsConfig::getParameterValue(const string ) {
   bool ret = LoadFromHdfsConfigFile();
   if (!ret) {
-return NULL;
+throw GetHadoopHomeException();
   }
 
   return hdfsxmlconf->getString(parameterName);
@@ -251,7 +259,7 @@ string HdfsConfig::getParameterValue(const string 
,
 return getParameterValue(parameterName);
   bool ret = LoadFromHawqConfigFile();
   if (!ret) {
-return NULL;
+throw GetHawqHomeException();
   }
 
   return hawqxmlconf->getString(parameterName);
@@ -261,7 +269,7 @@ bool 

[1/3] incubator-hawq git commit: HAWQ-969. Modify some functions in hdfs_config.cpp and yarn_config.cpp

2016-08-23 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 8cc4a042e -> 56b704343


HAWQ-969. Modify some functions in hdfs_config.cpp and yarn_config.cpp


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

Branch: refs/heads/master
Commit: 56b704343ebc67bcdd5594134dea731e81042b31
Parents: 6617a83
Author: Chunling Wang 
Authored: Sat Aug 20 14:10:41 2016 +0800
Committer: ivan 
Committed: Wed Aug 24 09:50:40 2016 +0800

--
 src/test/feature/lib/hdfs_config.cpp  | 206 +++--
 src/test/feature/lib/hdfs_config.h|  37 +++---
 src/test/feature/lib/xml_parser.cpp   |   6 +-
 src/test/feature/lib/xml_parser.h |   2 +-
 src/test/feature/lib/yarn_config.cpp  | 169 ---
 src/test/feature/lib/yarn_config.h|  27 ++--
 src/test/feature/testlib/test_lib.cpp | 124 -
 7 files changed, 300 insertions(+), 271 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/56b70434/src/test/feature/lib/hdfs_config.cpp
--
diff --git a/src/test/feature/lib/hdfs_config.cpp 
b/src/test/feature/lib/hdfs_config.cpp
index e59a02e..ee72a17 100644
--- a/src/test/feature/lib/hdfs_config.cpp
+++ b/src/test/feature/lib/hdfs_config.cpp
@@ -14,6 +14,58 @@ using std::string;
 namespace hawq {
 namespace test {
 
+void HdfsConfig::runCommand(const string , 
+bool ishdfsuser, 
+string ) {
+  string cmd = "";
+  if (ishdfsuser) {
+cmd = "sudo -u ";
+cmd.append(getHdfsUser());
+cmd.append(" ");
+cmd.append(command);
+  } else {
+cmd = command;
+  }
+  Command c(cmd);
+  result = c.run().getResultOutput();
+}
+
+bool HdfsConfig::runCommandAndFind(const string , 
+   bool ishdfsuser, 
+   const string ) {
+  string result = "";
+  runCommand(command, ishdfsuser, result);
+  auto lines = hawq::test::split(result, '\n');
+  for (size_t i=0; i= 0) {
+return true;
+}
+  }
+  return false;
+}
+
+void HdfsConfig::runCommandAndGetNodesPorts(const string , 
+std::vector ,
+std::vector ) {
+  string result = "";
+  runCommand(command, true, result);
+  auto lines = hawq::test::split(result, '\n');
+  for (size_t i = 0; i < lines.size(); i++) {
+string valueLine = lines[i];
+auto datanodeInfo = hawq::test::split(valueLine, ':');
+if (datanodeInfo.size() == 3) {
+  int portStart = datanodeInfo[2].find_first_of('(');
+  int portEnd = datanodeInfo[2].find_first_of(')');
+  string datanodePort = datanodeInfo[2].substr(0, portStart);
+  string datanodeHost = datanodeInfo[2].substr(portStart+1, 
portEnd-portStart-1);
+  datanodelist.push_back(hawq::test::trim(datanodeHost));
+  port.push_back(std::stoi(hawq::test::trim(datanodePort)));
+}
+  }
+}
+
 string HdfsConfig::getHdfsUser() {
   string cmd = "ps aux|grep hdfs.server|grep -v grep";
   Command c(cmd);
@@ -26,6 +78,9 @@ string HdfsConfig::getHdfsUser() {
 }
 
 bool HdfsConfig::LoadFromHawqConfigFile() {
+  if (isLoadFromHawqConfigFile) {
+return true;
+  }
   const char *env = getenv("GPHOME");
   string confPath = env ? env : "";
   if (confPath != "") {
@@ -35,22 +90,31 @@ bool HdfsConfig::LoadFromHawqConfigFile() {
   }
 
   hawqxmlconf.reset(new XmlConfig(confPath));
-  hawqxmlconf->parse();
+  if (!hawqxmlconf->parse())
+return false;
+
+  isLoadFromHawqConfigFile = true;
   return true;
 }
 
 bool HdfsConfig::LoadFromHdfsConfigFile() {
+  if (isLoadFromHdfsConfigFile) {
+return true;
+  }
   string confPath=getHadoopHome();
   if (confPath == "") {
 return false;
   }
   confPath.append("/etc/hadoop/hdfs-site.xml");
   hdfsxmlconf.reset(new XmlConfig(confPath));
-  hdfsxmlconf->parse();
+  if (!hdfsxmlconf->parse())
+return false;
+  
+  isLoadFromHdfsConfigFile = true;
   return true;
 }
 
-bool HdfsConfig::isHA() {
+int HdfsConfig::isHA() {
   const hawq::test::PSQLQueryResult  = psql.getQueryResult(
"SELECT substring(fselocation from length('hdfs:// ') for (position('/' 
in substring(fselocation from length('hdfs:// ')))-1)::int) "
"FROM pg_filespace pgfs, pg_filespace_entry pgfse "
@@ -59,53 +123,46 @@ bool HdfsConfig::isHA() {
   if (table.size() > 0) {
 int find = table[0][0].find(":");
 if 

incubator-hawq git commit: HAWQ-980. hawq does not handle guc value with space properly Remove and replace some thread-unsafe functions in addOneOption().

2016-08-15 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 513388129 -> 7920ad4ec


HAWQ-980. hawq does not handle guc value with space properly
Remove and replace some thread-unsafe functions in addOneOption().


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

Branch: refs/heads/master
Commit: 7920ad4ecb14a4845b6f09646e0fc7cdb6304ea7
Parents: 5133881
Author: Paul Guo 
Authored: Mon Aug 15 13:36:30 2016 +0800
Committer: ivan 
Committed: Tue Aug 16 10:00:25 2016 +0800

--
 src/backend/cdb/executormgr.c | 17 -
 1 file changed, 8 insertions(+), 9 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/7920ad4e/src/backend/cdb/executormgr.c
--
diff --git a/src/backend/cdb/executormgr.c b/src/backend/cdb/executormgr.c
index e35f10b..f8efb3d 100644
--- a/src/backend/cdb/executormgr.c
+++ b/src/backend/cdb/executormgr.c
@@ -868,11 +868,9 @@ addOneOption(PQExpBufferData *buffer, struct 
config_generic * guc)
char*temp, *new_temp;
 
size = 256;
-   temp = palloc(size + 8);
+   temp = malloc(size + 8);
if (temp == NULL)
-   ereport(ERROR,
-   
(errcode(ERRCODE_OUT_OF_MEMORY),
-errmsg("out of 
memory")));
+   return false;
 
j = 0;
for (start = 0; start < strlen(str); ++start)
@@ -880,11 +878,12 @@ addOneOption(PQExpBufferData *buffer, struct 
config_generic * guc)
if (j == size)
{
size *= 2;
-   new_temp = repalloc(temp, size 
+ 8);
+   new_temp = realloc(temp, size + 
8);
if (new_temp == NULL)
-   ereport(ERROR,
-   
(errcode(ERRCODE_OUT_OF_MEMORY),
-
errmsg("out of memory")));
+   {
+   free(temp);
+   return false;
+   }
temp = new_temp;
}
 
@@ -900,7 +899,7 @@ addOneOption(PQExpBufferData *buffer, struct config_generic 
* guc)
 
temp[j] = '\0';
appendPQExpBuffer(buffer, " -c %s=%s", 
guc->name, temp);
-   pfree(temp);
+   free(temp);
 
return true;
}



incubator-hawq git commit: HAWQ-977. mask and clean up some files after running feature_test cases.

2016-08-02 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 8906240f4 -> 531b4d69f


HAWQ-977. mask and clean up some files after running feature_test cases.


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

Branch: refs/heads/master
Commit: 531b4d69f4e055fb9a6df256adea6b73c96a76ad
Parents: 8906240
Author: Paul Guo 
Authored: Wed Aug 3 09:31:43 2016 +0800
Committer: Paul Guo 
Committed: Wed Aug 3 09:32:33 2016 +0800

--
 src/test/feature/.gitignore | 1 +
 src/test/feature/Makefile   | 5 +
 2 files changed, 6 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/531b4d69/src/test/feature/.gitignore
--
diff --git a/src/test/feature/.gitignore b/src/test/feature/.gitignore
index a2e6bd4..c7332b2 100644
--- a/src/test/feature/.gitignore
+++ b/src/test/feature/.gitignore
@@ -1 +1,2 @@
 doc/
+**/*.out

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/531b4d69/src/test/feature/Makefile
--
diff --git a/src/test/feature/Makefile b/src/test/feature/Makefile
index f393a76..7202ac3 100644
--- a/src/test/feature/Makefile
+++ b/src/test/feature/Makefile
@@ -37,6 +37,11 @@ doc:
doxygen doxygen_template
 
 clean distclean: sharelibclean
+   find . -type f -name "*.out" -exec $(RM) {} +
+   $(RM) ExternalSource/ans/external_oid.ans 
ExternalSource/ans/exttab1.ans ExternalSource/sql/external_oid.sql 
ExternalSource/sql/exttab1.sql
+   $(RM) UDF/ans/function_c.ans UDF/ans/function_creation.ans 
UDF/sql/function_c.sql UDF/sql/function_creation.sql
+   $(RM) testlib/ans/template.ans testlib/sql/template.sql
+   $(RM) utility/ans/copytest.csv utility/ans/onek.data
$(RM) feature-test
$(RM) feature-test.dSYM
$(RM) doc



incubator-hawq git commit: HAWQ-900. Add dependency in PL/R rpm build spec file plr.spec

2016-07-28 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 691804044 -> fb7f806fe


HAWQ-900. Add dependency in PL/R rpm build spec file plr.spec


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

Branch: refs/heads/master
Commit: fb7f806feba74a48e474fead5b84fc0ee72f07f5
Parents: 6918040
Author: Paul Guo 
Authored: Wed Jul 6 18:09:42 2016 +0800
Committer: ivan 
Committed: Fri Jul 29 10:20:21 2016 +0800

--
 src/pl/plr.spec | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/fb7f806f/src/pl/plr.spec
--
diff --git a/src/pl/plr.spec b/src/pl/plr.spec
index e34e8b8..a6621d9 100644
--- a/src/pl/plr.spec
+++ b/src/pl/plr.spec
@@ -4,9 +4,13 @@ Version:08.03.00.14
 Release:   0
 Prefix: /usr/local
 License:   GPL
+BuildRequires:  R-devel
+Requires:   R
 
 %define _unpackaged_files_terminate_build 0
 
+AutoReqProv:no
+
 %description
 The PL/R modules provides Procedural language implementation of R for HAWQ.
 



incubator-hawq git commit: HAWQ-962. Make catalog:type_sanity be able to run with other cases in parallel

2016-07-28 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master b2df66b4c -> 691804044


HAWQ-962. Make catalog:type_sanity be able to run with other cases in parallel


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

Branch: refs/heads/master
Commit: 6918040445efeef64d16eddf4a52d4f4187cfed2
Parents: b2df66b
Author: Paul Guo 
Authored: Thu Jul 28 13:33:38 2016 +0800
Committer: ivan 
Committed: Fri Jul 29 09:45:14 2016 +0800

--
 src/test/feature/catalog/test_type.cpp | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/69180404/src/test/feature/catalog/test_type.cpp
--
diff --git a/src/test/feature/catalog/test_type.cpp 
b/src/test/feature/catalog/test_type.cpp
index f8bed88..6706bec 100644
--- a/src/test/feature/catalog/test_type.cpp
+++ b/src/test/feature/catalog/test_type.cpp
@@ -50,6 +50,11 @@ TEST_F_FILE_TYPE(text)
 
 TEST_F_FILE_TYPE(time)
 
-TEST_F_FILE_TYPE(type_sanity)
+TEST_F(TestType, type_sanity)
+{
+   hawq::test::SQLUtility util(hawq::test::MODE_DATABASE);
+   util.execSQLFile("catalog/sql/type_sanity.sql",
+"catalog/ans/type_sanity.ans");
+}
 
 TEST_F_FILE_TYPE(varchar)



incubator-hawq git commit: HAWQ-905. add init file for temp table test case

2016-07-27 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 9fac5349b -> 7eb7af36a


HAWQ-905. add init file for temp table test case


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

Branch: refs/heads/master
Commit: 7eb7af36a5eafcd4b1691c4ce849ea6360ef5dca
Parents: 9fac534
Author: ivan 
Authored: Thu Jul 28 13:34:52 2016 +0800
Committer: ivan 
Committed: Thu Jul 28 13:38:48 2016 +0800

--
 src/test/feature/query/sql/init_file | 5 +
 src/test/feature/query/test_temp.cpp | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/7eb7af36/src/test/feature/query/sql/init_file
--
diff --git a/src/test/feature/query/sql/init_file 
b/src/test/feature/query/sql/init_file
new file mode 100644
index 000..48c1804
--- /dev/null
+++ b/src/test/feature/query/sql/init_file
@@ -0,0 +1,5 @@
+-- start_matchignore
+m/You are now connected to database*/
+
+
+-- end_matchignore

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/7eb7af36/src/test/feature/query/test_temp.cpp
--
diff --git a/src/test/feature/query/test_temp.cpp 
b/src/test/feature/query/test_temp.cpp
index 8f1497b..0b64601 100644
--- a/src/test/feature/query/test_temp.cpp
+++ b/src/test/feature/query/test_temp.cpp
@@ -15,5 +15,6 @@ TEST_F(TestTemp, BasicTest)
 {
hawq::test::SQLUtility util(hawq::test::MODE_DATABASE);
util.execSQLFile("query/sql/temp.sql",
-"query/ans/temp.ans");
+"query/ans/temp.ans",
+ "query/sql/init_file");
 }



incubator-hawq git commit: HAWQ-948. README.md for feature test

2016-07-24 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 95f337ce4 -> dbcbe0fce


HAWQ-948. README.md for feature test


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

Branch: refs/heads/master
Commit: dbcbe0fce69ef2a250ca48740774e973c3ee6beb
Parents: 95f337c
Author: xunzhang 
Authored: Mon Jul 25 12:24:01 2016 +0800
Committer: xunzhang 
Committed: Mon Jul 25 13:15:19 2016 +0800

--
 README.md  |  4 ++--
 src/test/feature/README.md | 38 ++
 2 files changed, 40 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dbcbe0fc/README.md
--
diff --git a/README.md b/README.md
index 86a6cf5..8175a17 100644
--- a/README.md
+++ b/README.md
@@ -3,10 +3,10 @@
 [Website](http://hawq.incubator.apache.org/) |
 [Wiki](https://cwiki.apache.org/confluence/display/HAWQ/Apache+HAWQ+Home) |
 [Documentation](http://hdb.docs.pivotal.io/) |
-[Devolper Mailing List](mailto:d...@hawq.incubator.apache.org) |
+[Developer Mailing List](mailto:d...@hawq.incubator.apache.org) |
 [User Mailing List](mailto:u...@hawq.incubator.apache.org) |
 [Q 
Collections](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=65144284)
 |
-[Open Defect](https://issues.apache.org/jira/browse/HAWQ) |
+[Open Defect](https://issues.apache.org/jira/browse/HAWQ)
 
 
 # Apache HAWQ

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dbcbe0fc/src/test/feature/README.md
--
diff --git a/src/test/feature/README.md b/src/test/feature/README.md
new file mode 100644
index 000..229c7c4
--- /dev/null
+++ b/src/test/feature/README.md
@@ -0,0 +1,38 @@
+This folder contains the feature tests of apache HAWQ. The feature test 
library is written based on google test. Users and developers could run these 
tests after successfully installed apache HAWQ.
+
+# Build 
+`cd $HAWQ_HOME`
+
+`make feature-test`
+
+`make feature-test-clean`
+
+Also, you could enter the `$HAWQ_HOME/src/test/feature` folder to `make` and 
`make clean`. 
+
+Before building the code of feature tests part, just make sure your compiler 
supports C++11 and you have apache HAWQ successfully compiled.
+
+# Run
+1. Make sure HAWQ is running correctly. If not, `init` or `start` HAWQ at 
first.
+2. Load environment configuration by running `source 
$INSTALL_PREFIX/greenplum_path.sh`.
+3. Load hdfs configuration. For example, `export 
HADOOP_HOME=/Users/wuhong/hadoop-2.7.2 && export 
PATH=${PATH}:${HADOOP_HOME}/bin`. Since some test cases need `hdfs` and 
`hadoop` command, just ensure these commands work before running. Otherwise you 
will get failure.
+4. Run `./feature-test`, you could use `--gtest_filter` option to filter test 
cases(both positive and negative patterns are supported). Please see more 
options by running `./feature-test --help`.
+
+# Development
+In contribution to HAWQ, we suggest developers submitting feature tests 
related to your feature development. In writting a featurte test, you need to 
write a cpp file inside corresponding folders. There are two recommended way to 
write this cpp file:
+
+1. Check every single sql clause and bundle the test utility inside one case. 
This way is not that readable but it is much better in quality. See 
`ExternalSource/test_errortbl.cpp` for example. 
+2. Write a `sql` file for sql utility test related to your feature and a 
`.ans` which lists the expected output. Lots of current cases are written in 
this manner. For sql plan cases, you should include two sperate sql files 
linking to `OCAR` on and off.
+
+Refer to `testlib/test_lib.cpp` for detialed usage. The APIs are listed in 
`lib/sql_util.h`. 
+
+You don't need to modify `Makefile`, it will automatively handle new .
+
+# Troubleshooting
+If some cases failed in your environment, check it out with the generated 
`.diff` files: `find . -name "*.out.diff"`. There files show the difference 
between the expected output(`.ans`) and the real output(`.out`) which you could 
find if seperate subfolders after running.
+
+There are some cases expected to be fail in specific environment which need to 
be fixed later on. Don't worry about that.
+
+# Reference
+[HAWQ-832](https://issues.apache.org/jira/browse/HAWQ-832)
+
+[Design 
Doc](https://issues.apache.org/jira/secure/attachment/12811319/GoogleTest.pdf)



incubator-hawq git commit: HAWQ-889. Tweak the error output for quicklz table creation.

2016-07-04 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 804b0b601 -> 831de3a6d


HAWQ-889. Tweak the error output for quicklz table creation.


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

Branch: refs/heads/master
Commit: 831de3a6d165ad44608581133f7a1b51d4b7d057
Parents: 804b0b6
Author: Paul Guo 
Authored: Tue Jul 5 10:18:19 2016 +0800
Committer: ivan 
Committed: Tue Jul 5 10:28:18 2016 +0800

--
 src/backend/access/common/reloptions.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/831de3a6/src/backend/access/common/reloptions.c
--
diff --git a/src/backend/access/common/reloptions.c 
b/src/backend/access/common/reloptions.c
index d7c535e..28ab0f0 100644
--- a/src/backend/access/common/reloptions.c
+++ b/src/backend/access/common/reloptions.c
@@ -519,7 +519,7 @@ default_reloptions(Datum reloptions, bool validate, char 
relkind,
{
ereport(ERROR,
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-errmsg("compresstype \"%s\" is not 
supported anymore", compresstype),
+errmsg("compresstype \"%s\" is not 
supported", compresstype),
 errOmitLocation(true)));
}
 



incubator-hawq git commit: HAWQ-868. README.md needs to update

2016-07-04 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 49fd529aa -> 804b0b601


HAWQ-868. README.md needs to update


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

Branch: refs/heads/master
Commit: 804b0b6017c36291a6f80c6ad6cf591279ad356d
Parents: 49fd529
Author: Paul Guo 
Authored: Mon Jul 4 18:03:24 2016 +0800
Committer: ivan 
Committed: Tue Jul 5 10:26:37 2016 +0800

--
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/804b0b60/README.md
--
diff --git a/README.md b/README.md
index 9f0123d..86a6cf5 100644
--- a/README.md
+++ b/README.md
@@ -21,7 +21,7 @@ Apache HAWQ is a Hadoop native SQL query engine that combines 
the key technologi
  - Dynamic data flow engine through high speed UDP based interconnect
  - Elastic execution engine based on virtual segment & data locality
  - Support multiple level partitioning and List/Range based partitioned tables
- - Multiple compression method support: snappy, gzip, quicklz, RLE
+ - Multiple compression method support: snappy, gzip, zlib
  - Multi-language user defined function support: Python, Perl, Java, C/C++, R
  - Advanced machine learning and data mining functionalities through MADLib
  - Dynamic node expansion: in seconds



incubator-hawq git commit: HAWQ-885. Should fail earlier at creating for a table with quicklz compression.

2016-06-30 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 828437005 -> 4f39857f1


HAWQ-885. Should fail earlier at creating for a table with quicklz compression.


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

Branch: refs/heads/master
Commit: 4f39857f152646c4fe854d31b5eb92036d2c50bc
Parents: 8284370
Author: Paul Guo 
Authored: Fri Jul 1 10:35:26 2016 +0800
Committer: Paul Guo 
Committed: Fri Jul 1 10:36:56 2016 +0800

--
 src/backend/access/common/reloptions.c | 26 --
 1 file changed, 12 insertions(+), 14 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/4f39857f/src/backend/access/common/reloptions.c
--
diff --git a/src/backend/access/common/reloptions.c 
b/src/backend/access/common/reloptions.c
index a2a02e1..d7c535e 100644
--- a/src/backend/access/common/reloptions.c
+++ b/src/backend/access/common/reloptions.c
@@ -515,22 +515,20 @@ default_reloptions(Datum reloptions, bool validate, char 
relkind,
 
compresstype = values[5];
 
+   if (strcmp(compresstype, "quicklz") == 0)
+   {
+   ereport(ERROR,
+   (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
+errmsg("compresstype \"%s\" is not 
supported anymore", compresstype),
+errOmitLocation(true)));
+   }
+
if (!compresstype_is_valid(compresstype))
{
- if (strcmp(compresstype, "quicklz") == 0)
- {
-   ereport(ERROR,
-   (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-errmsg("compresstype \"%s\" is not supported anymore", 
compresstype),
-errOmitLocation(true)));
- }
- else
- {
-   ereport(ERROR,
-   (errcode(ERRCODE_UNDEFINED_OBJECT),
-errmsg("unknown compresstype \"%s\"", compresstype),
-  errOmitLocation(true)));
- }
+   ereport(ERROR,
+   (errcode(ERRCODE_UNDEFINED_OBJECT),
+errmsg("unknown compresstype \"%s\"", 
compresstype),
+errOmitLocation(true)));
}
 
if ((columnstore == RELSTORAGE_PARQUET) && 
(strcmp(compresstype, "snappy") != 0)



[23/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_wt_partsnappy2097152.ans
--
diff --git a/src/test/feature/ao/ans/ao_wt_partsnappy2097152.ans 
b/src/test/feature/ao/ans/ao_wt_partsnappy2097152.ans
new file mode 100644
index 000..2ab527f
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_wt_partsnappy2097152.ans
@@ -0,0 +1,1177 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_Partition2097152;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:11
+-- @modified 2013-08-06 23:59:11
+-- @tags HAWQ Storage ao_wt
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_partsnappy2097152_1 cascade;
+psql:/tmp/TestAOSnappy_Partition2097152.sql:13: NOTICE:  table 
"ao_wt_partsnappy2097152_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_wt_partsnappy2097152_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_Partition2097152.sql:15: NOTICE:  table 
"ao_wt_partsnappy2097152_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_wt_partsnappy2097152_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly Partition by 
range(a1) (start(1)  end(5000) every(1000) 
+ WITH (appendonly=true, 
orientation=row,compresstype=snappy,blocksize=2097152));
+psql:/tmp/TestAOSnappy_Partition2097152.sql:23: NOTICE:  CREATE TABLE will 
create implicit sequence "ao_wt_partsnappy2097152_1_id_seq" for serial column 
"ao_wt_partsnappy2097152_1.id"
+psql:/tmp/TestAOSnappy_Partition2097152.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy2097152_1_1_prt_1" for table 
"ao_wt_partsnappy2097152_1"
+psql:/tmp/TestAOSnappy_Partition2097152.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy2097152_1_1_prt_2" for table 
"ao_wt_partsnappy2097152_1"
+psql:/tmp/TestAOSnappy_Partition2097152.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy2097152_1_1_prt_3" for table 
"ao_wt_partsnappy2097152_1"
+psql:/tmp/TestAOSnappy_Partition2097152.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy2097152_1_1_prt_4" for table 
"ao_wt_partsnappy2097152_1"
+psql:/tmp/TestAOSnappy_Partition2097152.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy2097152_1_1_prt_5" for table 
"ao_wt_partsnappy2097152_1"
+CREATE TABLE
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_partsnappy2097152_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough votes
  to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 

[29/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_crtb_with_row_snappy_1048576.ans
--
diff --git a/src/test/feature/ao/ans/ao_crtb_with_row_snappy_1048576.ans 
b/src/test/feature/ao/ans/ao_crtb_with_row_snappy_1048576.ans
new file mode 100644
index 000..32b1ade
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_crtb_with_row_snappy_1048576.ans
@@ -0,0 +1,419 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_TestAOSnappyCreate1048576;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:58:48
+-- @modified 2013-08-06 23:58:48
+-- @tags HAWQ Storage
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_crtb_with_row_snappy_1048576_1 cascade;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate1048576.sql:13: NOTICE:  table 
"ao_crtb_with_row_snappy_1048576_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_crtb_with_row_snappy_1048576_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate1048576.sql:15: NOTICE:  table 
"ao_crtb_with_row_snappy_1048576_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_crtb_with_row_snappy_1048576_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=1048576) 
distributed randomly;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate1048576.sql:22: NOTICE:  CREATE TABLE 
will create implicit sequence "ao_crtb_with_row_snappy_1048576_1_id_seq" for 
serial column "ao_crtb_with_row_snappy_1048576_1.id"
+CREATE TABLE
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_crtb_with_row_snappy_1048576_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enou
 gh votes to pass the bill.','WASHINGTON:House Speaker John Boehner says his 
plan mixing spending cuts in exchange for raising the nations $14.3 trillion 
debt limit is not perfect but is as large a step that a divided government can 
take that is doable and signable by President Barack Obama.The Ohio Republican 
says the measure is an honest and sincere attempt at compromise and was 
negotiated with Democrats last weekend and that passing it would end the 
ongoing debt crisis. The plan blends $900 billion-plus in spending cuts with a 
companion increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1
 
,0,2,3)','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson
 & Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+INSERT 0 880
+ INSERT INTO 

[25/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_crtb_with_row_snappy_8192.ans
--
diff --git a/src/test/feature/ao/ans/ao_crtb_with_row_snappy_8192.ans 
b/src/test/feature/ao/ans/ao_crtb_with_row_snappy_8192.ans
new file mode 100644
index 000..d841d8d
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_crtb_with_row_snappy_8192.ans
@@ -0,0 +1,284 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_TestAOSnappyCreate8192;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:01
+-- @modified 2013-08-06 23:59:01
+-- @tags HAWQ Storage
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_crtb_with_row_snappy_8192_1 cascade;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate8192.sql:13: NOTICE:  table 
"ao_crtb_with_row_snappy_8192_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_crtb_with_row_snappy_8192_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate8192.sql:15: NOTICE:  table 
"ao_crtb_with_row_snappy_8192_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_crtb_with_row_snappy_8192_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=8192) 
distributed randomly;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate8192.sql:22: NOTICE:  CREATE TABLE 
will create implicit sequence "ao_crtb_with_row_snappy_8192_1_id_seq" for 
serial column "ao_crtb_with_row_snappy_8192_1.id"
+CREATE TABLE
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_crtb_with_row_snappy_8192_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough 
 votes to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,
 
2,3)','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson
 & Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+INSERT 0 880
+ INSERT INTO 

[27/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_crtb_with_row_snappy_32768.ans
--
diff --git a/src/test/feature/ao/ans/ao_crtb_with_row_snappy_32768.ans 
b/src/test/feature/ao/ans/ao_crtb_with_row_snappy_32768.ans
new file mode 100644
index 000..6dde697
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_crtb_with_row_snappy_32768.ans
@@ -0,0 +1,329 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_TestAOSnappyCreate32768;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:01
+-- @modified 2013-08-06 23:59:01
+-- @tags HAWQ Storage
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_crtb_with_row_snappy_32768_1 cascade;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate32768.sql:13: NOTICE:  table 
"ao_crtb_with_row_snappy_32768_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_crtb_with_row_snappy_32768_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate32768.sql:15: NOTICE:  table 
"ao_crtb_with_row_snappy_32768_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_crtb_with_row_snappy_32768_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=32768) 
distributed randomly;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate32768.sql:22: NOTICE:  CREATE TABLE 
will create implicit sequence "ao_crtb_with_row_snappy_32768_1_id_seq" for 
serial column "ao_crtb_with_row_snappy_32768_1.id"
+CREATE TABLE
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_crtb_with_row_snappy_32768_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough
  votes to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0
 
,2,3)','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson
 & Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+INSERT 0 880
+ INSERT INTO 

[08/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_wt_partsnappy32768.sql
--
diff --git a/src/test/feature/ao/sql/ao_wt_partsnappy32768.sql 
b/src/test/feature/ao/sql/ao_wt_partsnappy32768.sql
new file mode 100644
index 000..3916856
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_wt_partsnappy32768.sql
@@ -0,0 +1,437 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:11
+-- @modified 2013-08-06 23:59:11
+-- @tags HAWQ Storage ao_wt
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_partsnappy32768_1 cascade;
+
+DROP TABLE if exists ao_wt_partsnappy32768_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_wt_partsnappy32768_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly Partition by 
range(a1) (start(1)  end(5000) every(1000) 
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=32768));
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_partsnappy32768_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough votes t
 o pass the bill.','WASHINGTON:House Speaker John Boehner says his plan mixing 
spending cuts in exchange for raising the nations $14.3 trillion debt limit is 
not perfect but is as large a step that a divided government can take that is 
doable and signable by President Barack Obama.The Ohio Republican says the 
measure is an honest and sincere attempt at compromise and was negotiated with 
Democrats last weekend and that passing it would end the ongoing debt crisis. 
The plan blends $900 billion-plus in spending cuts with a companion increase in 
the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,2,3)','
 2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson & 
Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_wt_partsnappy32768_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 
school.For most children, the adjustment is quick. Tears will usually disappear 
after Mommy and  Daddy leave the classroom. Do not plead with your 
child',generate_series(2500,2516),'2011-10-12','Some 

[17/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_wt_sub_partsnappy65536.ans
--
diff --git a/src/test/feature/ao/ans/ao_wt_sub_partsnappy65536.ans 
b/src/test/feature/ao/ans/ao_wt_sub_partsnappy65536.ans
new file mode 100644
index 000..c0093c8
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_wt_sub_partsnappy65536.ans
@@ -0,0 +1,1261 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_SubPartition65536;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:31
+-- @modified 2013-08-06 23:59:31
+-- @tags HAWQ Storage ao_wt_sub
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_sub_partsnappy65536_1 cascade;
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:13: NOTICE:  table 
"ao_wt_sub_partsnappy65536_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_wt_sub_partsnappy65536_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:15: NOTICE:  table 
"ao_wt_sub_partsnappy65536_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_wt_sub_partsnappy65536_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly  Partition by 
range(a1) Subpartition by list(a2) subpartition template ( default subpartition 
df_sp, subpartition sp1 values('M') , subpartition sp2 values('F')  
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=65536)) 
(start(1)  end(5000) every(1000) );
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create implicit sequence "ao_wt_sub_partsnappy65536_1_id_seq" for serial column 
"ao_wt_sub_partsnappy65536_1.id"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_1" for table 
"ao_wt_sub_partsnappy65536_1"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_2" for table 
"ao_wt_sub_partsnappy65536_1"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_3" for table 
"ao_wt_sub_partsnappy65536_1"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_4" for table 
"ao_wt_sub_partsnappy65536_1"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_5" for table 
"ao_wt_sub_partsnappy65536_1"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_1_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy65536_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_1_2_prt_sp1" for table 
"ao_wt_sub_partsnappy65536_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_1_2_prt_sp2" for table 
"ao_wt_sub_partsnappy65536_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_2_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy65536_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_2_2_prt_sp1" for table 
"ao_wt_sub_partsnappy65536_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_2_2_prt_sp2" for table 
"ao_wt_sub_partsnappy65536_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_3_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy65536_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_3_2_prt_sp1" for table 
"ao_wt_sub_partsnappy65536_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy65536_1_1_prt_3_2_prt_sp2" for table 
"ao_wt_sub_partsnappy65536_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition 

[19/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_wt_sub_partsnappy1048576.ans
--
diff --git a/src/test/feature/ao/ans/ao_wt_sub_partsnappy1048576.ans 
b/src/test/feature/ao/ans/ao_wt_sub_partsnappy1048576.ans
new file mode 100644
index 000..bee8d34
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_wt_sub_partsnappy1048576.ans
@@ -0,0 +1,1321 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_SubPartition1048576;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:31
+-- @modified 2013-08-06 23:59:31
+-- @tags HAWQ Storage ao_wt_sub
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_sub_partsnappy1048576_1 cascade;
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:13: NOTICE:  table 
"ao_wt_sub_partsnappy1048576_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_wt_sub_partsnappy1048576_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:15: NOTICE:  table 
"ao_wt_sub_partsnappy1048576_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_wt_sub_partsnappy1048576_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly  Partition by 
range(a1) Subpartition by list(a2) subpartition template ( default subpartition 
df_sp, subpartition sp1 values('M') , subpartition sp2 values('F')  
+ WITH (appendonly=true, 
orientation=row,compresstype=snappy,blocksize=1048576)) (start(1)  end(5000) 
every(1000) );
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create implicit sequence "ao_wt_sub_partsnappy1048576_1_id_seq" for serial 
column "ao_wt_sub_partsnappy1048576_1.id"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_1" for table 
"ao_wt_sub_partsnappy1048576_1"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_2" for table 
"ao_wt_sub_partsnappy1048576_1"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_3" for table 
"ao_wt_sub_partsnappy1048576_1"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_4" for table 
"ao_wt_sub_partsnappy1048576_1"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_5" for table 
"ao_wt_sub_partsnappy1048576_1"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_1_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy1048576_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_1_2_prt_sp1" for table 
"ao_wt_sub_partsnappy1048576_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_1_2_prt_sp2" for table 
"ao_wt_sub_partsnappy1048576_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_2_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy1048576_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_2_2_prt_sp1" for table 
"ao_wt_sub_partsnappy1048576_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_2_2_prt_sp2" for table 
"ao_wt_sub_partsnappy1048576_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_3_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy1048576_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_3_2_prt_sp1" for table 
"ao_wt_sub_partsnappy1048576_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy1048576_1_1_prt_3_2_prt_sp2" for table 

[13/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_crtb_with_row_snappy_32768.sql
--
diff --git a/src/test/feature/ao/sql/ao_crtb_with_row_snappy_32768.sql 
b/src/test/feature/ao/sql/ao_crtb_with_row_snappy_32768.sql
new file mode 100644
index 000..145f325
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_crtb_with_row_snappy_32768.sql
@@ -0,0 +1,219 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:01
+-- @modified 2013-08-06 23:59:01
+-- @tags HAWQ Storage
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_crtb_with_row_snappy_32768_1 cascade;
+
+DROP TABLE if exists ao_crtb_with_row_snappy_32768_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_crtb_with_row_snappy_32768_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=32768) 
distributed randomly;
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_crtb_with_row_snappy_32768_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough
  votes to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0
 
,2,3)','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson
 & Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_crtb_with_row_snappy_32768_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 
school.For most children, the adjustment is quick. Tears will usually disappear 
after Mommy and  Daddy leave the classroom. Do not plead with your 
child',generate_series(2500,2516),'2011-10-12','Some students may need time to 
adjust to 

[22/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_wt_partsnappy32768.ans
--
diff --git a/src/test/feature/ao/ans/ao_wt_partsnappy32768.ans 
b/src/test/feature/ao/ans/ao_wt_partsnappy32768.ans
new file mode 100644
index 000..be9537a
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_wt_partsnappy32768.ans
@@ -0,0 +1,997 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_Partition32768;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:11
+-- @modified 2013-08-06 23:59:11
+-- @tags HAWQ Storage ao_wt
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_partsnappy32768_1 cascade;
+psql:/tmp/TestAOSnappy_Partition32768.sql:13: NOTICE:  table 
"ao_wt_partsnappy32768_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_wt_partsnappy32768_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_Partition32768.sql:15: NOTICE:  table 
"ao_wt_partsnappy32768_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_wt_partsnappy32768_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly Partition by 
range(a1) (start(1)  end(5000) every(1000) 
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=32768));
+psql:/tmp/TestAOSnappy_Partition32768.sql:23: NOTICE:  CREATE TABLE will 
create implicit sequence "ao_wt_partsnappy32768_1_id_seq" for serial column 
"ao_wt_partsnappy32768_1.id"
+psql:/tmp/TestAOSnappy_Partition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy32768_1_1_prt_1" for table 
"ao_wt_partsnappy32768_1"
+psql:/tmp/TestAOSnappy_Partition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy32768_1_1_prt_2" for table 
"ao_wt_partsnappy32768_1"
+psql:/tmp/TestAOSnappy_Partition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy32768_1_1_prt_3" for table 
"ao_wt_partsnappy32768_1"
+psql:/tmp/TestAOSnappy_Partition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy32768_1_1_prt_4" for table 
"ao_wt_partsnappy32768_1"
+psql:/tmp/TestAOSnappy_Partition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy32768_1_1_prt_5" for table 
"ao_wt_partsnappy32768_1"
+CREATE TABLE
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_partsnappy32768_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough votes t
 o pass the bill.','WASHINGTON:House Speaker John Boehner says his plan mixing 
spending cuts in exchange for raising the nations $14.3 trillion debt limit is 
not perfect but is as large a step that a divided government can take that is 
doable and signable by President Barack Obama.The Ohio Republican says the 
measure is an honest and sincere attempt at compromise and was negotiated with 
Democrats last weekend and that passing it would end the ongoing debt crisis. 
The plan blends $900 billion-plus in spending cuts with a companion increase in 
the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,2,3)','
 

[05/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_wt_sub_partsnappy1048576.sql
--
diff --git a/src/test/feature/ao/sql/ao_wt_sub_partsnappy1048576.sql 
b/src/test/feature/ao/sql/ao_wt_sub_partsnappy1048576.sql
new file mode 100644
index 000..396eea4
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_wt_sub_partsnappy1048576.sql
@@ -0,0 +1,583 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:31
+-- @modified 2013-08-06 23:59:31
+-- @tags HAWQ Storage ao_wt_sub
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_sub_partsnappy1048576_1 cascade;
+
+DROP TABLE if exists ao_wt_sub_partsnappy1048576_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_wt_sub_partsnappy1048576_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly  Partition by 
range(a1) Subpartition by list(a2) subpartition template ( default subpartition 
df_sp, subpartition sp1 values('M') , subpartition sp2 values('F')  
+ WITH (appendonly=true, 
orientation=row,compresstype=snappy,blocksize=1048576)) (start(1)  end(5000) 
every(1000) );
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_sub_partsnappy1048576_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough v
 otes to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,2
 
,3)','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson 
& Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_wt_sub_partsnappy1048576_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 

[28/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_crtb_with_row_snappy_2097152.ans
--
diff --git a/src/test/feature/ao/ans/ao_crtb_with_row_snappy_2097152.ans 
b/src/test/feature/ao/ans/ao_crtb_with_row_snappy_2097152.ans
new file mode 100644
index 000..c6d7d6c
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_crtb_with_row_snappy_2097152.ans
@@ -0,0 +1,464 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_TestAOSnappyCreate2097152;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:58:48
+-- @modified 2013-08-06 23:58:48
+-- @tags HAWQ Storage
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_crtb_with_row_snappy_2097152_1 cascade;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate2097152.sql:13: NOTICE:  table 
"ao_crtb_with_row_snappy_2097152_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_crtb_with_row_snappy_2097152_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate2097152.sql:15: NOTICE:  table 
"ao_crtb_with_row_snappy_2097152_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_crtb_with_row_snappy_2097152_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=2097152) 
distributed randomly;
+psql:/tmp/TestAOSnappy_TestAOSnappyCreate2097152.sql:22: NOTICE:  CREATE TABLE 
will create implicit sequence "ao_crtb_with_row_snappy_2097152_1_id_seq" for 
serial column "ao_crtb_with_row_snappy_2097152_1.id"
+CREATE TABLE
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_crtb_with_row_snappy_2097152_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enou
 gh votes to pass the bill.','WASHINGTON:House Speaker John Boehner says his 
plan mixing spending cuts in exchange for raising the nations $14.3 trillion 
debt limit is not perfect but is as large a step that a divided government can 
take that is doable and signable by President Barack Obama.The Ohio Republican 
says the measure is an honest and sincere attempt at compromise and was 
negotiated with Democrats last weekend and that passing it would end the 
ongoing debt crisis. The plan blends $900 billion-plus in spending cuts with a 
companion increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1
 
,0,2,3)','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson
 & Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+INSERT 0 880
+ INSERT INTO 

[04/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_wt_sub_partsnappy32768.sql
--
diff --git a/src/test/feature/ao/sql/ao_wt_sub_partsnappy32768.sql 
b/src/test/feature/ao/sql/ao_wt_sub_partsnappy32768.sql
new file mode 100644
index 000..de855d3
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_wt_sub_partsnappy32768.sql
@@ -0,0 +1,447 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:31
+-- @modified 2013-08-06 23:59:31
+-- @tags HAWQ Storage ao_wt_sub
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_sub_partsnappy32768_1 cascade;
+
+DROP TABLE if exists ao_wt_sub_partsnappy32768_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_wt_sub_partsnappy32768_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly  Partition by 
range(a1) Subpartition by list(a2) subpartition template ( default subpartition 
df_sp, subpartition sp1 values('M') , subpartition sp2 values('F')  
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=32768)) 
(start(1)  end(5000) every(1000) );
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_sub_partsnappy32768_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough vot
 es to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,2,3
 )','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson 
& Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_wt_sub_partsnappy32768_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 
school.For most 

[21/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_wt_partsnappy65536.ans
--
diff --git a/src/test/feature/ao/ans/ao_wt_partsnappy65536.ans 
b/src/test/feature/ao/ans/ao_wt_partsnappy65536.ans
new file mode 100644
index 000..80d773e
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_wt_partsnappy65536.ans
@@ -0,0 +1,1057 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_Partition65536;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:11
+-- @modified 2013-08-06 23:59:11
+-- @tags HAWQ Storage ao_wt
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_partsnappy65536_1 cascade;
+psql:/tmp/TestAOSnappy_Partition65536.sql:13: NOTICE:  table 
"ao_wt_partsnappy65536_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_wt_partsnappy65536_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_Partition65536.sql:15: NOTICE:  table 
"ao_wt_partsnappy65536_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_wt_partsnappy65536_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly Partition by 
range(a1) (start(1)  end(5000) every(1000) 
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=65536));
+psql:/tmp/TestAOSnappy_Partition65536.sql:23: NOTICE:  CREATE TABLE will 
create implicit sequence "ao_wt_partsnappy65536_1_id_seq" for serial column 
"ao_wt_partsnappy65536_1.id"
+psql:/tmp/TestAOSnappy_Partition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy65536_1_1_prt_1" for table 
"ao_wt_partsnappy65536_1"
+psql:/tmp/TestAOSnappy_Partition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy65536_1_1_prt_2" for table 
"ao_wt_partsnappy65536_1"
+psql:/tmp/TestAOSnappy_Partition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy65536_1_1_prt_3" for table 
"ao_wt_partsnappy65536_1"
+psql:/tmp/TestAOSnappy_Partition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy65536_1_1_prt_4" for table 
"ao_wt_partsnappy65536_1"
+psql:/tmp/TestAOSnappy_Partition65536.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy65536_1_1_prt_5" for table 
"ao_wt_partsnappy65536_1"
+CREATE TABLE
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_partsnappy65536_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough votes t
 o pass the bill.','WASHINGTON:House Speaker John Boehner says his plan mixing 
spending cuts in exchange for raising the nations $14.3 trillion debt limit is 
not perfect but is as large a step that a divided government can take that is 
doable and signable by President Barack Obama.The Ohio Republican says the 
measure is an honest and sincere attempt at compromise and was negotiated with 
Democrats last weekend and that passing it would end the ongoing debt crisis. 
The plan blends $900 billion-plus in spending cuts with a companion increase in 
the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,2,3)','
 

[24/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_wt_partsnappy1048576.ans
--
diff --git a/src/test/feature/ao/ans/ao_wt_partsnappy1048576.ans 
b/src/test/feature/ao/ans/ao_wt_partsnappy1048576.ans
new file mode 100644
index 000..7d08ea3
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_wt_partsnappy1048576.ans
@@ -0,0 +1,1117 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_Partition1048576;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:11
+-- @modified 2013-08-06 23:59:11
+-- @tags HAWQ Storage ao_wt
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_partsnappy1048576_1 cascade;
+psql:/tmp/TestAOSnappy_Partition1048576.sql:13: NOTICE:  table 
"ao_wt_partsnappy1048576_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_wt_partsnappy1048576_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_Partition1048576.sql:15: NOTICE:  table 
"ao_wt_partsnappy1048576_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_wt_partsnappy1048576_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly Partition by 
range(a1) (start(1)  end(5000) every(1000) 
+ WITH (appendonly=true, 
orientation=row,compresstype=snappy,blocksize=1048576));
+psql:/tmp/TestAOSnappy_Partition1048576.sql:23: NOTICE:  CREATE TABLE will 
create implicit sequence "ao_wt_partsnappy1048576_1_id_seq" for serial column 
"ao_wt_partsnappy1048576_1.id"
+psql:/tmp/TestAOSnappy_Partition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy1048576_1_1_prt_1" for table 
"ao_wt_partsnappy1048576_1"
+psql:/tmp/TestAOSnappy_Partition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy1048576_1_1_prt_2" for table 
"ao_wt_partsnappy1048576_1"
+psql:/tmp/TestAOSnappy_Partition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy1048576_1_1_prt_3" for table 
"ao_wt_partsnappy1048576_1"
+psql:/tmp/TestAOSnappy_Partition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy1048576_1_1_prt_4" for table 
"ao_wt_partsnappy1048576_1"
+psql:/tmp/TestAOSnappy_Partition1048576.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_partsnappy1048576_1_1_prt_5" for table 
"ao_wt_partsnappy1048576_1"
+CREATE TABLE
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_partsnappy1048576_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough votes
  to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 

[16/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_wt_sub_partsnappy8192.ans
--
diff --git a/src/test/feature/ao/ans/ao_wt_sub_partsnappy8192.ans 
b/src/test/feature/ao/ans/ao_wt_sub_partsnappy8192.ans
new file mode 100644
index 000..b3e9b4f
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_wt_sub_partsnappy8192.ans
@@ -0,0 +1,1141 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_SubPartition8192;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:31
+-- @modified 2013-08-06 23:59:31
+-- @tags HAWQ Storage ao_wt_sub
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_sub_partsnappy8192_1 cascade;
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:13: NOTICE:  table 
"ao_wt_sub_partsnappy8192_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_wt_sub_partsnappy8192_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:15: NOTICE:  table 
"ao_wt_sub_partsnappy8192_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_wt_sub_partsnappy8192_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly  Partition by 
range(a1) Subpartition by list(a2) subpartition template ( default subpartition 
df_sp, subpartition sp1 values('M') , subpartition sp2 values('F')  
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=8192)) 
(start(1)  end(5000) every(1000) );
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create implicit sequence "ao_wt_sub_partsnappy8192_1_id_seq" for serial column 
"ao_wt_sub_partsnappy8192_1.id"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_1" for table 
"ao_wt_sub_partsnappy8192_1"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_2" for table 
"ao_wt_sub_partsnappy8192_1"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_3" for table 
"ao_wt_sub_partsnappy8192_1"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_4" for table 
"ao_wt_sub_partsnappy8192_1"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_5" for table 
"ao_wt_sub_partsnappy8192_1"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_1_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy8192_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_1_2_prt_sp1" for table 
"ao_wt_sub_partsnappy8192_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_1_2_prt_sp2" for table 
"ao_wt_sub_partsnappy8192_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_2_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy8192_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_2_2_prt_sp1" for table 
"ao_wt_sub_partsnappy8192_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_2_2_prt_sp2" for table 
"ao_wt_sub_partsnappy8192_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_3_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy8192_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_3_2_prt_sp1" for table 
"ao_wt_sub_partsnappy8192_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_3_2_prt_sp2" for table 
"ao_wt_sub_partsnappy8192_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition8192.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy8192_1_1_prt_4_2_prt_df_sp" for table 

[09/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_wt_partsnappy2097152.sql
--
diff --git a/src/test/feature/ao/sql/ao_wt_partsnappy2097152.sql 
b/src/test/feature/ao/sql/ao_wt_partsnappy2097152.sql
new file mode 100644
index 000..3ed1fae
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_wt_partsnappy2097152.sql
@@ -0,0 +1,641 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:11
+-- @modified 2013-08-06 23:59:11
+-- @tags HAWQ Storage ao_wt
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_partsnappy2097152_1 cascade;
+
+DROP TABLE if exists ao_wt_partsnappy2097152_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_wt_partsnappy2097152_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly Partition by 
range(a1) (start(1)  end(5000) every(1000) 
+ WITH (appendonly=true, 
orientation=row,compresstype=snappy,blocksize=2097152));
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_partsnappy2097152_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough votes
  to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,2,3)'
 ,'2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson & 
Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_wt_partsnappy2097152_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 
school.For most children, the adjustment is quick. Tears will usually disappear 
after Mommy and  Daddy leave the classroom. Do not plead with your 

[30/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
HAWQ-878. Add googletest cases for the ao snappy compression support.


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

Branch: refs/heads/master
Commit: 8284370054d0b304481d7270b14b024e18098b52
Parents: f44343a
Author: Paul Guo 
Authored: Wed Jun 29 10:38:20 2016 +0800
Committer: ivan 
Committed: Thu Jun 30 11:01:05 2016 +0800

--
 src/test/feature/ao/TestAoSnappy.cpp|  126 ++
 .../ao/ans/ao_crtb_with_row_snappy_1048576.ans  |  419 ++
 .../ao/ans/ao_crtb_with_row_snappy_2097152.ans  |  464 ++
 .../ao/ans/ao_crtb_with_row_snappy_32768.ans|  329 +
 .../ao/ans/ao_crtb_with_row_snappy_65536.ans|  374 +
 .../ao/ans/ao_crtb_with_row_snappy_8192.ans |  284 
 .../feature/ao/ans/ao_wt_partsnappy1048576.ans  | 1117 +++
 .../feature/ao/ans/ao_wt_partsnappy2097152.ans  | 1177 
 .../feature/ao/ans/ao_wt_partsnappy32768.ans|  997 +
 .../feature/ao/ans/ao_wt_partsnappy65536.ans| 1057 ++
 .../feature/ao/ans/ao_wt_partsnappy8192.ans |  937 +
 .../ao/ans/ao_wt_sub_partsnappy1048576.ans  | 1321 ++
 .../ao/ans/ao_wt_sub_partsnappy32768.ans| 1201 
 .../ao/ans/ao_wt_sub_partsnappy65536.ans| 1261 +
 .../feature/ao/ans/ao_wt_sub_partsnappy8192.ans | 1141 +++
 .../ao/sql/ao_crtb_with_row_snappy_1048576.sql  |  323 +
 .../ao/sql/ao_crtb_with_row_snappy_2097152.sql  |  372 +
 .../ao/sql/ao_crtb_with_row_snappy_32768.sql|  219 +++
 .../ao/sql/ao_crtb_with_row_snappy_65536.sql|  270 
 .../ao/sql/ao_crtb_with_row_snappy_8192.sql |  168 +++
 .../feature/ao/sql/ao_wt_partsnappy1048576.sql  |  573 
 .../feature/ao/sql/ao_wt_partsnappy2097152.sql  |  641 +
 .../feature/ao/sql/ao_wt_partsnappy32768.sql|  437 ++
 .../feature/ao/sql/ao_wt_partsnappy65536.sql|  505 +++
 .../feature/ao/sql/ao_wt_partsnappy8192.sql |  369 +
 .../ao/sql/ao_wt_sub_partsnappy1048576.sql  |  583 
 .../ao/sql/ao_wt_sub_partsnappy32768.sql|  447 ++
 .../ao/sql/ao_wt_sub_partsnappy65536.sql|  515 +++
 .../feature/ao/sql/ao_wt_sub_partsnappy8192.sql |  379 +
 src/test/feature/ao/sql/init_file   |6 +
 30 files changed, 18012 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/TestAoSnappy.cpp
--
diff --git a/src/test/feature/ao/TestAoSnappy.cpp 
b/src/test/feature/ao/TestAoSnappy.cpp
new file mode 100755
index 000..72044f7
--- /dev/null
+++ b/src/test/feature/ao/TestAoSnappy.cpp
@@ -0,0 +1,126 @@
+#include "gtest/gtest.h"
+
+#include "lib/sql_util.h"
+
+using std::string;
+
+class TestAOSnappy: public ::testing::Test
+{
+   public:
+   const string initFile = "ao/sql/init_file";
+   TestAOSnappy() { }
+   ~TestAOSnappy() {}
+};
+
+TEST_F(TestAOSnappy, Create1048576)
+{
+   hawq::test::SQLUtility util;
+   util.execSQLFile("ao/sql/ao_crtb_with_row_snappy_1048576.sql",
+"ao/ans/ao_crtb_with_row_snappy_1048576.ans",
+initFile);
+}
+
+TEST_F(TestAOSnappy, Create2097152)
+{
+   hawq::test::SQLUtility util;
+   util.execSQLFile("ao/sql/ao_crtb_with_row_snappy_2097152.sql",
+ "ao/ans/ao_crtb_with_row_snappy_2097152.ans",
+initFile);
+}
+
+TEST_F(TestAOSnappy, Create32768)
+{
+   hawq::test::SQLUtility util;
+   util.execSQLFile("ao/sql/ao_crtb_with_row_snappy_32768.sql",
+"ao/ans/ao_crtb_with_row_snappy_32768.ans",
+initFile);
+}
+
+TEST_F(TestAOSnappy, Create65536)
+{
+   hawq::test::SQLUtility util;
+   util.execSQLFile("ao/sql/ao_crtb_with_row_snappy_65536.sql",
+"ao/ans/ao_crtb_with_row_snappy_65536.ans",
+initFile);
+}
+
+TEST_F(TestAOSnappy, Create8192)
+{
+   hawq::test::SQLUtility util;
+   util.execSQLFile("ao/sql/ao_crtb_with_row_snappy_8192.sql",
+"ao/ans/ao_crtb_with_row_snappy_8192.ans",
+initFile);
+}
+
+TEST_F(TestAOSnappy, Partition1048576)
+{
+   hawq::test::SQLUtility util;
+   util.execSQLFile("ao/sql/ao_wt_partsnappy1048576.sql",
+"ao/ans/ao_wt_partsnappy1048576.ans",
+initFile);
+}
+
+TEST_F(TestAOSnappy, Partition2097152)
+{
+   

[18/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_wt_sub_partsnappy32768.ans
--
diff --git a/src/test/feature/ao/ans/ao_wt_sub_partsnappy32768.ans 
b/src/test/feature/ao/ans/ao_wt_sub_partsnappy32768.ans
new file mode 100644
index 000..8dba628
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_wt_sub_partsnappy32768.ans
@@ -0,0 +1,1201 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_SubPartition32768;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:31
+-- @modified 2013-08-06 23:59:31
+-- @tags HAWQ Storage ao_wt_sub
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_sub_partsnappy32768_1 cascade;
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:13: NOTICE:  table 
"ao_wt_sub_partsnappy32768_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_wt_sub_partsnappy32768_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:15: NOTICE:  table 
"ao_wt_sub_partsnappy32768_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_wt_sub_partsnappy32768_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly  Partition by 
range(a1) Subpartition by list(a2) subpartition template ( default subpartition 
df_sp, subpartition sp1 values('M') , subpartition sp2 values('F')  
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=32768)) 
(start(1)  end(5000) every(1000) );
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create implicit sequence "ao_wt_sub_partsnappy32768_1_id_seq" for serial column 
"ao_wt_sub_partsnappy32768_1.id"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_1" for table 
"ao_wt_sub_partsnappy32768_1"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_2" for table 
"ao_wt_sub_partsnappy32768_1"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_3" for table 
"ao_wt_sub_partsnappy32768_1"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_4" for table 
"ao_wt_sub_partsnappy32768_1"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_5" for table 
"ao_wt_sub_partsnappy32768_1"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_1_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy32768_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_1_2_prt_sp1" for table 
"ao_wt_sub_partsnappy32768_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_1_2_prt_sp2" for table 
"ao_wt_sub_partsnappy32768_1_1_prt_1"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_2_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy32768_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_2_2_prt_sp1" for table 
"ao_wt_sub_partsnappy32768_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_2_2_prt_sp2" for table 
"ao_wt_sub_partsnappy32768_1_1_prt_2"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_3_2_prt_df_sp" for table 
"ao_wt_sub_partsnappy32768_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_3_2_prt_sp1" for table 
"ao_wt_sub_partsnappy32768_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition "ao_wt_sub_partsnappy32768_1_1_prt_3_2_prt_sp2" for table 
"ao_wt_sub_partsnappy32768_1_1_prt_3"
+psql:/tmp/TestAOSnappy_SubPartition32768.sql:23: NOTICE:  CREATE TABLE will 
create partition 

[12/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_crtb_with_row_snappy_65536.sql
--
diff --git a/src/test/feature/ao/sql/ao_crtb_with_row_snappy_65536.sql 
b/src/test/feature/ao/sql/ao_crtb_with_row_snappy_65536.sql
new file mode 100644
index 000..a2e71c5
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_crtb_with_row_snappy_65536.sql
@@ -0,0 +1,270 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:01
+-- @modified 2013-08-06 23:59:01
+-- @tags HAWQ Storage
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_crtb_with_row_snappy_65536_1 cascade;
+
+DROP TABLE if exists ao_crtb_with_row_snappy_65536_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_crtb_with_row_snappy_65536_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=65536) 
distributed randomly;
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_crtb_with_row_snappy_65536_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough
  votes to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0
 
,2,3)','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson
 & Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_crtb_with_row_snappy_65536_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 
school.For most children, the adjustment is quick. Tears will usually disappear 
after Mommy and  Daddy leave the classroom. Do not plead with your 
child',generate_series(2500,2516),'2011-10-12','Some students may need time to 
adjust to 

[03/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_wt_sub_partsnappy65536.sql
--
diff --git a/src/test/feature/ao/sql/ao_wt_sub_partsnappy65536.sql 
b/src/test/feature/ao/sql/ao_wt_sub_partsnappy65536.sql
new file mode 100644
index 000..7861cfa
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_wt_sub_partsnappy65536.sql
@@ -0,0 +1,515 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:31
+-- @modified 2013-08-06 23:59:31
+-- @tags HAWQ Storage ao_wt_sub
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_sub_partsnappy65536_1 cascade;
+
+DROP TABLE if exists ao_wt_sub_partsnappy65536_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_wt_sub_partsnappy65536_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly  Partition by 
range(a1) Subpartition by list(a2) subpartition template ( default subpartition 
df_sp, subpartition sp1 values('M') , subpartition sp2 values('F')  
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=65536)) 
(start(1)  end(5000) every(1000) );
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_sub_partsnappy65536_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough vot
 es to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,2,3
 )','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson 
& Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_wt_sub_partsnappy65536_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 
school.For most 

[14/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_crtb_with_row_snappy_2097152.sql
--
diff --git a/src/test/feature/ao/sql/ao_crtb_with_row_snappy_2097152.sql 
b/src/test/feature/ao/sql/ao_crtb_with_row_snappy_2097152.sql
new file mode 100644
index 000..7f6d075
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_crtb_with_row_snappy_2097152.sql
@@ -0,0 +1,372 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:58:48
+-- @modified 2013-08-06 23:58:48
+-- @tags HAWQ Storage
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_crtb_with_row_snappy_2097152_1 cascade;
+
+DROP TABLE if exists ao_crtb_with_row_snappy_2097152_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_crtb_with_row_snappy_2097152_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=2097152) 
distributed randomly;
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_crtb_with_row_snappy_2097152_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enou
 gh votes to pass the bill.','WASHINGTON:House Speaker John Boehner says his 
plan mixing spending cuts in exchange for raising the nations $14.3 trillion 
debt limit is not perfect but is as large a step that a divided government can 
take that is doable and signable by President Barack Obama.The Ohio Republican 
says the measure is an honest and sincere attempt at compromise and was 
negotiated with Democrats last weekend and that passing it would end the 
ongoing debt crisis. The plan blends $900 billion-plus in spending cuts with a 
companion increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1
 
,0,2,3)','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson
 & Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_crtb_with_row_snappy_2097152_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 
school.For most children, the adjustment is quick. Tears will usually disappear 
after Mommy and  Daddy leave the classroom. Do not plead with your 
child',generate_series(2500,2516),'2011-10-12','Some students may 

[20/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/ans/ao_wt_partsnappy8192.ans
--
diff --git a/src/test/feature/ao/ans/ao_wt_partsnappy8192.ans 
b/src/test/feature/ao/ans/ao_wt_partsnappy8192.ans
new file mode 100644
index 000..76844ef
--- /dev/null
+++ b/src/test/feature/ao/ans/ao_wt_partsnappy8192.ans
@@ -0,0 +1,937 @@
+-- start_ignore
+SET SEARCH_PATH=TestAOSnappy_Partition8192;
+SET
+-- end_ignore
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:11
+-- @modified 2013-08-06 23:59:11
+-- @tags HAWQ Storage ao_wt
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_partsnappy8192_1 cascade;
+psql:/tmp/TestAOSnappy_Partition8192.sql:13: NOTICE:  table 
"ao_wt_partsnappy8192_1" does not exist, skipping
+DROP TABLE
+DROP TABLE if exists ao_wt_partsnappy8192_1_uncompr cascade;
+psql:/tmp/TestAOSnappy_Partition8192.sql:15: NOTICE:  table 
"ao_wt_partsnappy8192_1_uncompr" does not exist, skipping
+DROP TABLE
+--
+-- Create table
+--
+CREATE TABLE ao_wt_partsnappy8192_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly Partition by 
range(a1) (start(1)  end(5000) every(1000) 
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=8192));
+psql:/tmp/TestAOSnappy_Partition8192.sql:23: NOTICE:  CREATE TABLE will create 
implicit sequence "ao_wt_partsnappy8192_1_id_seq" for serial column 
"ao_wt_partsnappy8192_1.id"
+psql:/tmp/TestAOSnappy_Partition8192.sql:23: NOTICE:  CREATE TABLE will create 
partition "ao_wt_partsnappy8192_1_1_prt_1" for table "ao_wt_partsnappy8192_1"
+psql:/tmp/TestAOSnappy_Partition8192.sql:23: NOTICE:  CREATE TABLE will create 
partition "ao_wt_partsnappy8192_1_1_prt_2" for table "ao_wt_partsnappy8192_1"
+psql:/tmp/TestAOSnappy_Partition8192.sql:23: NOTICE:  CREATE TABLE will create 
partition "ao_wt_partsnappy8192_1_1_prt_3" for table "ao_wt_partsnappy8192_1"
+psql:/tmp/TestAOSnappy_Partition8192.sql:23: NOTICE:  CREATE TABLE will create 
partition "ao_wt_partsnappy8192_1_1_prt_4" for table "ao_wt_partsnappy8192_1"
+psql:/tmp/TestAOSnappy_Partition8192.sql:23: NOTICE:  CREATE TABLE will create 
partition "ao_wt_partsnappy8192_1_1_prt_5" for table "ao_wt_partsnappy8192_1"
+CREATE TABLE
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_partsnappy8192_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough votes to
  pass the bill.','WASHINGTON:House Speaker John Boehner says his plan mixing 
spending cuts in exchange for raising the nations $14.3 trillion debt limit is 
not perfect but is as large a step that a divided government can take that is 
doable and signable by President Barack Obama.The Ohio Republican says the 
measure is an honest and sincere attempt at compromise and was negotiated with 
Democrats last weekend and that passing it would end the ongoing debt crisis. 
The plan blends $900 billion-plus in spending cuts with a companion increase in 
the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,2,3)','2
 

[15/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_crtb_with_row_snappy_1048576.sql
--
diff --git a/src/test/feature/ao/sql/ao_crtb_with_row_snappy_1048576.sql 
b/src/test/feature/ao/sql/ao_crtb_with_row_snappy_1048576.sql
new file mode 100644
index 000..a2d0ff5
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_crtb_with_row_snappy_1048576.sql
@@ -0,0 +1,323 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:58:48
+-- @modified 2013-08-06 23:58:48
+-- @tags HAWQ Storage
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_crtb_with_row_snappy_1048576_1 cascade;
+
+DROP TABLE if exists ao_crtb_with_row_snappy_1048576_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_crtb_with_row_snappy_1048576_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=1048576) 
distributed randomly;
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_crtb_with_row_snappy_1048576_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enou
 gh votes to pass the bill.','WASHINGTON:House Speaker John Boehner says his 
plan mixing spending cuts in exchange for raising the nations $14.3 trillion 
debt limit is not perfect but is as large a step that a divided government can 
take that is doable and signable by President Barack Obama.The Ohio Republican 
says the measure is an honest and sincere attempt at compromise and was 
negotiated with Democrats last weekend and that passing it would end the 
ongoing debt crisis. The plan blends $900 billion-plus in spending cuts with a 
companion increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1
 
,0,2,3)','2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson
 & Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_crtb_with_row_snappy_1048576_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 
school.For most children, the adjustment is quick. Tears will usually disappear 
after Mommy and  Daddy leave the classroom. Do not plead with your 
child',generate_series(2500,2516),'2011-10-12','Some students may 

[10/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_wt_partsnappy1048576.sql
--
diff --git a/src/test/feature/ao/sql/ao_wt_partsnappy1048576.sql 
b/src/test/feature/ao/sql/ao_wt_partsnappy1048576.sql
new file mode 100644
index 000..cc7231b
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_wt_partsnappy1048576.sql
@@ -0,0 +1,573 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:11
+-- @modified 2013-08-06 23:59:11
+-- @tags HAWQ Storage ao_wt
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_partsnappy1048576_1 cascade;
+
+DROP TABLE if exists ao_wt_partsnappy1048576_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_wt_partsnappy1048576_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly Partition by 
range(a1) (start(1)  end(5000) every(1000) 
+ WITH (appendonly=true, 
orientation=row,compresstype=snappy,blocksize=1048576));
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_partsnappy1048576_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough votes
  to pass the bill.','WASHINGTON:House Speaker John Boehner says his plan 
mixing spending cuts in exchange for raising the nations $14.3 trillion debt 
limit is not perfect but is as large a step that a divided government can take 
that is doable and signable by President Barack Obama.The Ohio Republican says 
the measure is an honest and sincere attempt at compromise and was negotiated 
with Democrats last weekend and that passing it would end the ongoing debt 
crisis. The plan blends $900 billion-plus in spending cuts with a companion 
increase in the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,2,3)'
 ,'2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson & 
Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_wt_partsnappy1048576_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 
school.For most children, the adjustment is quick. Tears will usually disappear 
after Mommy and  Daddy leave the classroom. Do not plead with your 

[07/30] incubator-hawq git commit: HAWQ-878. Add googletest cases for the ao snappy compression support.

2016-06-29 Thread iweng
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82843700/src/test/feature/ao/sql/ao_wt_partsnappy65536.sql
--
diff --git a/src/test/feature/ao/sql/ao_wt_partsnappy65536.sql 
b/src/test/feature/ao/sql/ao_wt_partsnappy65536.sql
new file mode 100644
index 000..2beb4dc
--- /dev/null
+++ b/src/test/feature/ao/sql/ao_wt_partsnappy65536.sql
@@ -0,0 +1,505 @@
+-- @author yaoj2
+-- @description AO compression
+-- @created 2013-08-06 23:59:11
+-- @modified 2013-08-06 23:59:11
+-- @tags HAWQ Storage ao_wt
+
+--
+-- Drop table if exists
+--
+DROP TABLE if exists ao_wt_partsnappy65536_1 cascade;
+
+DROP TABLE if exists ao_wt_partsnappy65536_1_uncompr cascade;
+
+--
+-- Create table
+--
+CREATE TABLE ao_wt_partsnappy65536_1 
+   (id SERIAL,a1 int,a2 char(5),a3 numeric,a4 boolean DEFAULT false ,a5 
char DEFAULT 'd',a6 text,a7 timestamp,a8 character varying(705),a9 bigint,a10 
date,a11 varchar(600),a12 text,a13 decimal,a14 real,a15 bigint,a16 int4 ,a17 
bytea,a18 timestamp with time zone,a19 timetz,a20 path,a21 box,a22 macaddr,a23 
interval,a24 character varying(800),a25 lseg,a26 point,a27 double precision,a28 
circle,a29 int4,a30 numeric(8),a31 polygon,a32 date,a33 real,a34 money,a35 
cidr,a36 inet,a37 time,a38 text,a39 bit,a40 bit varying(5),a41 smallint,a42 int 
)
+ WITH (appendonly=true, orientation=row) distributed randomly Partition by 
range(a1) (start(1)  end(5000) every(1000) 
+ WITH (appendonly=true, orientation=row,compresstype=snappy,blocksize=65536));
+
+--
+-- Insert data to the table
+--
+ INSERT INTO 
ao_wt_partsnappy65536_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(1,20),'M',2011,'t','a','This is news of today: Deadlock 
between Republicans and Democrats over how best to reduce the U.S. deficit, and 
over what period, has blocked an agreement to allow the raising of the $14.3 
trillion debt ceiling','2001-12-24 02:26:11','U.S. House of Representatives 
Speaker John Boehner, the top Republican in Congress who has put forward a 
deficit reduction plan to be voted on later on Thursday said he had no control 
over whether his bill would avert a credit 
downgrade.',generate_series(2490,2505),'2011-10-11','The Republican-controlled 
House is tentatively scheduled to vote on Boehner proposal this afternoon at 
around 6 p.m. EDT (2200 GMT). The main Republican vote counter in the House, 
Kevin McCarthy, would not say if there were enough votes t
 o pass the bill.','WASHINGTON:House Speaker John Boehner says his plan mixing 
spending cuts in exchange for raising the nations $14.3 trillion debt limit is 
not perfect but is as large a step that a divided government can take that is 
doable and signable by President Barack Obama.The Ohio Republican says the 
measure is an honest and sincere attempt at compromise and was negotiated with 
Democrats last weekend and that passing it would end the ongoing debt crisis. 
The plan blends $900 billion-plus in spending cuts with a companion increase in 
the nations borrowing 
cap.','1234.56',323453,generate_series(3452,3462),7845,'0011','2005-07-16 
01:51:15+1359','2001-12-13 
01:51:15','((1,2),(0,3),(2,1))','((2,3)(4,5))','08:00:2b:01:02:03','1-2','Republicans
 had been working throughout the day Thursday to lock down support for their 
plan to raise the nations debt ceiling, even as Senate Democrats vowed to 
swiftly kill it if 
passed.','((2,3)(4,5))','(6,7)',11.222,'((4,5),7)',32,3214,'(1,0,2,3)','
 2010-02-21',43564,'$1,000.00','192.168.1','126.1.3.4','12:30:45','Johnson & 
Johnsons McNeil Consumer Healthcare announced the voluntary dosage reduction 
today. Labels will carry new dosing instructions this fall.The company says it 
will cut the maximum dosage of Regular Strength Tylenol and other 
acetaminophen-containing products in 2012.Acetaminophen is safe when used as 
directed, says Edwin Kuffner, MD, McNeil vice president of over-the-counter 
medical affairs. But, when too much is taken, it can cause liver damage.The 
action is intended to cut the risk of such accidental overdoses, the company 
says in a news release.','1','0',12,23); 
+
+ INSERT INTO 
ao_wt_partsnappy65536_1(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14,a15,a16,a17,a18,a19,a20,a21,a22,a23,a24,a25,a26,a27,a28,a29,a30,a31,a32,a33,a34,a35,a36,a37,a38,a39,a40,a41,a42)
 values(generate_series(500,510),'F',2010,'f','b','Some students may need time 
to adjust to school.For most children, the adjustment is quick. Tears will 
usually disappear after Mommy and  Daddy leave the classroom. Do not plead with 
your child','2001-12-25 02:22:11','Some students may need time to adjust to 
school.For most children, the adjustment is quick. Tears will usually disappear 
after Mommy and  Daddy leave the classroom. Do not plead with your 
child',generate_series(2500,2516),'2011-10-12','Some 

[01/30] [incubator-hawq] Git Push Summary

2016-06-29 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master f44343a46 -> 828437005


incubator-hawq git commit: HAWQ-876. Add the support for initFile option (used by gpdiff.pl finally) in hawq googletest framework.

2016-06-28 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master adf82292c -> 323fb6fd6


HAWQ-876. Add the support for initFile option (used by gpdiff.pl finally) in 
hawq googletest framework.

This patch also removes several annoying warnings.


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

Branch: refs/heads/master
Commit: 323fb6fd6aca838c821eb7280940526d7a8bdd4e
Parents: adf8229
Author: Paul Guo 
Authored: Tue Jun 28 18:09:23 2016 +0800
Committer: ivan 
Committed: Wed Jun 29 10:13:26 2016 +0800

--
 src/test/feature/lib/hawq_config.cpp |  2 +-
 src/test/feature/lib/psql.cpp| 13 +
 src/test/feature/lib/psql.h  |  3 ++-
 src/test/feature/lib/sql_util.cpp| 27 +++
 src/test/feature/lib/sql_util.h  |  3 ++-
 5 files changed, 37 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/323fb6fd/src/test/feature/lib/hawq_config.cpp
--
diff --git a/src/test/feature/lib/hawq_config.cpp 
b/src/test/feature/lib/hawq_config.cpp
index 287ca1b..94182f3 100644
--- a/src/test/feature/lib/hawq_config.cpp
+++ b/src/test/feature/lib/hawq_config.cpp
@@ -151,7 +151,7 @@ bool HawqConfig::isMultinodeMode() {
   psql.getQueryResult("select hostname from gp_segment_configuration");
   std::vector table = result.getRows();
   std::unordered_set hostnameMap;
-  for (int i = 0; i < table.size(); i++) {
+  for (unsigned int i = 0; i < table.size(); i++) {
 string hostname2 = table[i][0];
 if (hostname2 == "localhost") {
   char hostnamestr[256];

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/323fb6fd/src/test/feature/lib/psql.cpp
--
diff --git a/src/test/feature/lib/psql.cpp b/src/test/feature/lib/psql.cpp
index ecdd925..88531da 100644
--- a/src/test/feature/lib/psql.cpp
+++ b/src/test/feature/lib/psql.cpp
@@ -40,7 +40,7 @@ const string& PSQLQueryResult::getData(int ri, int ci) const {
 }
 
 string PSQLQueryResult::getData(int ri, const string& ck) const {
-  for (int ci = 0; ci < this->_fields.size(); ci++) {
+  for (unsigned int ci = 0; ci < this->_fields.size(); ci++) {
 if (ck == this->_fields[ci]) {
   return this->getData(ri, ci);
 }
@@ -199,12 +199,17 @@ const string PSQL::_getPSQLFileCommand(const string& 
file) const {
 
 bool PSQL::checkDiff(const string& expect_file,
  const string& result_file,
- bool save_diff) {
+ bool save_diff,
+ const string& init_file) {
   string diff_file = result_file + ".diff";
   string command;
   command.append("gpdiff.pl ")
-  .append(PSQL_BASIC_DIFF_OPTS)
-  .append(" ")
+  .append(PSQL_BASIC_DIFF_OPTS);
+  if (!init_file.empty()) {
+  command.append(" -gpd_init ")
+  .append(init_file);
+  }
+  command.append(" ")
   .append(expect_file)
   .append(" ")
   .append(result_file)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/323fb6fd/src/test/feature/lib/psql.h
--
diff --git a/src/test/feature/lib/psql.h b/src/test/feature/lib/psql.h
index 573b1a9..6363592 100644
--- a/src/test/feature/lib/psql.h
+++ b/src/test/feature/lib/psql.h
@@ -66,7 +66,8 @@ class PSQL {
 
   static bool checkDiff(const std::string& expect_file,
 const std::string& result_file,
-bool save_diff = true);
+bool save_diff = true,
+const std::string& init_file = "");
 
   void resetOutput();
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/323fb6fd/src/test/feature/lib/sql_util.cpp
--
diff --git a/src/test/feature/lib/sql_util.cpp 
b/src/test/feature/lib/sql_util.cpp
index 9537f0c..ea0c805 100644
--- a/src/test/feature/lib/sql_util.cpp
+++ b/src/test/feature/lib/sql_util.cpp
@@ -86,7 +86,10 @@ void SQLUtility::query(const string , const string 
) {
 }
 
 void SQLUtility::execSQLFile(const string ,
- const string ) {
+ const string ,
+ const string ) {
+  FilePath fp;
+
   // do precheck for sqlFile & ansFile
   if (hawq::test::startsWith(sqlFile, "/") ||
   hawq::test::startsWith(ansFile, "/"))
@@ -95,7 +98,7 @@ void SQLUtility::execSQLFile(const string ,
   string 

incubator-hawq git commit: Revert "HAWQ-789. Explicitly initialize GPOPT and its dependencies."

2016-06-07 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 62f2dfb3c -> 54fcf1461


Revert "HAWQ-789. Explicitly initialize GPOPT and its dependencies."

This reverts commit f2798203efc998a7138e899c053b4a7104ced5b0.


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

Branch: refs/heads/master
Commit: 54fcf1461a8ba663db2cacc5e89844570db8ee22
Parents: 62f2dfb
Author: ivan 
Authored: Wed Jun 8 13:23:04 2016 +0800
Committer: ivan 
Committed: Wed Jun 8 13:23:04 2016 +0800

--
 src/backend/gpopt/CGPOptimizer.cpp | 67 +
 src/backend/gpopt/ivy.xml  |  4 +-
 src/backend/utils/init/postinit.c  | 14 ---
 src/include/gpopt/CGPOptimizer.h   |  7 
 4 files changed, 3 insertions(+), 89 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/54fcf146/src/backend/gpopt/CGPOptimizer.cpp
--
diff --git a/src/backend/gpopt/CGPOptimizer.cpp 
b/src/backend/gpopt/CGPOptimizer.cpp
index db3cab8..c0eaa3e 100644
--- a/src/backend/gpopt/CGPOptimizer.cpp
+++ b/src/backend/gpopt/CGPOptimizer.cpp
@@ -48,7 +48,7 @@
 void
 CGPOptimizer::TouchLibraryInitializers()
 {
-   void (*gpos)(gpos_init_params*) = gpos_init;
+   void (*gpos)() = gpos_init;
void (*dxl)() = gpdxl_init;
void (*opt)() = gpopt_init;
 }
@@ -90,39 +90,6 @@ CGPOptimizer::SzDXLPlan
return COptTasks::SzOptimize(pquery);
 }
 
-//---
-// @function:
-// InitGPOPT()
-//
-// @doc:
-// Initialize GPTOPT and dependent libraries
-//
-//---
-void
-CGPOptimizer::InitGPOPT ()
-{
-  // Use GPORCA's default allocators
-  struct gpos_init_params params = { NULL, NULL };
-  gpos_init();
-  gpdxl_init();
-  gpopt_init();
-}
-
-//---
-// @function:
-// TerminateGPOPT()
-//
-// @doc:
-// Terminate GPOPT and dependent libraries
-//
-//---
-void
-CGPOptimizer::TerminateGPOPT ()
-{
-  gpopt_terminate();
-  gpdxl_terminate();
-  gpos_terminate();
-}
 
 //---
 // @function:
@@ -163,36 +130,4 @@ char *SzDXLPlan
 }
 }
 
-//---
-// @function:
-// InitGPOPT()
-//
-// @doc:
-// Initialize GPTOPT and dependent libraries
-//
-//---
-extern "C"
-{
-void InitGPOPT ()
-{
-   return CGPOptimizer::InitGPOPT();
-}
-}
-
-//---
-// @function:
-// TerminateGPOPT()
-//
-// @doc:
-// Terminate GPOPT and dependent libraries
-//
-//---
-extern "C"
-{
-void TerminateGPOPT ()
-{
-   return CGPOptimizer::TerminateGPOPT();
-}
-}
-
 // EOF

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/54fcf146/src/backend/gpopt/ivy.xml
--
diff --git a/src/backend/gpopt/ivy.xml b/src/backend/gpopt/ivy.xml
index 43423eb..a9d08aa 100644
--- a/src/backend/gpopt/ivy.xml
+++ b/src/backend/gpopt/ivy.xml
@@ -38,8 +38,8 @@ under the License.
 
 
 
-  
-  
+  
+  
   
 
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/54fcf146/src/backend/utils/init/postinit.c
--
diff --git a/src/backend/utils/init/postinit.c 
b/src/backend/utils/init/postinit.c
index 5358c5f..c2e3c96 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -62,11 +62,6 @@ static void InitCommunication(void);
 static void ShutdownPostgres(int code, Datum arg);
 static bool ThereIsAtLeastOneRole(void);
 
-#ifdef USE_ORCA
-extern void InitGPOPT();
-extern void TerminateGPOPT();
-#endif
-
 /*** InitPostgres support ***/
 
 /*
@@ -476,11 +471,6 @@ InitPostgres(const char *in_dbname, Oid dboid, const char 
*username,
/* Initialize memory protection */
GPMemoryProtect_Init();
 
-#ifdef USE_ORCA
-   /* Initialize GPOPT */
-   InitGPOPT();
-#endif
-
/*
 * Initialize my 

[1/2] incubator-hawq git commit: Revert "HAWQ-765. Delete Deadcode: CTranslatorDXLToQuery [#119780063]"

2016-06-07 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 23151d53a -> 3d11a5806


Revert "HAWQ-765. Delete Deadcode: CTranslatorDXLToQuery [#119780063]"

This reverts commit 82a1a8ba5fa7276eb60f45c0bdc83058c805aeda.


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

Branch: refs/heads/master
Commit: 37c5d6458a17463626552706d9b6c977322a303a
Parents: 23151d5
Author: ivan 
Authored: Wed Jun 8 10:51:56 2016 +0800
Committer: ivan 
Committed: Wed Jun 8 10:51:56 2016 +0800

--
 src/include/gpopt/utils/COptTasks.h | 4 
 1 file changed, 4 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/37c5d645/src/include/gpopt/utils/COptTasks.h
--
diff --git a/src/include/gpopt/utils/COptTasks.h 
b/src/include/gpopt/utils/COptTasks.h
index 867ff85..7f9c73e 100644
--- a/src/include/gpopt/utils/COptTasks.h
+++ b/src/include/gpopt/utils/COptTasks.h
@@ -285,6 +285,10 @@ class COptTasks
static
char *SzDXL(PlannedStmt *pplstmt);
 
+   // convert xml string to DXL and to Query
+   static
+   Query *PqueryFromXML(char *szXmlString);
+
// convert xml string to DXL and to PS
static
PlannedStmt *PplstmtFromXML(char *szXmlString);



[2/2] incubator-hawq git commit: Revert "HAWQ-765. Delete Deadcode: CTranslatorDXLToQuery [#119780063]"

2016-06-07 Thread iweng
Revert "HAWQ-765. Delete Deadcode: CTranslatorDXLToQuery [#119780063]"

This reverts commit 235d999101b1cf54447b83677dc938f1ba3ad1a2.


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

Branch: refs/heads/master
Commit: 3d11a5806dac739179198a13c13490f35804af22
Parents: 37c5d64
Author: ivan 
Authored: Wed Jun 8 10:53:16 2016 +0800
Committer: ivan 
Committed: Wed Jun 8 10:53:16 2016 +0800

--
 .../gpopt/translate/CTranslatorDXLToQuery.cpp   | 1478 ++
 .../gpopt/translate/CTranslatorDXLToScalar.cpp  |  212 +++
 src/backend/gpopt/translate/Makefile|1 +
 src/backend/gpopt/utils/COptTasks.cpp   |   87 ++
 src/backend/gpopt/utils/funcs.cpp   |   77 +
 .../gpopt/translate/CTranslatorDXLToQuery.h |  317 
 .../gpopt/translate/CTranslatorDXLToScalar.h|   25 +
 src/include/gpopt/utils/COptTasks.h |4 +
 8 files changed, 2201 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/3d11a580/src/backend/gpopt/translate/CTranslatorDXLToQuery.cpp
--
diff --git a/src/backend/gpopt/translate/CTranslatorDXLToQuery.cpp 
b/src/backend/gpopt/translate/CTranslatorDXLToQuery.cpp
new file mode 100644
index 000..260fe63
--- /dev/null
+++ b/src/backend/gpopt/translate/CTranslatorDXLToQuery.cpp
@@ -0,0 +1,1478 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+//---
+// @filename:
+// CTranslatorDXLToQuery.cpp
+//
+// @doc:
+// Implementation of the methods used to translate a DXL tree into 
query.
+// All translator methods allocate memory in the provided memory 
pool, and
+// the caller is responsible for freeing it.
+//
+//
+// @test:
+//
+//
+//---
+
+#define ALLOW_DatumGetPointer
+#define ALLOW_ntohl
+#define ALLOW_memset
+#define ALLOW_printf
+
+#include "postgres.h"
+#include "gpopt/translate/CMappingColIdVarQuery.h"
+#include "gpopt/translate/CMappingElementColIdTE.h"
+#include "gpopt/translate/CTranslatorDXLToQuery.h"
+#include "gpopt/translate/CTranslatorDXLToPlStmt.h"
+#include "gpopt/translate/CTranslatorUtils.h"
+
+#include "gpos/base.h"
+#include "gpos/common/CBitSet.h"
+
+#include "naucrates/dxl/CDXLUtils.h"
+#include "naucrates/md/IMDColumn.h"
+#include "naucrates/md/IMDRelation.h"
+
+#include "gpopt/mdcache/CMDAccessor.h"
+
+#include "gpopt/gpdbwrappers.h"
+
+using namespace gpmd;
+using namespace gpdxl;
+using namespace gpos;
+
+//---
+// @function:
+// CTranslatorDXLToQuery::CTranslatorDXLToQuery
+//
+// @doc:
+// Constructor
+//
+//---
+CTranslatorDXLToQuery::CTranslatorDXLToQuery
+   (
+   IMemoryPool *pmp,
+   CMDAccessor *pmda,
+   ULONG ulSegments
+   )
+   :
+   m_pmp(pmp),
+   m_pmda(pmda),
+   m_ulSortgrouprefCounter(0),
+   m_ulSegments(ulSegments)
+{
+   m_pdxlsctranslator = GPOS_NEW(m_pmp) CTranslatorDXLToScalar(m_pmp, 
m_pmda, m_ulSegments);
+}
+
+//---
+// @function:
+// CTranslatorDXLToQuery::~CTranslatorDXLToQuery
+//
+// @doc:
+// Destructor
+//
+//---
+CTranslatorDXLToQuery::~CTranslatorDXLToQuery()
+{
+   GPOS_DELETE(m_pdxlsctranslator);
+}
+
+//---
+// @function:
+// 

incubator-hawq git commit: HAWQ-713 Make lc_numeric guc to have GUC_GPDB_ADDOPT

2016-06-07 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master f2798203e -> 23151d53a


HAWQ-713 Make lc_numeric guc to have GUC_GPDB_ADDOPT


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

Branch: refs/heads/master
Commit: 23151d53abd612efc3acc79d05cde133c315e674
Parents: f279820
Author: Karthikeyan Jambu Rajaraman 
Authored: Tue May 3 13:39:58 2016 -0700
Committer: ivan 
Committed: Wed Jun 8 10:08:42 2016 +0800

--
 src/backend/utils/misc/guc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/23151d53/src/backend/utils/misc/guc.c
--
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 863f7ff..748705f 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -7494,7 +7494,9 @@ static struct config_string ConfigureNamesString[] =
{
{"lc_numeric", PGC_USERSET, CLIENT_CONN_LOCALE,
gettext_noop("Sets the locale for formatting numbers."),
-   NULL
+   NULL,
+   /* Please don't remove GUC_GPDB_ADDOPT or lc_numeric 
won't work correctly */
+   GUC_GPDB_ADDOPT
},
_numeric,
"C", locale_numeric_assign, NULL



incubator-hawq git commit: HAWQ-789. Explicitly initialize GPOPT and its dependencies.

2016-06-07 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 82a1a8ba5 -> f2798203e


HAWQ-789. Explicitly initialize GPOPT and its dependencies.

These were initialized by constructors earlier. To pass any parameters
for initializing GPOPT or any of its dependendencies, we need to do that
explicitly.


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

Branch: refs/heads/master
Commit: f2798203efc998a7138e899c053b4a7104ced5b0
Parents: 82a1a8b
Author: Shreedhar Hardikar 
Authored: Thu May 12 18:21:29 2016 -0700
Committer: ivan 
Committed: Wed Jun 8 10:01:16 2016 +0800

--
 src/backend/gpopt/CGPOptimizer.cpp | 67 -
 src/backend/gpopt/ivy.xml  |  4 +-
 src/backend/utils/init/postinit.c  | 14 +++
 src/include/gpopt/CGPOptimizer.h   |  7 
 4 files changed, 89 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f2798203/src/backend/gpopt/CGPOptimizer.cpp
--
diff --git a/src/backend/gpopt/CGPOptimizer.cpp 
b/src/backend/gpopt/CGPOptimizer.cpp
index c0eaa3e..db3cab8 100644
--- a/src/backend/gpopt/CGPOptimizer.cpp
+++ b/src/backend/gpopt/CGPOptimizer.cpp
@@ -48,7 +48,7 @@
 void
 CGPOptimizer::TouchLibraryInitializers()
 {
-   void (*gpos)() = gpos_init;
+   void (*gpos)(gpos_init_params*) = gpos_init;
void (*dxl)() = gpdxl_init;
void (*opt)() = gpopt_init;
 }
@@ -90,6 +90,39 @@ CGPOptimizer::SzDXLPlan
return COptTasks::SzOptimize(pquery);
 }
 
+//---
+// @function:
+// InitGPOPT()
+//
+// @doc:
+// Initialize GPTOPT and dependent libraries
+//
+//---
+void
+CGPOptimizer::InitGPOPT ()
+{
+  // Use GPORCA's default allocators
+  struct gpos_init_params params = { NULL, NULL };
+  gpos_init();
+  gpdxl_init();
+  gpopt_init();
+}
+
+//---
+// @function:
+// TerminateGPOPT()
+//
+// @doc:
+// Terminate GPOPT and dependent libraries
+//
+//---
+void
+CGPOptimizer::TerminateGPOPT ()
+{
+  gpopt_terminate();
+  gpdxl_terminate();
+  gpos_terminate();
+}
 
 //---
 // @function:
@@ -130,4 +163,36 @@ char *SzDXLPlan
 }
 }
 
+//---
+// @function:
+// InitGPOPT()
+//
+// @doc:
+// Initialize GPTOPT and dependent libraries
+//
+//---
+extern "C"
+{
+void InitGPOPT ()
+{
+   return CGPOptimizer::InitGPOPT();
+}
+}
+
+//---
+// @function:
+// TerminateGPOPT()
+//
+// @doc:
+// Terminate GPOPT and dependent libraries
+//
+//---
+extern "C"
+{
+void TerminateGPOPT ()
+{
+   return CGPOptimizer::TerminateGPOPT();
+}
+}
+
 // EOF

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f2798203/src/backend/gpopt/ivy.xml
--
diff --git a/src/backend/gpopt/ivy.xml b/src/backend/gpopt/ivy.xml
index a9d08aa..43423eb 100644
--- a/src/backend/gpopt/ivy.xml
+++ b/src/backend/gpopt/ivy.xml
@@ -38,8 +38,8 @@ under the License.
 
 
 
-  
-  
+  
+  
   
 
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f2798203/src/backend/utils/init/postinit.c
--
diff --git a/src/backend/utils/init/postinit.c 
b/src/backend/utils/init/postinit.c
index c2e3c96..5358c5f 100644
--- a/src/backend/utils/init/postinit.c
+++ b/src/backend/utils/init/postinit.c
@@ -62,6 +62,11 @@ static void InitCommunication(void);
 static void ShutdownPostgres(int code, Datum arg);
 static bool ThereIsAtLeastOneRole(void);
 
+#ifdef USE_ORCA
+extern void InitGPOPT();
+extern void TerminateGPOPT();
+#endif
+
 /*** InitPostgres support ***/
 
 /*
@@ -471,6 +476,11 @@ InitPostgres(const char *in_dbname, Oid dboid, const char 
*username,
/* Initialize memory protection */
GPMemoryProtect_Init();
 

[2/2] incubator-hawq git commit: HAWQ-765. Delete Deadcode: CTranslatorDXLToQuery [#119780063]

2016-06-07 Thread iweng
HAWQ-765. Delete Deadcode: CTranslatorDXLToQuery [#119780063]


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

Branch: refs/heads/master
Commit: 82a1a8ba5fa7276eb60f45c0bdc83058c805aeda
Parents: 235d999
Author: Venkatesh (Venky) Raghavan 
Authored: Tue May 17 21:02:57 2016 -0700
Committer: ivan 
Committed: Wed Jun 8 09:55:28 2016 +0800

--
 src/include/gpopt/utils/COptTasks.h | 4 
 1 file changed, 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/82a1a8ba/src/include/gpopt/utils/COptTasks.h
--
diff --git a/src/include/gpopt/utils/COptTasks.h 
b/src/include/gpopt/utils/COptTasks.h
index 7f9c73e..867ff85 100644
--- a/src/include/gpopt/utils/COptTasks.h
+++ b/src/include/gpopt/utils/COptTasks.h
@@ -285,10 +285,6 @@ class COptTasks
static
char *SzDXL(PlannedStmt *pplstmt);
 
-   // convert xml string to DXL and to Query
-   static
-   Query *PqueryFromXML(char *szXmlString);
-
// convert xml string to DXL and to PS
static
PlannedStmt *PplstmtFromXML(char *szXmlString);



incubator-hawq git commit: HAWQ-723. New Command & PSQL test libraries

2016-05-09 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master a1f47072f -> f8fd15e37


HAWQ-723. New Command & PSQL test libraries


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

Branch: refs/heads/master
Commit: f8fd15e3726f7b19c776393b5aef398702ee7680
Parents: a1f4707
Author: ivan 
Authored: Tue May 10 10:20:32 2016 +0800
Committer: ivan 
Committed: Tue May 10 10:20:32 2016 +0800

--
 src/test/feature/lib/command.cpp | 125 ++
 src/test/feature/lib/command.h   |  44 +++
 src/test/feature/lib/psql.cpp| 238 ++
 src/test/feature/lib/psql.h  |  81 
 4 files changed, 488 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f8fd15e3/src/test/feature/lib/command.cpp
--
diff --git a/src/test/feature/lib/command.cpp b/src/test/feature/lib/command.cpp
new file mode 100644
index 000..1760971
--- /dev/null
+++ b/src/test/feature/lib/command.cpp
@@ -0,0 +1,125 @@
+#include 
+#include 
+#include 
+#include "command.h"
+
+Command& Command::run()
+{
+FILE *fp = NULL;
+char result[MAX_BUFFER_SIZE] = {0}; 
+
+if (!this->_isCommandValid()) 
+{
+goto error;
+}
+ 
+fp = popen(this->_cmd_string.append(" 2>&1").c_str(), "r");
+if (NULL == fp)
+{
+goto error; 
+}
+
+this->_result_output.clear();
+while(fgets(result, sizeof(result), fp) != NULL)
+{
+this->_result_output.append(result);
+}
+ 
+this->_result_status = pclose(fp);
+if (-1 == this->_result_status)
+{
+goto error;
+}
+this->_result_status = WEXITSTATUS(this->_result_status);
+
+if (this->_output_file.length() > 0)
+{
+this->_saveToFile(); 
+}
+
+return *this;
+
+error:
+this->_result_status = -1;
+return *this;
+}
+
+Command& Command::setCommand(const std::string& cmd)
+{
+this->_cmd_string = cmd;
+return *this;
+}
+
+Command& Command::setOutputFile(const std::string& out)
+{
+this->_output_file = out;
+return *this;
+}
+
+const std::string& Command::getCommand() const
+{
+return this->_cmd_string;
+}
+
+const std::string& Command::getResultOutput() const
+{
+return this->_result_output;
+}
+
+int Command::getResultStatus() const
+{
+return this->_result_status;
+}
+
+bool Command::_isCommandValid() const
+{
+if (this->_cmd_string.length() > 0)
+{
+return true;
+} 
+else
+{
+return false;
+}
+}
+
+void Command::_saveToFile()
+{
+std::ofstream out(this->_output_file, std::ofstream::out);
+out << this->_result_output;
+out.close(); 
+}
+
+const std::string& Command::getCommandOutput(const std::string& cmd)
+{
+return Command()
+.setCommand(cmd)
+.run()
+.getResultOutput();
+}
+
+const std::string& Command::getCommandOutput(const std::string& cmd, const 
std::string& out)
+{
+return Command()
+.setCommand(cmd)
+.setOutputFile(out)
+.run()
+.getResultOutput();
+}
+
+int Command::getCommandStatus(const std::string& cmd)
+{
+return Command()
+.setCommand(cmd)
+.run()
+.getResultStatus();
+}
+
+int Command::getCommandStatus(const std::string& cmd, const std::string& out)
+{
+return Command()
+.setCommand(cmd)
+.setOutputFile(out)
+.run()
+.getResultStatus();
+}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/f8fd15e3/src/test/feature/lib/command.h
--
diff --git a/src/test/feature/lib/command.h b/src/test/feature/lib/command.h
new file mode 100644
index 000..78da0aa
--- /dev/null
+++ b/src/test/feature/lib/command.h
@@ -0,0 +1,44 @@
+#ifndef __COMMAND_H__
+#define __COMMAND_H__
+
+#include 
+
+class Command
+{
+public:
+Command() : _result_status(-1) {}
+explicit Command(const std::string& cmd) : _cmd_string(cmd), 
+_result_status(-1) {}
+Command(const std::string& cmd, const std::string& out) : 
_cmd_string(cmd), 
+_output_file(out), 
+_result_status(-1) {}
+virtual ~Command() {}
+
+Command& run();
+Command& setCommand(const std::string& cmd);
+Command& setOutputFile(const std::string& out);
+const std::string& getCommand() const; 
+const 

incubator-hawq git commit: HAWQ-669. Fix interconnect guc gp_interconnect_transmit_timeout type issue

2016-04-13 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master ae0809013 -> 5ccab40c2


HAWQ-669. Fix interconnect guc gp_interconnect_transmit_timeout type 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/5ccab40c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/5ccab40c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/5ccab40c

Branch: refs/heads/master
Commit: 5ccab40c2fb8e56b1e7379dbeb05bd6b94fc3c43
Parents: ae08090
Author: ivan 
Authored: Wed Apr 13 18:24:55 2016 +0800
Committer: ivan 
Committed: Wed Apr 13 18:24:55 2016 +0800

--
 src/backend/cdb/cdbvars.c | 2 +-
 src/include/cdb/cdbvars.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5ccab40c/src/backend/cdb/cdbvars.c
--
diff --git a/src/backend/cdb/cdbvars.c b/src/backend/cdb/cdbvars.c
index f608034..026a765 100644
--- a/src/backend/cdb/cdbvars.c
+++ b/src/backend/cdb/cdbvars.c
@@ -148,7 +148,7 @@ int 
Gp_interconnect_timer_checking_period=20;
 intGp_interconnect_default_rtt=20;
 intGp_interconnect_min_rto=20;
 intGp_interconnect_fc_method=INTERCONNECT_FC_METHOD_LOSS;
-intGp_interconnect_transmit_timeout=3600;
+int64  Gp_interconnect_transmit_timeout=3600;
 intGp_interconnect_min_retries_before_timeout=100;
 
 intGp_interconnect_hash_multiplier=2;  /* sets the 
size of the hash table used by the UDP-IC */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/5ccab40c/src/include/cdb/cdbvars.h
--
diff --git a/src/include/cdb/cdbvars.h b/src/include/cdb/cdbvars.h
index 9f6c3b1..8a15877 100644
--- a/src/include/cdb/cdbvars.h
+++ b/src/include/cdb/cdbvars.h
@@ -463,7 +463,7 @@ extern int  Gp_interconnect_timer_period;
 extern int Gp_interconnect_timer_checking_period;
 extern int Gp_interconnect_default_rtt;
 extern int Gp_interconnect_min_rto;
-extern int  Gp_interconnect_transmit_timeout;
+extern int64  Gp_interconnect_transmit_timeout;
 extern int Gp_interconnect_min_retries_before_timeout;
 
 /* UDP recv buf size in KB.  For testing */



incubator-hawq git commit: HAWQ-627. Fix core dump in metadata cache

2016-04-05 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master ec8e79184 -> fa2600cfb


HAWQ-627. Fix core dump in metadata cache


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

Branch: refs/heads/master
Commit: fa2600cfbf24d193a63f25e3286e238278348c6d
Parents: ec8e791
Author: ivan 
Authored: Tue Apr 5 14:15:14 2016 +0800
Committer: ivan 
Committed: Tue Apr 5 14:15:14 2016 +0800

--
 src/backend/cdb/cdbmetadatacache_process.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/fa2600cf/src/backend/cdb/cdbmetadatacache_process.c
--
diff --git a/src/backend/cdb/cdbmetadatacache_process.c 
b/src/backend/cdb/cdbmetadatacache_process.c
index 6d1292c..7553d09 100644
--- a/src/backend/cdb/cdbmetadatacache_process.c
+++ b/src/backend/cdb/cdbmetadatacache_process.c
@@ -326,14 +326,14 @@ GenerateMetadataCacheLRUList()
 {
 HASH_SEQ_STATUS hstat;
 MetadataCacheEntry *entry;
-long cache_entry_num = hash_get_num_entries(MetadataCache);
+long cache_entry_num = 0;
 
 LWLockAcquire(MetadataCacheLock, LW_EXCLUSIVE);
+cache_entry_num = hash_get_num_entries(MetadataCache);
 
-if (MetadataCacheLRUList)
-{
-list_free_deep(MetadataCacheLRUList);
-MetadataCacheLRUList = NULL;
+if (cache_entry_num == 0) {
+LWLockRelease(MetadataCacheLock);
+return;
 }
 
 MetadataCacheEntry** entry_vector = 
(MetadataCacheEntry**)palloc(sizeof(MetadataCacheEntry*) * cache_entry_num);   



incubator-hawq git commit: HAWQ-551. Add datalocility time to explain analyse result

2016-03-19 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 94b7a8225 -> dfc673135


HAWQ-551. Add datalocility time to explain analyse result


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

Branch: refs/heads/master
Commit: dfc673135f9f1c92487423436428be82ad1db1e4
Parents: 94b7a82
Author: ivan 
Authored: Thu Mar 17 15:07:27 2016 +0800
Committer: ivan 
Committed: Fri Mar 18 09:32:31 2016 +0800

--
 src/backend/cdb/cdbdatalocality.c| 28 +---
 src/backend/commands/explain.c   |  2 +-
 src/backend/optimizer/plan/planner.c |  1 +
 src/include/cdb/cdbdatalocality.h|  1 +
 src/include/nodes/plannodes.h|  1 +
 5 files changed, 29 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/dfc67313/src/backend/cdb/cdbdatalocality.c
--
diff --git a/src/backend/cdb/cdbdatalocality.c 
b/src/backend/cdb/cdbdatalocality.c
index c1f829b..eec87b4 100644
--- a/src/backend/cdb/cdbdatalocality.c
+++ b/src/backend/cdb/cdbdatalocality.c
@@ -309,6 +309,10 @@ typedef struct split_to_segment_mapping_context {
int64 total_file_count;
 
int64 total_metadata_logic_len;
+
+int metadata_cache_time_us;
+int alloc_resource_time_us;
+int cal_datalocality_time_us;
 } split_to_segment_mapping_context;
 
 typedef struct vseg_list{
@@ -569,6 +573,10 @@ static void 
init_datalocality_context(split_to_segment_mapping_context *context)
context->total_split_count = 0;
context->total_file_count = 0;
context->total_metadata_logic_len = 0;
+
+context->metadata_cache_time_us = 0;
+context->alloc_resource_time_us = 0;
+context->cal_datalocality_time_us = 0;
return;
 }
 
@@ -928,6 +936,8 @@ int64 
get_block_locations_and_claculte_table_size(split_to_segment_mapping_conte
}
context->total_file_count = totalFileCount;
context->total_size = total_size;
+
+context->metadata_cache_time_us = eclaspeTime;
 
if(debug_datalocality_time){
elog(LOG, "metadata overall execution time: %d us. \n", 
eclaspeTime);
@@ -3395,13 +3405,13 @@ static void 
print_datalocality_overall_log_information(SplitAllocResult *result,
appendStringInfo(result->datalocalityInfo, "data locality ratio: %.3f; 
virtual segment number: %d; "
"different host number: %d; virtual segment number per 
host(avg/min/max): (%d/%d/%d); "
"segment size(avg/min/max): (%.3f B/"INT64_FORMAT" 
B/"INT64_FORMAT" B); "
-   "segment size with penalty(avg/min/max): (%.3f 
B/"INT64_FORMAT" B/"INT64_FORMAT" B); continuity(avg/min/max): 
(%.3f/%.3f/%.3f)."
+   "segment size with penalty(avg/min/max): (%.3f 
B/"INT64_FORMAT" B/"INT64_FORMAT" B); continuity(avg/min/max): 
(%.3f/%.3f/%.3f); "

,log_context->datalocalityRatio,assignment_context->virtual_segment_num,log_context->numofDifferentHost,

log_context->avgSegmentNumofHost,log_context->minSegmentNumofHost,log_context->maxSegmentNumofHost,

log_context->avgSizeOverall,log_context->minSizeSegmentOverall,log_context->maxSizeSegmentOverall,

log_context->avgSizeOverallPenalty,log_context->minSizeSegmentOverallPenalty,log_context->maxSizeSegmentOverallPenalty,
-   
log_context->avgContinuityOverall,log_context->minContinuityOverall,log_context->maxContinuityOverall
-   );
+   
log_context->avgContinuityOverall,log_context->minContinuityOverall,log_context->maxContinuityOverall);
+
if (debug_fake_datalocality) {
fprintf(fp, "datalocality ratio: %.3f; virtual segments 
number: %d, "
"different host number: %d, segment 
number per host(avg/min/max): (%d/%d/%d); "
@@ -3919,9 +3929,17 @@ run_allocation_algorithm(SplitAllocResult *result, List 
*virtual_segments, Query
uint64_t run_datalocality = 0;
run_datalocality = gettime_microsec();
int dl_overall_time = run_datalocality - before_run_allocation;
+
+context->cal_datalocality_time_us = dl_overall_time; 
+
if(debug_datalocality_time){
elog(LOG, "datalocality overall execution time: %d us. \n", 
dl_overall_time);
}
+
+result->datalocalityTime = (double)(context->metadata_cache_time_us + 
context->alloc_resource_time_us + 

[2/3] incubator-hawq git commit: HAWQ-404. Close each partition after inserting when optimizer guarantees input is sorted on partition-id.

2016-03-14 Thread iweng
HAWQ-404. Close each partition after inserting when optimizer guarantees input 
is sorted on partition-id.


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

Branch: refs/heads/master
Commit: 6e6890ae7886b050aeb9c9d7e885fc84eb99937c
Parents: 2c38b42
Author: George Caragea 
Authored: Mon Feb 29 22:21:13 2016 -0800
Committer: Haisheng Yuan 
Committed: Wed Mar 2 18:27:22 2016 -0800

--
 src/backend/executor/execDML.c  |  99 +++---
 src/backend/executor/execMain.c |  13 +--
 src/backend/executor/execUtils.c|   2 +-
 src/backend/executor/nodeDML.c  |   2 +-
 src/backend/utils/misc/guc.c|   2 +-
 src/include/executor/execDML.h  |   3 +-
 src/include/nodes/execnodes.h   |   7 +-
 src/test/regress/expected/goh_partition.out | 126 +++
 src/test/regress/sql/goh_partition.sql  |  68 
 9 files changed, 271 insertions(+), 51 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/6e6890ae/src/backend/executor/execDML.c
--
diff --git a/src/backend/executor/execDML.c b/src/backend/executor/execDML.c
index d36e9ed..d6f05de 100644
--- a/src/backend/executor/execDML.c
+++ b/src/backend/executor/execDML.c
@@ -158,10 +158,11 @@ reconstructMatchingTupleSlot(TupleTableSlot *slot, 
ResultRelInfo *resultRelInfo)
  */
 void
 ExecInsert(TupleTableSlot *slot,
-  DestReceiver *dest,
-  EState *estate,
-  PlanGenerator planGen,
-  bool isUpdate)
+   DestReceiver *dest,
+   EState *estate,
+   PlanGenerator planGen,
+   bool isUpdate,
+   bool isInputSorted)
 {
void*tuple = NULL;
ResultRelInfo *resultRelInfo = NULL;
@@ -184,7 +185,7 @@ ExecInsert(TupleTableSlot *slot,
resultRelInfo = slot_get_partition(slot, estate);
estate->es_result_relation_info = resultRelInfo;
 
-   if (NULL != resultRelInfo->ri_parquetSendBack)
+   if (NULL != resultRelInfo->ri_insertSendBack)
{
/*
 * The Parquet part we are about to insert into
@@ -203,59 +204,82 @@ ExecInsert(TupleTableSlot *slot,
 * inserted into (GPSQL-2291).
 */
Oid new_part_oid = resultRelInfo->ri_RelationDesc->rd_id;
-   if (gp_parquet_insert_sort &&
+
+   if (isInputSorted &&
PLANGEN_OPTIMIZER == planGen &&
-   InvalidOid != estate->es_last_parq_part &&
-   new_part_oid != estate->es_last_parq_part)
+   InvalidOid != estate->es_last_inserted_part &&
+   new_part_oid != estate->es_last_inserted_part)
{
 
Assert(NULL != 
estate->es_partition_state->result_partition_hash);
 
ResultPartHashEntry *entry = 
hash_search(estate->es_partition_state->result_partition_hash,
-   
>es_last_parq_part,
-   
HASH_FIND,
-   NULL /* 
found */);
+   >es_last_inserted_part,
+   HASH_FIND,
+   NULL /* found */);
 
Assert(NULL != entry);
Assert(entry->offset < estate->es_num_result_relations);
 
ResultRelInfo *oldResultRelInfo = & 
estate->es_result_relations[entry->offset];
+   Assert(NULL != oldResultRelInfo);
 
-   elog(DEBUG1, "Switching from old part oid=%d name=[%s] 
to new part oid=%d name=[%s]",
-   estate->es_last_parq_part,
-   
oldResultRelInfo->ri_RelationDesc->rd_rel->relname.data,
-   new_part_oid,
-   
resultRelInfo->ri_RelationDesc->rd_rel->relname.data);
-
-   /*
-* We are opening a new partition, and the last 
partition we
-* inserted into was a Parquet part. Let's close the old
-  

incubator-hawq git commit: HAWQ-508. Fix pointer check issue in coverity

2016-03-13 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 2eb936a42 -> 604856c09


HAWQ-508. Fix pointer check issue in coverity


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

Branch: refs/heads/master
Commit: 604856c0952dd0c90882afe58744a9ddb7219d9c
Parents: 2eb936a
Author: ivan 
Authored: Mon Mar 14 09:41:00 2016 +0800
Committer: ivan 
Committed: Mon Mar 14 09:41:00 2016 +0800

--
 src/backend/commands/tablecmds.c | 19 ---
 1 file changed, 8 insertions(+), 11 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/604856c0/src/backend/commands/tablecmds.c
--
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index e7a53b9..c47b828 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -13824,17 +13824,14 @@ ATPExecPartAdd(AlteredTableInfo *tab,

   errOmitLocation(true)));
 
/* XXX XXX: move this check to gram.y ? */
-   if (pElem)
-   {
-   if (pElem->boundSpec)
-   ereport(ERROR,
-   
(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
-errmsg("invalid use of 
boundary specification "
-   "for 
DEFAULT partition%s of %s",
-   namBuf,
-   
lrelname),
-   
   errOmitLocation(true)));
-   }
+if (pElem->boundSpec)
+ereport(ERROR,
+(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
+ errmsg("invalid use of boundary specification "
+"for DEFAULT partition%s of %s",
+namBuf,
+lrelname),
+   errOmitLocation(true)));
}
 
/* Do the real work for add ... */



incubator-hawq git commit: HAWQ-506. Fix coverity issue for HAWQ-455

2016-03-09 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 71911c1ce -> a81ae771e


HAWQ-506. Fix coverity issue for HAWQ-455


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

Branch: refs/heads/master
Commit: a81ae771e2818fecbfea961fd9c1e77d61c01675
Parents: 71911c1
Author: ivan 
Authored: Thu Mar 10 10:05:28 2016 +0800
Committer: ivan 
Committed: Thu Mar 10 10:05:28 2016 +0800

--
 src/backend/commands/tablecmds.c | 6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a81ae771/src/backend/commands/tablecmds.c
--
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index aceee02..e7a53b9 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -13824,11 +13824,9 @@ ATPExecPartAdd(AlteredTableInfo *tab,

   errOmitLocation(true)));
 
/* XXX XXX: move this check to gram.y ? */
-   if (pc2->arg1)
+   if (pElem)
{
-   PartitionElem *pelem = (PartitionElem *) 
pc2->arg1;
-
-   if (pelem->boundSpec)
+   if (pElem->boundSpec)
ereport(ERROR,

(errcode(ERRCODE_INVALID_TABLE_DEFINITION),
 errmsg("invalid use of 
boundary specification "



incubator-hawq git commit: HAWQ-445. Support large strings (up to a GB) in text_to_array()

2016-03-09 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 87d13b673 -> e29e13345


HAWQ-445. Support large strings (up to a GB) in text_to_array()


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

Branch: refs/heads/master
Commit: e29e13345f14b70d4193eb16e4b904737871c486
Parents: 87d13b6
Author: ivan 
Authored: Thu Mar 10 09:22:49 2016 +0800
Committer: ivan 
Committed: Thu Mar 10 09:22:49 2016 +0800

--
 src/backend/utils/adt/test/Makefile   |  42 
 src/backend/utils/adt/test/varlena_test.c | 251 +++
 src/backend/utils/adt/varlena.c   | 334 +++--
 3 files changed, 550 insertions(+), 77 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e29e1334/src/backend/utils/adt/test/Makefile
--
diff --git a/src/backend/utils/adt/test/Makefile 
b/src/backend/utils/adt/test/Makefile
new file mode 100644
index 000..a0cd950
--- /dev/null
+++ b/src/backend/utils/adt/test/Makefile
@@ -0,0 +1,42 @@
+top_builddir=../../../../..
+subdir=src/backend/utils/adt
+
+TARGETS=varlena
+
+# Objects from backend, which don't need to be mocked but need to be linked.
+common_REAL_OBJS=\
+$(top_srcdir)/src/backend/access/hash/hashfunc.o \
+$(top_srcdir)/src/backend/bootstrap/bootparse.o \
+$(top_srcdir)/src/backend/lib/stringinfo.o \
+$(top_srcdir)/src/backend/nodes/bitmapset.o \
+$(top_srcdir)/src/backend/nodes/equalfuncs.o \
+$(top_srcdir)/src/backend/nodes/list.o \
+$(top_srcdir)/src/backend/parser/gram.o \
+$(top_srcdir)/src/backend/regex/regcomp.o \
+$(top_srcdir)/src/backend/regex/regerror.o \
+$(top_srcdir)/src/backend/regex/regexec.o \
+$(top_srcdir)/src/backend/regex/regfree.o \
+$(top_srcdir)/src/backend/storage/page/itemptr.o \
+$(top_srcdir)/src/backend/utils/adt/datum.o \
+$(top_srcdir)/src/backend/utils/adt/like.o \
+$(top_srcdir)/src/backend/utils/hash/dynahash.o \
+$(top_srcdir)/src/backend/utils/hash/hashfn.o \
+$(top_srcdir)/src/backend/utils/misc/guc.o \
+$(top_srcdir)/src/backend/utils/init/globals.o \
+$(top_srcdir)/src/backend/utils/mmgr/mcxt.o \
+$(top_srcdir)/src/backend/utils/mmgr/aset.o \
+$(top_srcdir)/src/backend/utils/mmgr/memprot.o \
+$(top_srcdir)/src/port/exec.o \
+$(top_srcdir)/src/port/path.o \
+$(top_srcdir)/src/port/pgsleep.o \
+$(top_srcdir)/src/port/pgstrcasecmp.o \
+$(top_srcdir)/src/port/qsort.o \
+$(top_srcdir)/src/port/strlcpy.o \
+$(top_srcdir)/src/port/thread.o \
+$(top_srcdir)/src/timezone/localtime.o \
+$(top_srcdir)/src/timezone/pgtz.o
+
+varlena_REAL_OBJS=$(common_REAL_OBJS)
+
+include ../../../../Makefile.mock
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/e29e1334/src/backend/utils/adt/test/varlena_test.c
--
diff --git a/src/backend/utils/adt/test/varlena_test.c 
b/src/backend/utils/adt/test/varlena_test.c
new file mode 100644
index 000..46035fa
--- /dev/null
+++ b/src/backend/utils/adt/test/varlena_test.c
@@ -0,0 +1,251 @@
+#include 
+#include 
+#include 
+#include "cmockery.h"
+
+#include "c.h"
+#include "postgres.h"
+#include "nodes/nodes.h"
+#include "../varlena.c"
+
+#define MEMORY_LIMIT 8 /* 8 bytes memory limit */
+
+#ifdef USE_ASSERT_CHECKING
+void
+_ExceptionalCondition( )
+{
+ PG_RE_THROW();
+}
+#endif
+
+/*
+ * Checks if the small strings that fit in memory fails assertion.
+ */
+void
+test__find_memory_limited_substring__small_string(void **state)
+{
+   int subStringByteLength = -1;
+   int subStringCharLength = -1;
+   int totalByteLength = MEMORY_LIMIT;
+   char *strStart = 0xabcdefab;
+
+#ifdef USE_ASSERT_CHECKING
+   expect_any(ExceptionalCondition,conditionName);
+   expect_any(ExceptionalCondition,errorType);
+   expect_any(ExceptionalCondition,fileName);
+   expect_any(ExceptionalCondition,lineNumber);
+   
will_be_called_with_sideeffect(ExceptionalCondition,&_ExceptionalCondition,NULL);
+
+   /* Test if within memory-limit strings cause assertion failure */
+   PG_TRY();
+   {
+   find_memory_limited_substring(strStart, totalByteLength, 
MEMORY_LIMIT, , );
+   assert_true(false);
+   }
+   PG_CATCH();
+   {
+   }
+   PG_END_TRY();
+#endif
+}
+
+/*
+ * Checks if null input string causes assertion failure.
+ */
+void
+test__find_memory_limited_substring__null_string(void **state)
+{
+   int 

incubator-hawq git commit: HAWQ-455. Disable creating partition tables with non uniform distribution policy

2016-03-09 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 675465d87 -> d72d0fa04


HAWQ-455. Disable creating partition tables with non uniform distribution policy


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

Branch: refs/heads/master
Commit: d72d0fa041953c66e1663ce8952f0191b12bf8a1
Parents: 675465d
Author: ivan 
Authored: Thu Mar 10 08:48:36 2016 +0800
Committer: ivan 
Committed: Thu Mar 10 08:48:36 2016 +0800

--
 src/backend/commands/tablecmds.c|  18 
 src/backend/parser/analyze.c|  37 +++
 .../expected/create_table_distribution.out  | 102 ++-
 .../regress/sql/create_table_distribution.sql   |  41 +++-
 4 files changed, 171 insertions(+), 27 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d72d0fa0/src/backend/commands/tablecmds.c
--
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index a2c98bf..aceee02 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -13758,6 +13758,24 @@ ATPExecPartAdd(AlteredTableInfo *tab,
 errhint("use a named partition"),
   
errOmitLocation(true)));
 
+   PartitionElem *pElem = (PartitionElem *) pc2->arg1;
+   Node *pStoreAttr = pElem->storeAttr;
+   if (pStoreAttr && ((AlterPartitionCmd *)pStoreAttr)->arg1)
+   {
+   List *pWithList = (List *)(((AlterPartitionCmd 
*)pStoreAttr)->arg1);
+   GpPolicy *parentPolicy = GpPolicyFetch(CurrentMemoryContext, 
RelationGetRelid(rel));
+   int bucketnum = parentPolicy->bucketnum;
+   int child_bucketnum = 
GetRelOpt_bucket_num_fromOptions(pWithList, bucketnum);
+
+   if (child_bucketnum != bucketnum)
+   ereport(ERROR,
+   
(errcode(ERRCODE_GP_FEATURE_NOT_SUPPORTED),
+   errmsg("distribution 
policy for partition%s "
+   "must 
be the same as that for %s",
+   namBuf,
+   
lrelname)));
+   }
+
/* don't check if splitting or setting a subpartition template */
if (!is_split && !bSetTemplate)
/* We complain if partition already exists, so prule should be 
NULL */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d72d0fa0/src/backend/parser/analyze.c
--
diff --git a/src/backend/parser/analyze.c b/src/backend/parser/analyze.c
index 2bf1a9a..ad35484 100644
--- a/src/backend/parser/analyze.c
+++ b/src/backend/parser/analyze.c
@@ -2986,6 +2986,27 @@ transformDistributedBy(ParseState *pstate, 
CreateStmtContext *cxt,
 
*policyp = policy;
 
+   if (cxt && cxt->inhRelations)
+   {
+   ListCell   *entry;
+
+   foreach(entry, cxt->inhRelations)
+   {
+   RangeVar   *parent = (RangeVar *) lfirst(entry);
+   Oid relId = 
RangeVarGetRelid(parent, false, false /*allowHcatalog*/);
+   GpPolicy  *parentPolicy = 
GpPolicyFetch(CurrentMemoryContext, relId);
+
+   if (!GpPolicyEqual(policy, parentPolicy))
+   {
+   ereport(ERROR,
+   
(errcode(ERRCODE_GP_FEATURE_NOT_SUPPORTED),
+   
errmsg("distribution policy for \"%s\" "
+   
"must be the same as that for \"%s\"",
+   
cxt->relation->relname,
+   
parent->relname)));
+   }
+   }
+   }
 
if (cxt && cxt->pkey)   /* Primary key  specified.  Make 
sure
 * distribution 
columns match */
@@ -8231,6 +8252,22 @@ transformPartitionBy(ParseState *pstate, 
CreateStmtContext *cxt,
  

[2/3] incubator-hawq git commit: HAWQ-295. New metadata flush strategy remove 1 entry every time flush due to flush condition wrong: change datatype cast.

2016-01-03 Thread iweng
HAWQ-295. New metadata flush strategy remove 1 entry every time flush due to 
flush condition wrong: change datatype cast.


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

Branch: refs/heads/master
Commit: 22b1f6e7c042df69248d4e23aaa00c52bc089c25
Parents: 4e64593
Author: stanlyxiang 
Authored: Thu Dec 31 11:08:01 2015 +0800
Committer: stanlyxiang 
Committed: Thu Dec 31 11:08:01 2015 +0800

--
 src/backend/cdb/cdbmetadatacache_process.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/22b1f6e7/src/backend/cdb/cdbmetadatacache_process.c
--
diff --git a/src/backend/cdb/cdbmetadatacache_process.c 
b/src/backend/cdb/cdbmetadatacache_process.c
index 43cfd5b..273923a 100644
--- a/src/backend/cdb/cdbmetadatacache_process.c
+++ b/src/backend/cdb/cdbmetadatacache_process.c
@@ -409,9 +409,9 @@ ProcessMetadataCacheCheck()
 RelFileNode rnode;
 HdfsFileInfo *file_info;
 
-double free_block_ratio = (FREE_BLOCK_NUM * 1.0) / 
metadata_cache_block_capacity;
+double free_block_ratio = ((double)FREE_BLOCK_NUM) / 
metadata_cache_block_capacity;
 long cache_entry_num = hash_get_num_entries(MetadataCache);
-double cache_entry_ratio = (cache_entry_num * 1.0) / 
metadata_cache_max_hdfs_file_num;
+double cache_entry_ratio = ((double)cache_entry_num) / 
metadata_cache_max_hdfs_file_num;
 
 elog(DEBUG1, "[MetadataCache] ProcessMetadataCacheCheck 
free_block_ratio:%f", free_block_ratio);
 
@@ -443,9 +443,9 @@ ProcessMetadataCacheCheck()
 DestroyHdfsFileInfo(file_info);
 total_remove_files++;
 
-double cache_entry_ratio = (hash_get_num_entries(MetadataCache) * 
1.0) / metadata_cache_max_hdfs_file_num;
+double cache_entry_ratio = 
((double)hash_get_num_entries(MetadataCache)) / 
metadata_cache_max_hdfs_file_num;
 
-if (((FREE_BLOCK_NUM * 1.0) / metadata_cache_block_capacity) >= 
metadata_cache_free_block_normal_ratio
+if double)FREE_BLOCK_NUM) / metadata_cache_block_capacity) >= 
metadata_cache_free_block_normal_ratio
&& cache_entry_ratio < metadata_cache_reduce_ratio)
 {
 break;



[3/3] incubator-hawq git commit: HAWQ-284. Add a udf for new metadata flush strategy testing.

2016-01-03 Thread iweng
 HAWQ-284. Add a udf for new metadata flush strategy testing.


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

Branch: refs/heads/master
Commit: fde3b4fc9d802929aa840ae6f35a9e9154db1db2
Parents: af6cfe8 04c3938
Author: ivan 
Authored: Mon Jan 4 12:23:29 2016 +0800
Committer: ivan 
Committed: Mon Jan 4 12:23:29 2016 +0800

--
 src/backend/cdb/cdbmetadatacache.c   | 53 +++
 src/include/catalog/pg_proc.h|  4 ++
 src/include/catalog/pg_proc.sql  |  2 +
 src/include/utils/builtins.h |  1 +
 src/test/regress/data/upgrade20/pg_proc.data |  1 +
 5 files changed, 61 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/fde3b4fc/src/backend/cdb/cdbmetadatacache.c
--



[2/3] incubator-hawq git commit: HAWQ-284. Add a udf for new metadata flush strategy testing: change udf name to a clear one.

2016-01-03 Thread iweng
HAWQ-284. Add a udf for new metadata flush strategy testing: change udf name to 
a clear one.


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

Branch: refs/heads/master
Commit: 04c393873b011393912a7cd4134e234f18310636
Parents: 56159c3
Author: stanlyxiang 
Authored: Wed Dec 30 17:27:14 2015 +0800
Committer: stanlyxiang 
Committed: Wed Dec 30 17:27:14 2015 +0800

--
 src/backend/cdb/cdbmetadatacache.c   | 4 ++--
 src/include/catalog/pg_proc.h| 4 ++--
 src/include/catalog/pg_proc.sql  | 2 +-
 src/include/utils/builtins.h | 2 +-
 src/test/regress/data/upgrade20/pg_proc.data | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/04c39387/src/backend/cdb/cdbmetadatacache.c
--
diff --git a/src/backend/cdb/cdbmetadatacache.c 
b/src/backend/cdb/cdbmetadatacache.c
index fedcfbd..0a163b3 100644
--- a/src/backend/cdb/cdbmetadatacache.c
+++ b/src/backend/cdb/cdbmetadatacache.c
@@ -1403,9 +1403,9 @@ extern Datum gp_metadata_cache_info(PG_FUNCTION_ARGS)
 /*
  *  Metadata Cache UDF
  *
- *  Get entry info in the metadata cache
+ *  Put entry into the metadata cache
  */
-extern Datum gp_metadata_cache_putentry_fortest(PG_FUNCTION_ARGS)
+extern Datum gp_metadata_cache_put_entry_for_test(PG_FUNCTION_ARGS)
 {
 Oid tablespace_oid = PG_GETARG_OID(0);
 Oid database_oid = PG_GETARG_OID(1);

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/04c39387/src/include/catalog/pg_proc.h
--
diff --git a/src/include/catalog/pg_proc.h b/src/include/catalog/pg_proc.h
index 2170041..c22f3f3 100644
--- a/src/include/catalog/pg_proc.h
+++ b/src/include/catalog/pg_proc.h
@@ -10399,8 +10399,8 @@ DESCR("Get metadata cache current entry number");
 DATA(insert OID = 8084 ( gp_metadata_cache_current_block_num  PGNSP PGUID 12 f 
f t f s 0 20 f "" _null_ _null_ _null_ gp_metadata_cache_current_block_num - 
_null_ n ));
 DESCR("Get metadata cache current block number");
 
-/* gp_metadata_cache_putentry_fortest => text */
-DATA(insert OID = 8085 ( gp_metadata_cache_putentry_fortest  PGNSP PGUID 12 f 
f t f s 5 25 f "26 26 26 23 23" _null_ _null_ _null_ 
gp_metadata_cache_putentry_fortest - _null_ n ));
+/* gp_metadata_cache_put_entry_for_test => text */
+DATA(insert OID = 8085 ( gp_metadata_cache_put_entry_for_test  PGNSP PGUID 12 
f f t f s 5 25 f "26 26 26 23 23" _null_ _null_ _null_ 
gp_metadata_cache_put_entry_for_test - _null_ n ));
 DESCR("Put entries into metadata cache");
 
 /* gp_metadata_cache_exists => bool*/ 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/04c39387/src/include/catalog/pg_proc.sql
--
diff --git a/src/include/catalog/pg_proc.sql b/src/include/catalog/pg_proc.sql
index dc871a8..df3fca8 100644
--- a/src/include/catalog/pg_proc.sql
+++ b/src/include/catalog/pg_proc.sql
@@ -5512,6 +5512,6 @@
 
  CREATE FUNCTION gp_metadata_cache_info(tablespace_oid, database_oid, 
relation_oid, segno) RETURNS text LANGUAGE internal STABLE STRICT AS 
'gp_metadata_cache_info' WITH (OID=8083, DESCRIPTION="Get metadata cache info 
for specific key");
  
- CREATE FUNCTION gp_metadata_cache_putentry_fortest(tablespace_oid, 
database_oid, relation_oid, segno) RETURNS text LANGUAGE internal STABLE STRICT 
AS 'gp_metadata_cache_putentry_fortest' WITH (OID=8085, DESCRIPTION="Put 
entries into metadata cache for test");
+ CREATE FUNCTION gp_metadata_cache_put_entry_for_test(tablespace_oid, 
database_oid, relation_oid, segno) RETURNS text LANGUAGE internal STABLE STRICT 
AS 'gp_metadata_cache_put_entry_for_test' WITH (OID=8085, DESCRIPTION="Put 
entries into metadata cache for test");
  
  CREATE FUNCTION dump_resource_manager_status(info_type) RETURNS text LANGUAGE 
internal STABLE STRICT AS 'dump_resource_manager_status' WITH (OID=6450, 
DESCRIPTION="Dump resource manager status for testing");

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/04c39387/src/include/utils/builtins.h
--
diff --git a/src/include/utils/builtins.h b/src/include/utils/builtins.h
index e9f60cd..7c18f27 100644
--- a/src/include/utils/builtins.h
+++ b/src/include/utils/builtins.h
@@ -1200,6 +1200,6 @@ extern Datum 
gp_metadata_cache_current_num(PG_FUNCTION_ARGS);
 extern Datum gp_metadata_cache_current_block_num(PG_FUNCTION_ARGS);
 extern 

[1/4] incubator-hawq git commit: HAWQ-265. Change metadata share memory flush strategy to prevent out of share memory problem when create too many hdfs_file.

2015-12-23 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master db1faf9d9 -> 754e11ddb


HAWQ-265. Change metadata share memory flush strategy to prevent out of share 
memory problem when create too many hdfs_file.


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

Branch: refs/heads/master
Commit: bf648450b06db05335aa449d2ec239301a4bf436
Parents: 8239cb9
Author: stanlyxiang 
Authored: Mon Dec 21 10:52:15 2015 +0800
Committer: stanlyxiang 
Committed: Mon Dec 21 10:52:15 2015 +0800

--
 src/backend/cdb/cdbmetadatacache.c |  5 ++---
 src/backend/cdb/cdbmetadatacache_process.c | 14 --
 src/backend/cdb/cdbvars.c  |  4 
 src/backend/utils/misc/guc.c   | 25 +
 src/include/cdb/cdbvars.h  |  4 
 5 files changed, 47 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/bf648450/src/backend/cdb/cdbmetadatacache.c
--
diff --git a/src/backend/cdb/cdbmetadatacache.c 
b/src/backend/cdb/cdbmetadatacache.c
index cef839f..f4c2369 100644
--- a/src/backend/cdb/cdbmetadatacache.c
+++ b/src/backend/cdb/cdbmetadatacache.c
@@ -65,7 +65,6 @@
 #include "fmgr.h"
 #include "utils/builtins.h"
 
-#define MAX_HDFS_FILE_NUM   (2 << 15)   // 1PB / 32G = 32K, 
2^15
 #define MAX_HDFS_HOST_NUM   1024
 #define MAX_BLOCK_INFO_LEN  128
 #define BLOCK_INFO_BIT_NUM  16
@@ -184,7 +183,7 @@ MetadataCache_ShmemSize(void)
 {
 Size size;
 
-size = hash_estimate_size((Size)MAX_HDFS_FILE_NUM, 
sizeof(MetadataCacheEntry));
+size = hash_estimate_size((Size)metadata_cache_max_hdfs_file_num, 
sizeof(MetadataCacheEntry));
 
 size = add_size(size, hash_estimate_size((Size)MAX_HDFS_HOST_NUM, 
sizeof(BlockInfoEntry)) * METADATA_BLOCK_INFO_TYPE_NUM);
 
@@ -267,7 +266,7 @@ MetadataCacheHashTableInit(void)
 info.hash = tag_hash;
 hash_flags = (HASH_ELEM | HASH_FUNCTION);
 
-MetadataCache = ShmemInitHash("Metadata Cache", MAX_HDFS_FILE_NUM, 
MAX_HDFS_FILE_NUM, , hash_flags);
+MetadataCache = ShmemInitHash("Metadata Cache", 
metadata_cache_max_hdfs_file_num, metadata_cache_max_hdfs_file_num, , 
hash_flags);
 if (NULL == MetadataCache)
 {
 return false;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/bf648450/src/backend/cdb/cdbmetadatacache_process.c
--
diff --git a/src/backend/cdb/cdbmetadatacache_process.c 
b/src/backend/cdb/cdbmetadatacache_process.c
index df4bbac..f289e3b 100644
--- a/src/backend/cdb/cdbmetadatacache_process.c
+++ b/src/backend/cdb/cdbmetadatacache_process.c
@@ -410,11 +410,18 @@ ProcessMetadataCacheCheck()
 HdfsFileInfo *file_info;
 
 double free_block_ratio = (FREE_BLOCK_NUM * 1.0) / 
metadata_cache_block_capacity;
+long cache_entry_num = hash_get_num_entries(MetadataCache);
+double cache_entry_ratio = (cache_entry_num * 1.0) / 
metadata_cache_max_hdfs_file_num;
 
 elog(DEBUG1, "[MetadataCache] ProcessMetadataCacheCheck 
free_block_ratio:%f", free_block_ratio);
 
-if (free_block_ratio < metadata_cache_free_block_max_ratio)
+if (free_block_ratio < metadata_cache_free_block_max_ratio || 
cache_entry_ratio > metadata_cache_flush_ratio)
 {
+   if(cache_entry_num == metadata_cache_max_hdfs_file_num)
+   {
+   elog(WARNING, "[MetadataCache] ProcessMetadataCacheCheck : 
Metadata cache is full.");
+   }
+   elog(DEBUG1, "[MetadataCache] ProcessMetadataCacheCheck 
cache_entry_ratio:%f", cache_entry_ratio);
 if (NULL == MetadataCacheLRUList) 
 {
 GenerateMetadataCacheLRUList();
@@ -436,7 +443,10 @@ ProcessMetadataCacheCheck()
 DestroyHdfsFileInfo(file_info);
 total_remove_files++;
 
-if (((FREE_BLOCK_NUM * 1.0) / metadata_cache_block_capacity) >= 
metadata_cache_free_block_normal_ratio)
+double cache_entry_ratio = hash_get_num_entries(MetadataCache) / 
metadata_cache_max_hdfs_file_num;
+
+if (((FREE_BLOCK_NUM * 1.0) / metadata_cache_block_capacity) >= 
metadata_cache_free_block_normal_ratio
+   && cache_entry_ratio < metadata_cache_reduce_ratio)
 {
 break;
 }

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/bf648450/src/backend/cdb/cdbvars.c
--
diff --git 

[2/4] incubator-hawq git commit: HAWQ-265. Change metadata share memory flush strategy: change log and flush conditions

2015-12-23 Thread iweng
 HAWQ-265. Change metadata share memory flush strategy: change log and flush 
conditions


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

Branch: refs/heads/master
Commit: ee194aaefea089b5f703574ace2ebeb6e8653d76
Parents: bf64845
Author: stanlyxiang 
Authored: Tue Dec 22 13:05:18 2015 +0800
Committer: stanlyxiang 
Committed: Tue Dec 22 13:05:18 2015 +0800

--
 src/backend/cdb/cdbmetadatacache_process.c | 4 ++--
 src/backend/utils/misc/guc.c   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ee194aae/src/backend/cdb/cdbmetadatacache_process.c
--
diff --git a/src/backend/cdb/cdbmetadatacache_process.c 
b/src/backend/cdb/cdbmetadatacache_process.c
index f289e3b..7da48d2 100644
--- a/src/backend/cdb/cdbmetadatacache_process.c
+++ b/src/backend/cdb/cdbmetadatacache_process.c
@@ -417,9 +417,9 @@ ProcessMetadataCacheCheck()
 
 if (free_block_ratio < metadata_cache_free_block_max_ratio || 
cache_entry_ratio > metadata_cache_flush_ratio)
 {
-   if(cache_entry_num == metadata_cache_max_hdfs_file_num)
+   if(cache_entry_num >= metadata_cache_max_hdfs_file_num)
{
-   elog(WARNING, "[MetadataCache] ProcessMetadataCacheCheck : 
Metadata cache is full.");
+   elog(LOG, "[MetadataCache] ProcessMetadataCacheCheck : Metadata 
cache is full.The cache entry num is:%ld. The metadata_cache_max_hdfs_file_num 
is:%d", cache_entry_num, metadata_cache_max_hdfs_file_num);
}
elog(DEBUG1, "[MetadataCache] ProcessMetadataCacheCheck 
cache_entry_ratio:%f", cache_entry_ratio);
 if (NULL == MetadataCacheLRUList) 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/ee194aae/src/backend/utils/misc/guc.c
--
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index f1e5f8a..1915d6e 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -6504,7 +6504,7 @@ static struct config_int ConfigureNamesInt[] =
NULL
},
_cache_check_interval,
-   60, 10, 3600, NULL, NULL
+   30, 10, 3600, NULL, NULL
},
{
{



[3/4] incubator-hawq git commit: HAWQ-265. Change metadata share memory flush strategy: change max hdfs file num minimum to 128k.

2015-12-23 Thread iweng
HAWQ-265. Change metadata share memory flush strategy: change max hdfs file num 
minimum to 128k.


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

Branch: refs/heads/master
Commit: 594c154055f138cc86c2c89a443e85f742d886ec
Parents: ee194aa
Author: stanlyxiang 
Authored: Wed Dec 23 13:18:09 2015 +0800
Committer: stanlyxiang 
Committed: Wed Dec 23 13:18:09 2015 +0800

--
 src/backend/utils/misc/guc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/594c1540/src/backend/utils/misc/guc.c
--
diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c
index 1915d6e..1ae6b2c 100644
--- a/src/backend/utils/misc/guc.c
+++ b/src/backend/utils/misc/guc.c
@@ -6540,7 +6540,7 @@ static struct config_int ConfigureNamesInt[] =
NULL
},
_cache_max_hdfs_file_num,
-   524288, 32768, 8388608, NULL, NULL
+   524288, 131072, 8388608, NULL, NULL
},
 
/* End-of-list marker */



incubator-hawq git commit: HAWQ-222. add revert block info maps

2015-12-06 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/heads/master 0ec66d57d -> a9e010eda


HAWQ-222. add revert block info maps


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

Branch: refs/heads/master
Commit: a9e010eda9380db8b7020317330d8923bde51e6d
Parents: 0ec66d5
Author: ivan 
Authored: Mon Dec 7 14:38:07 2015 +0800
Committer: ivan 
Committed: Mon Dec 7 14:38:07 2015 +0800

--
 src/backend/cdb/cdbmetadatacache.c | 107 +---
 1 file changed, 86 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/a9e010ed/src/backend/cdb/cdbmetadatacache.c
--
diff --git a/src/backend/cdb/cdbmetadatacache.c 
b/src/backend/cdb/cdbmetadatacache.c
index dbf1a65..cef839f 100644
--- a/src/backend/cdb/cdbmetadatacache.c
+++ b/src/backend/cdb/cdbmetadatacache.c
@@ -92,6 +92,17 @@ typedef struct BlockInfoEntry
 uint16_tindex;
 } BlockInfoEntry;
 
+typedef struct RevertBlockInfoKey
+{
+uint16_tindex;
+} RevertBlockInfoKey;
+
+typedef struct RevertBlockInfoEntry
+{
+RevertBlockInfoKey  key;
+charblock_info[MAX_BLOCK_INFO_LEN];
+} RevertBlockInfoEntry;
+
 /*
  * Metadata Cache Global Initialization Functions
  */
@@ -101,6 +112,9 @@ MetadataCacheHashTableInit(void);
 static bool 
 MetadataBlockInfoTablesInit(void);
 
+static bool
+MetadataRevertBlockInfoTablesInit(void);
+
 static bool 
 MetadataCacheHdfsBlockArrayInit(void);
 
@@ -145,6 +159,10 @@ static HTAB *BlockHostsMap = NULL;
 static HTAB *BlockNamesMap = NULL;
 static HTAB *BlockTopologyPathsMap = NULL;
 
+static HTAB *RevertBlockHostsMap = NULL;
+static HTAB *RevertBlockNamesMap = NULL;
+static HTAB *RevertBlockTopologyPathsMap = NULL;
+
 //static BlockLocation *CreateHdfsFileBlockLocations(BlockLocation 
*hdfs_locations, int block_num);
 static BlockLocation *MergeHdfsFileBlockLocations(BlockLocation *locations1, 
int block_num1, BlockLocation *locations2, int block_num2);
 
@@ -218,6 +236,11 @@ MetadataCache_ShmemInit(void)
 elog(FATAL, "[MetadataCache] fail to allocate share memory for 
metadata cache block info hash tables");
 }
 
+if (!MetadataRevertBlockInfoTablesInit())
+{
+elog(FATAL, "[MetadataCache] fail to allocate share memory for 
metadata cache revert block info hash tables");
+}
+
 if (!MetadataCacheHdfsBlockArrayInit())
 {
 elog(FATAL, "[MetadataCache] fail to allocate share memory for 
metadata cache hdfs block array");
@@ -293,6 +316,43 @@ MetadataBlockInfoTablesInit(void)
 }
 
 /*
+ *  Initialize metadata revert block info hash tables
+ */
+bool 
+MetadataRevertBlockInfoTablesInit(void)
+{
+HASHCTL info;
+int hash_flags;
+ 
+MemSet(, 0, sizeof(info));
+
+info.keysize = sizeof(RevertBlockInfoKey);
+info.entrysize = sizeof(RevertBlockInfoEntry);
+hash_flags = HASH_ELEM;
+
+RevertBlockHostsMap = ShmemInitHash("Metadata Revert Block Hosts Map", 
MAX_HDFS_HOST_NUM, MAX_HDFS_HOST_NUM, , hash_flags);
+if (NULL == RevertBlockHostsMap)
+{
+return false;
+}
+ 
+RevertBlockNamesMap = ShmemInitHash("Metadata Revert Block Names Map", 
MAX_HDFS_HOST_NUM, MAX_HDFS_HOST_NUM, , hash_flags);
+if (NULL == RevertBlockNamesMap)
+{
+return false;
+}
+
+RevertBlockTopologyPathsMap = ShmemInitHash("Metadata Revert Block 
TopologyPaths Map", MAX_HDFS_HOST_NUM, MAX_HDFS_HOST_NUM, , hash_flags);
+if (NULL == RevertBlockTopologyPathsMap)
+{
+return false;
+}
+
+return true;
+}
+
+
+/*
  *  Initialize metadata hdfs block array
  */
 bool 
@@ -482,22 +542,30 @@ SetMetadataBlockInfo(MetadataBlockInfoType type, char 
**infos, uint32_t num)
 BlockInfoKey key;
 BlockInfoEntry *entry;
 HTAB *htab = NULL;
+
+RevertBlockInfoKey rkey;
+RevertBlockInfoEntry *rentry;
+HTAB *rhtab = NULL;
+
 uint32_t *cur_idx = NULL;
 
 switch (type)
 {
 case METADATA_BLOCK_INFO_TYPE_HOSTS:
 htab = BlockHostsMap;
+rhtab = RevertBlockHostsMap;
 cur_idx = >cur_hosts_idx;
 break;
 
 case METADATA_BLOCK_INFO_TYPE_NAMES:
 htab = BlockNamesMap;
+rhtab = RevertBlockNamesMap;
 cur_idx = >cur_names_idx;
 break;
 
 case METADATA_BLOCK_INFO_TYPE_TOPOLOGYPATHS:
 htab = BlockTopologyPathsMap;
+rhtab = 

Git Push Summary

2015-12-01 Thread iweng
Repository: incubator-hawq
Updated Branches:
  refs/remotes/master/master [created] aa268c59e