[GitHub] incubator-hawq pull request #1370: HAWQ-1508 fix travis broken

2018-05-30 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1370#discussion_r191994047
  
--- Diff: .travis.yml ---
@@ -42,7 +42,18 @@ install:
   protobuf-c
   thrift
   - brew outdated libyaml || brew upgrade libyaml
-  - brew outdated json-c  || brew upgrade json-c
+  - git clone https://github.com/json-c/json-c.git
+  - cd json-c
+  - sh autogen.sh
+  - git reset --hard json-c-0.12.1-20160607
+  - git log
+  - git reset json-c-0.12.1-20160607 --hard
--- End diff --

why there are duplicate lines of this? Suggest to use `git checkout 
json-c-0.12.1-20160607` instead of reset.


---


[GitHub] incubator-hawq issue #1292: HAWQ-1532. recognize timezone 'CST' correctly in...

2017-10-19 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1292
  
```
cd $CODE_BASE
make feature-test
cd src/test/feature
./feature-test
```


---


[GitHub] incubator-hawq issue #1275: HAWQ-1333. Change access mode of source files fo...

2017-08-10 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1275
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1237: HAWQ-1459. Tweak the feature test related entrie...

2017-05-21 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1237
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1177: HAWQ-326. Support RPM package for Apache HAWQ.

2017-03-16 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1177
  
@radarwave TIL, thanks! 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1107: HAWQ-1316. Fix feature test build on CentOS7.3

2017-02-08 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1107
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1086: HAWQ-1274. Add apache rat check in travis CI.

2017-01-14 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1086
  
Who is now taking charge of Jenkins CI? I think for apache project, if you 
can refine our Jenkins CI script, it might be better choice.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1086: HAWQ-1274. Add apache rat check in travis...

2017-01-14 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/1086


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1086: HAWQ-1274. Add apache rat check in travis CI.

2017-01-14 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1086
  
Merged into master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1086: HAWQ-1274. Add apache rat check in travis...

2017-01-13 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1086#discussion_r96110599
  
--- Diff: .travis.yml ---
@@ -38,6 +39,7 @@ script:
   - make -j$(sysctl -n hw.ncpu)
   - make feature-test
   - make feature-test-clean
+  - mvn apache-rat:check
--- End diff --

totally agree, good advice!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1086: HAWQ-1274. Add apache rat check in travis CI.

2017-01-13 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1086
  
cc @huor @paul-guo- 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1086: HAWQ-1274. Add apache rat check in travis...

2017-01-13 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/1086

HAWQ-1274. Add apache rat check in travis CI.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1274

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/1086.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1086


commit 9392c5edc457f9c1aded9fb8f1db1806e71accbd
Author: xunzhang <xunzhang...@gmail.com>
Date:   2017-01-14T06:50:53Z

HAWQ-1274. Add apache rat check in travis CI.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1072: [WIP]HAWQ-1246. Add generation of RequestID, Cli...

2017-01-02 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1072
  
LGTM


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1054: HAWQ-870. Allocate target's tuple table slot in ...

2016-12-20 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1054
  
Already merged?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1058: HAWQ-1226. HAWQ core dump due to enable r...

2016-12-20 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1058#discussion_r93190518
  
--- Diff: src/test/regress/checkinc.py ---
@@ -78,9 +78,10 @@
 'winsock.h': [],
 'winsock2.h':[],
 'ws2tcpip.h':[],
-'hdfs/hdfs.h':  [],
+'hdfs/hdfs.h':  [],
 'quicklz1.h':   [],
 'quicklz3.h':   [],
+'json-c/json.h': [],
--- End diff --

Make sense since Travis CI is green with this commit. Good fix.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1058: HAWQ-1226. HAWQ core dump due to enable r...

2016-12-19 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1058#discussion_r93179924
  
--- Diff: src/backend/libpq/rangerrest.c ---
@@ -245,279 +257,326 @@ json_object *create_ranger_request_json_batch(List 
*args)
  *   }
  */
 json_object* create_ranger_request_json(char* user, AclObjectKind kind, 
char* object,
-List* actions, bool isAll)
+   List* actions, bool isAll)
 {
-Assert(user != NULL && object != NULL && privilege != NULL
-&& isAll);
-ListCell *cell;
-
-elog(LOG, "build json for ranger request, user:%s, kind:%s, object:%s",
-  user, AclObjectKindStr[kind], object);
-json_object *jrequest = json_object_new_object();
-json_object *juser = json_object_new_string(user);
-
-json_object *jaccess = json_object_new_array();
-json_object *jelement = json_object_new_object();
-
-json_object *jresource = json_object_new_object();
-switch(kind)
-{
-case ACL_KIND_CLASS:
-case ACL_KIND_SEQUENCE:
-case ACL_KIND_PROC:
-case ACL_KIND_NAMESPACE:
-case ACL_KIND_LANGUAGE:
-{
-char *ptr = NULL; char *name = NULL;
-char *first = NULL; // could be a database or protocol or 
tablespace
-char *second = NULL; // could be a schema or language
-char *third = NULL; // could be a table or sequence or function
-int idx = 0;
-for (name = strtok_r(object, ".", );
- name;
- name = strtok_r(NULL, ".", ), idx++)
-{
-if (idx == 0)
-{
-first = pstrdup(name);
-}
-else if (idx == 1)
-{
-second = pstrdup(name);
-}
-else
-{
-third = pstrdup(name);
-}
-}
-
-if (first != NULL)
-{
-json_object *jfirst = json_object_new_string(first);
-json_object_object_add(jresource, "database", jfirst);
-}
-if (second != NULL)
-{
-json_object *jsecond = json_object_new_string(second);
-json_object_object_add(jresource,
-(kind == ACL_KIND_LANGUAGE) ? "language" : 
"schema", jsecond);
-}
-if (third != NULL)
-{
-json_object *jthird = json_object_new_string(third);
-json_object_object_add(jresource,
- (kind == ACL_KIND_CLASS) ? "table" :
- (kind == ACL_KIND_SEQUENCE) ? "sequence" : 
"function", jthird);
-}
-
-if (first != NULL)
-pfree(first);
-if (second != NULL)
-pfree(second);
-if (third != NULL)
-pfree(third);
-break;
-}
-case ACL_KIND_OPER:
-case ACL_KIND_CONVERSION:
-case ACL_KIND_DATABASE:
-case ACL_KIND_TABLESPACE:
-case ACL_KIND_TYPE:
-case ACL_KIND_FILESYSTEM:
-case ACL_KIND_FDW:
-case ACL_KIND_FOREIGN_SERVER:
-case ACL_KIND_EXTPROTOCOL:
-{
-json_object *jobject = json_object_new_string(object);
-json_object_object_add(jresource, AclObjectKindStr[kind], 
jobject);
-break;
-}
-default:
-elog(ERROR, "unrecognized objkind: %d", (int) kind);
-}
-
-json_object *jactions = json_object_new_array();
-foreach(cell, actions)
-{
-json_object* jaction = json_object_new_string((char 
*)cell->data.ptr_value);
-json_object_array_add(jactions, jaction);
-}
-json_object_object_add(jelement, "resource", jresource);
-json_object_object_add(jelement, "privileges", jactions);
-json_object_array_add(jaccess, jelement);
-
-json_object_object_add(jrequest, "user", juser);
-json_object_object_add(jrequest, "access", jaccess);
-json_object *jreqid = json_object_new_string("1");
-json_object_object_add(jrequest, "requestId", jreqid);
-json_object *jclientip = json_object_new_string("123.0.0.21");
-json_object_object_add(jrequest, "clie

[GitHub] incubator-hawq pull request #1058: HAWQ-1226. HAWQ core dump due to enable r...

2016-12-19 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1058#discussion_r93180221
  
--- Diff: src/backend/libpq/rangerrest.c ---
@@ -86,132 +98,132 @@ RangerACLResult parse_ranger_response(char* buffer)
  */
 json_object *create_ranger_request_json_batch(List *args)
 {
-  json_object *juser = NULL;
-  json_object *jaccess = json_object_new_array();
-  json_object *jrequest = json_object_new_object();
-  char *user = NULL;
-  ListCell *arg;
-  
-  foreach(arg, args)
-  {
-RangerRequestJsonArgs *arg_ptr = (RangerRequestJsonArgs *) lfirst(arg);
-if (user == NULL)
-{
-  user = arg_ptr->user;
-  juser = json_object_new_string(user);
-}
-AclObjectKind kind = arg_ptr->kind;
-char* object = arg_ptr->object;
-Assert(user != NULL && object != NULL && privilege != NULL && 
arg_ptr->isAll);
-elog(LOG, "build json for ranger request, user:%s, kind:%s, object:%s",
- user, AclObjectKindStr[kind], object);
-
-json_object *jresource = json_object_new_object();
-json_object *jelement = json_object_new_object();
-json_object *jactions = json_object_new_array();
-
-switch(kind)
-{
-case ACL_KIND_CLASS:
-case ACL_KIND_SEQUENCE:
-case ACL_KIND_PROC:
-case ACL_KIND_NAMESPACE:
-case ACL_KIND_LANGUAGE:
-{
-char *ptr = NULL; char *name = NULL;
-char *first = NULL; // could be a database or protocol or 
tablespace
-char *second = NULL; // could be a schema or language
-char *third = NULL; // could be a table or sequence or function
-int idx = 0;
-for (name = strtok_r(object, ".", );
- name;
- name = strtok_r(NULL, ".", ), idx++)
-{
-if (idx == 0)
-{
-first = pstrdup(name);
-}
-else if (idx == 1)
-{
-second = pstrdup(name);
-}
-else
-{
-third = pstrdup(name);
-}
-}
-
-if (first != NULL)
-{
-json_object *jfirst = json_object_new_string(first);
-json_object_object_add(jresource, "database", jfirst);
-}
-if (second != NULL)
-{
-json_object *jsecond = json_object_new_string(second);
-json_object_object_add(jresource,
-(kind == ACL_KIND_LANGUAGE) ? "language" : 
"schema", jsecond);
-}
-if (third != NULL)
-{
-json_object *jthird = json_object_new_string(third);
-json_object_object_add(jresource,
- (kind == ACL_KIND_CLASS) ? "table" :
- (kind == ACL_KIND_SEQUENCE) ? "sequence" : 
"function", jthird);
-}
-
-if (first != NULL)
-pfree(first);
-if (second != NULL)
-pfree(second);
-if (third != NULL)
-pfree(third);
-break;
-}
-case ACL_KIND_OPER:
-case ACL_KIND_CONVERSION:
-case ACL_KIND_DATABASE:
-case ACL_KIND_TABLESPACE:
-case ACL_KIND_TYPE:
-case ACL_KIND_FILESYSTEM:
-case ACL_KIND_FDW:
-case ACL_KIND_FOREIGN_SERVER:
-case ACL_KIND_EXTPROTOCOL:
-{
-json_object *jobject = json_object_new_string(object);
-json_object_object_add(jresource, AclObjectKindStr[kind], 
jobject);
-break;
-}
-default:
-elog(ERROR, "unrecognized objkind: %d", (int) kind);
-} // switch
-
-json_object_object_add(jelement, "resource", jresource);
-
-//ListCell *cell;
-//foreach(cell, arg_ptr->actions)
-//{
-  char tmp[7] = "select";
-  json_object* jaction = json_object_new_string((char *)tmp);
-  //json_object* jaction = json_object_new_string((char 
*)cell->data.ptr_value);
-  json_object_array_add(jactions, jaction);
-//}
-json_object_object_add(jelement, "privileges", jactions);
-json_object_array_add(jaccess, jelement);
-
-  } // foreach
-

[GitHub] incubator-hawq pull request #1058: HAWQ-1226. HAWQ core dump due to enable r...

2016-12-19 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1058#discussion_r93179777
  
--- Diff: src/test/regress/checkinc.py ---
@@ -78,9 +78,10 @@
 'winsock.h': [],
 'winsock2.h':[],
 'ws2tcpip.h':[],
-'hdfs/hdfs.h':  [],
+'hdfs/hdfs.h':  [],
 'quicklz1.h':   [],
 'quicklz3.h':   [],
+'json-c/json.h': [],
--- End diff --

Does `checkinc.py` apply only when executing `make install`? I think this 
fix is necessary but I don't have a Mac environment to test it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1058: HAWQ-1226. HAWQ core dump due to enable r...

2016-12-19 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1058#discussion_r93179978
  
--- Diff: src/backend/libpq/rangerrest.c ---
@@ -24,60 +24,72 @@
  *
  *-
  */
-
 #include "utils/rangerrest.h"
-
 /*
  * A mapping from AclObjectKind to string
  */
 char* AclObjectKindStr[] =
 {
-"table", /* pg_class */
-"sequence",  /* pg_sequence */
-"database",  /* pg_database */
-"function",  /* pg_proc */
-"operator",  /* pg_operator */
-"type",  /* pg_type */
-"language",  /* pg_language */
-"namespace", /* pg_namespace */
-"oplass",/* pg_opclass */
-"conversion",/* pg_conversion */
-"tablespace",/* pg_tablespace */
-"filespace", /* pg_filespace */
-"filesystem",/* pg_filesystem */
-"fdw",   /* pg_foreign_data_wrapper */
-"foreign_server",/* pg_foreign_server */
-"protocol",  /* pg_extprotocol */
-"none"   /* MUST BE LAST */
+   "table", /* pg_class */
+   "sequence",  /* pg_sequence */
+   "database",  /* pg_database */
+   "function",  /* pg_proc */
+   "operator",  /* pg_operator */
+   "type",  /* pg_type */
+   "language",  /* pg_language */
+   "namespace", /* pg_namespace */
+   "oplass",/* pg_opclass */
+   "conversion",/* pg_conversion */
+   "tablespace",/* pg_tablespace */
+   "filespace", /* pg_filespace */
+   "filesystem",/* pg_filesystem */
+   "fdw",   /* pg_foreign_data_wrapper */
+   "foreign_server",/* pg_foreign_server */
+   "protocol",  /* pg_extprotocol */
+   "none"   /* MUST BE LAST */
 };
 
 RangerACLResult parse_ranger_response(char* buffer)
 {
-Assert(buffer != NULL);
-if (strlen(buffer) == 0)
-return RANGERCHECK_UNKNOWN;
-
-elog(LOG, "read from Ranger Restful API: %s", buffer);
-
-struct json_object *response = json_tokener_parse(buffer);
-struct json_object *accessObj = json_object_object_get(response, 
"access");
-
-int arraylen = json_object_array_length(accessObj);
-elog(LOG, "Array Length: %dn",arraylen);
-
-json_object * jvalue;
-json_object * jallow;
-json_bool result;
-// here should return which table's acl check failed in future.
-for (int i=0; i< arraylen; i++){
-  jvalue = json_object_array_get_idx(accessObj, i);
-  jallow = json_object_object_get(jvalue, "allowed");
-  result = json_object_get_boolean(jallow);
-  if(result != 1){
-return RANGERCHECK_NO_PRIV;
-  }
-}
-return RANGERCHECK_OK;
+   Assert(buffer != NULL);
+   if (strlen(buffer) == 0)
+   return RANGERCHECK_UNKNOWN;
+
+   elog(LOG, "read from Ranger Restful API: %s", buffer);
+
+   struct json_object *response = json_tokener_parse(buffer);
+   if (response == NULL) 
--- End diff --

Looks good 👋 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1058: HAWQ-1226. HAWQ core dump due to enable r...

2016-12-19 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1058#discussion_r93180025
  
--- Diff: src/backend/libpq/rangerrest.c ---
@@ -24,60 +24,72 @@
  *
  *-
  */
-
 #include "utils/rangerrest.h"
-
 /*
  * A mapping from AclObjectKind to string
  */
 char* AclObjectKindStr[] =
 {
-"table", /* pg_class */
-"sequence",  /* pg_sequence */
-"database",  /* pg_database */
-"function",  /* pg_proc */
-"operator",  /* pg_operator */
-"type",  /* pg_type */
-"language",  /* pg_language */
-"namespace", /* pg_namespace */
-"oplass",/* pg_opclass */
-"conversion",/* pg_conversion */
-"tablespace",/* pg_tablespace */
-"filespace", /* pg_filespace */
-"filesystem",/* pg_filesystem */
-"fdw",   /* pg_foreign_data_wrapper */
-"foreign_server",/* pg_foreign_server */
-"protocol",  /* pg_extprotocol */
-"none"   /* MUST BE LAST */
+   "table", /* pg_class */
+   "sequence",  /* pg_sequence */
+   "database",  /* pg_database */
+   "function",  /* pg_proc */
+   "operator",  /* pg_operator */
+   "type",  /* pg_type */
+   "language",  /* pg_language */
+   "namespace", /* pg_namespace */
+   "oplass",/* pg_opclass */
+   "conversion",/* pg_conversion */
+   "tablespace",/* pg_tablespace */
+   "filespace", /* pg_filespace */
+   "filesystem",/* pg_filesystem */
+   "fdw",   /* pg_foreign_data_wrapper */
+   "foreign_server",/* pg_foreign_server */
+   "protocol",  /* pg_extprotocol */
+   "none"   /* MUST BE LAST */
 };
 
 RangerACLResult parse_ranger_response(char* buffer)
 {
-Assert(buffer != NULL);
-if (strlen(buffer) == 0)
-return RANGERCHECK_UNKNOWN;
-
-elog(LOG, "read from Ranger Restful API: %s", buffer);
-
-struct json_object *response = json_tokener_parse(buffer);
-struct json_object *accessObj = json_object_object_get(response, 
"access");
-
-int arraylen = json_object_array_length(accessObj);
-elog(LOG, "Array Length: %dn",arraylen);
-
-json_object * jvalue;
-json_object * jallow;
-json_bool result;
-// here should return which table's acl check failed in future.
-for (int i=0; i< arraylen; i++){
-  jvalue = json_object_array_get_idx(accessObj, i);
-  jallow = json_object_object_get(jvalue, "allowed");
-  result = json_object_get_boolean(jallow);
-  if(result != 1){
-return RANGERCHECK_NO_PRIV;
-  }
-}
-return RANGERCHECK_OK;
+   Assert(buffer != NULL);
+   if (strlen(buffer) == 0)
+   return RANGERCHECK_UNKNOWN;
+
+   elog(LOG, "read from Ranger Restful API: %s", buffer);
+
+   struct json_object *response = json_tokener_parse(buffer);
+   if (response == NULL) 
+   {
+   elog(WARNING, "json_tokener_parse failed");
+   return RANGERCHECK_UNKNOWN;
+   }
+
+   struct json_object *accessObj = NULL;
+   if (!json_object_object_get_ex(response, "access", ))
--- End diff --

What about other fields check?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1056: HAWQ-1227. Fix hawq init fails when user name wi...

2016-12-19 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1056
  
`CEO` is a great capitalized user name.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1055: HAWQ-1001. Bugfix and refactor ranger log...

2016-12-19 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/1055


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1055: HAWQ-1001. Bugfix and refactor ranger logic.

2016-12-19 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1055
  
Merged into master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1056: HAWQ-1227. Fix hawq init fails when user name wi...

2016-12-19 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1056
  
LGTM. +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1055: HAWQ-1001. Bugfix and refactor ranger log...

2016-12-18 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1055#discussion_r92972825
  
--- Diff: src/backend/libpq/rangerrest.c ---
@@ -468,7 +440,7 @@ void call_ranger_rest(CURL_HANDLE curl_handle, char* 
request)
 }
 else
 {
-elog(LOG, "%lu bytes retrieved from Ranger Restful API.",
+elog(LOG, "%d bytes retrieved from Ranger Restful API.",
--- End diff --

It should be, but this pull request is just a hotfix and small refactor. I 
think ranger codes should be largely refactored later on which is not relevant 
to this pull request. Thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1055: HAWQ-1001. Bugfix and refactor ranger logic.

2016-12-18 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1055
  
cc @linwen @ictmalili  @zhangh43 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1055: HAWQ-1001. Bugfix and refactor ranger log...

2016-12-18 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/1055

HAWQ-1001. Bugfix and refactor ranger logic.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1001-BUGFIX

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/1055.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1055


commit 3568cbfb790a196e555ed067d13a7483ee872f34
Author: xunzhang <xunzhang...@gmail.com>
Date:   2016-12-19T05:08:23Z

HAWQ-1001. Bugfix and refactor ranger logic.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1045: HAWQ-1213. Incorrect check of hawqregiste...

2016-12-11 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/1045


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1045: HAWQ-1213. Incorrect check of hawqregister in ca...

2016-12-11 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1045
  
cc @stanlyxiang @ictmalili 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1045: HAWQ-1213. Incorrect check of hawqregiste...

2016-12-11 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/1045

HAWQ-1213. Incorrect check of hawqregister in case of randomly distributed 
table with non-default `default_hash_table_bucket_number` value.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1213

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/1045.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1045


commit e539ee247e6b2e31a8ce8981db8110aeff976017
Author: xunzhang <xunzhang...@gmail.com>
Date:   2016-12-11T08:32:06Z

HAWQ-1213. Incorrect check of hawqregister in case of randomly distributed 
table with non-default `default_hash_table_bucket_number` value.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-07 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r91325539
  
--- Diff: src/backend/resourcemanager/include/utils/simplestring.h ---
@@ -63,7 +63,7 @@ bool SimpleStringEmpty(SimpStringPtr str);
 int  SimpleStringLocateChar(SimpStringPtr str, char target, int *location);
 /* string to the other number values. */
 int  SimpleStringToInt32(SimpStringPtr str, int32_t *value);
-int  SimpleStringToInt64(SimpStringPtr str, int64_t *value);
+int  SimpleStringToInt64(SimpStringPtr str, int64 *value);
--- End diff --

I don't know either...


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1036: HAWQ-1188. Fix "-Wtautological-constant-out-of-r...

2016-12-07 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1036
  
Merged into master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-07 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r91325465
  
--- Diff: src/backend/cdb/cdbgang.c ---
@@ -444,7 +444,7 @@ disconnectAndDestroyGang(Gang *gp)
elog(DEBUG2, "Warning: disconnectAndDestroyGang called on an %s 
gang",
 gp->active ? "active" : "allocated");
 
-   if (gp->gang_id < 1 || gp->gang_id > 1 || gp->type > 10 || 
gp->size > 10)
+   if (gp->gang_id < 1 || gp->gang_id > 1 || gp->type > 
GANGTYPE_PRIMARY_WRITER || gp->size > 10)
--- End diff --

added.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-07 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r91325169
  
--- Diff: src/backend/resourcemanager/include/utils/simplestring.h ---
@@ -63,7 +63,7 @@ bool SimpleStringEmpty(SimpStringPtr str);
 int  SimpleStringLocateChar(SimpStringPtr str, char target, int *location);
 /* string to the other number values. */
 int  SimpleStringToInt32(SimpStringPtr str, int32_t *value);
-int  SimpleStringToInt64(SimpStringPtr str, int64_t *value);
+int  SimpleStringToInt64(SimpStringPtr str, int64 *value);
--- End diff --

Added.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1038: HAWQ-1190. Fix "-Wtypedef-redefinition, -Wconsta...

2016-12-06 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1038
  
Merged into master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1038: HAWQ-1190. Fix "-Wtypedef-redefinition, -...

2016-12-06 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/1038


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1038: HAWQ-1190. Fix "-Wtypedef-redefinition, -Wconsta...

2016-12-05 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1038
  
cc @paul-guo- @ictmalili @stanlyxiang 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1038: HAWQ-1190. Fix "-Wtypedef-redefinition, -...

2016-12-05 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/1038

HAWQ-1190. Fix "-Wtypedef-redefinition, -Wconstant-logical-operand, 
-Wmemsize-comparison, -Wnull-dereference, -Wpointer-sign, -Wint-conversion" 
warning types.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1190

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/1038.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1038


commit 1313a2e67e33a9817a5226ef190a6b4c143fb278
Author: xunzhang <xunzhang...@gmail.com>
Date:   2016-12-05T16:51:33Z

HAWQ-1190. Fix "-Wtypedef-redefinition, -Wconstant-logical-operand, 
-Wmemsize-comparison, -Wnull-dereference, -Wpointer-sign, -Wint-conversion" 
warning types.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1036: HAWQ-1188. Fix "-Wtautological-constant-out-of-r...

2016-12-05 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1036
  
To conclude, I think there needs no modification according to @paul-guo- 's 
review. Please check out my replies and review this pull request again 
@paul-guo- . Thanks!


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-05 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r90880247
  
--- Diff: src/backend/resourcemanager/include/utils/simplestring.h ---
@@ -63,7 +63,7 @@ bool SimpleStringEmpty(SimpStringPtr str);
 int  SimpleStringLocateChar(SimpStringPtr str, char target, int *location);
 /* string to the other number values. */
 int  SimpleStringToInt32(SimpStringPtr str, int32_t *value);
-int  SimpleStringToInt64(SimpStringPtr str, int64_t *value);
+int  SimpleStringToInt64(SimpStringPtr str, int64 *value);
--- End diff --

Because the definition of `int64` is `long int` while the definition of 
`int64_t` is `long long int`. Besides, the caller of this function is a 
`HostnameVolumeInfo` object which is definited as a `int64`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-05 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r90876775
  
--- Diff: src/backend/gp_libpq_fe/fe-connect.c ---
@@ -436,7 +436,7 @@ PQconnectStartParams(const char **keywords,
{
conn->status = CONNECTION_BAD;
/* errorMessage is already set */
-   return false;
+   return conn;
--- End diff --

I found gpdb has already fixed this line of code: 
https://github.com/xunzhang/incubator-hawq/blob/47361ae71f8c90930c68985245aeef669437574b/src/interfaces/libpq/fe-connect.c#L449.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-05 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r90877631
  
--- Diff: src/backend/gp_libpq_fe/fe-exec.c ---
@@ -2992,7 +2992,6 @@ PQoidValue(const PGresult *res)
unsigned long result;
 
if (!res ||
--- End diff --

Ditto


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-05 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r90877708
  
--- Diff: src/interfaces/libpq/fe-exec.c ---
@@ -2386,7 +2386,7 @@ PQresultStatus(const PGresult *res)
 char *
 PQresStatus(ExecStatusType status)
 {
-   if (status < 0 || status >= sizeof pgresStatus / sizeof pgresStatus[0])
+   if (status < PGRES_EMPTY_QUERY || (unsigned int) status >= sizeof 
pgresStatus / sizeof pgresStatus[0])
--- End diff --

Ditto


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-05 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r90877683
  
--- Diff: src/interfaces/libpq/fe-connect.c ---
@@ -446,7 +446,7 @@ PQconnectStartParams(const char **keywords,
{
conn->status = CONNECTION_BAD;
/* errorMessage is already set */
-   return false;
+   return conn;
--- End diff --

Ditto


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-05 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r90877543
  
--- Diff: src/backend/gp_libpq_fe/fe-exec.c ---
@@ -2968,7 +2968,7 @@ PQoidStatus(const PGresult *res)
 
size_t  len;
 
-   if (!res || !res->cmdStatus || strncmp(res->cmdStatus, "INSERT ", 7) != 
0)
+   if (!res || strncmp(res->cmdStatus, "INSERT ", 7) != 0)
--- End diff --

`res->cmdStatus` can not be NULL if `res` is not NULL. Please check out the 
definition of `PGresult`, it is a stack memory bundled with `res` variable.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-05 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r90877094
  
--- Diff: src/backend/gp_libpq_fe/fe-exec.c ---
@@ -2668,7 +2668,7 @@ PQresultStatus(const PGresult *res)
 char *
 PQresStatus(ExecStatusType status)
 {
-   if ((int)status < 0 || status >= sizeof pgresStatus / sizeof 
pgresStatus[0])
+   if (status < PGRES_EMPTY_QUERY || (unsigned int) status >= sizeof 
pgresStatus / sizeof pgresStatus[0])
--- End diff --

Here, `PGRES_EMPTY_QUERY` is a lower guard enum value, so `status < 
PGRES_EMPTY_QUERY` is ok.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-05 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r90876168
  
--- Diff: src/backend/cdb/cdbsreh.c ---
@@ -347,11 +347,8 @@ void InsertIntoErrorTable(CdbSreh *cdbsreh)
}

/* file name */
-   if(cdbsreh->filename)
-   {
-   values[errtable_filename - 1] = DirectFunctionCall1(textin, 
CStringGetDatum(cdbsreh->filename));
-   nulls[errtable_filename - 1] = false;
-   }
+   values[errtable_filename - 1] = DirectFunctionCall1(textin, 
CStringGetDatum(cdbsreh->filename));
+   nulls[errtable_filename - 1] = false;
 
--- End diff --

Because if `cdbsreh` is created, `cdbsreh->filename` should be also not 
NULL. In other words, this check is meaningless. Please check out the 
definition of `CdbSreh`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-05 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1036#discussion_r90875684
  
--- Diff: src/backend/cdb/cdbgang.c ---
@@ -444,7 +444,7 @@ disconnectAndDestroyGang(Gang *gp)
elog(DEBUG2, "Warning: disconnectAndDestroyGang called on an %s 
gang",
 gp->active ? "active" : "allocated");
 
-   if (gp->gang_id < 1 || gp->gang_id > 1 || gp->type > 10 || 
gp->size > 10)
+   if (gp->gang_id < 1 || gp->gang_id > 1 || gp->type > 
GANGTYPE_PRIMARY_WRITER || gp->size > 10)
--- End diff --

check >10 is meaningless. We can also add `GANGTYPE_MAX` then check with 
`gp->type >= GANGTYPE_MAX`. Also, we can check with `gp-type < GANGTYPE_MAX`. 
All of these are equivalent.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1035: HAWQ-1187. Fix "-Wsometimes-uninitialized...

2016-12-05 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/1035


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1035: HAWQ-1187. Fix "-Wsometimes-uninitialized, -Wsiz...

2016-12-05 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1035
  
Merged into master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1024: Split schedule file to sanity and full te...

2016-12-04 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/1024


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1024: Split schedule file to sanity and full tests for...

2016-12-04 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1024
  
Merged into master, thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1035: HAWQ-1187. Fix "-Wsometimes-uninitialized...

2016-12-04 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1035#discussion_r90799626
  
--- Diff: src/bin/pg_dump/dumputils.c ---
@@ -1062,7 +1062,7 @@ char *
 custom_fmtopts_string(const char *src)
 {
int len = src ? strlen(src) : 0;
-   char   *result = malloc(len * 2 + 1);
+   char   *result = calloc(1, len * 2 + 1);
--- End diff --

fixed


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1036: HAWQ-1188. Fix "-Wtautological-constant-o...

2016-12-03 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/1036

HAWQ-1188. Fix "-Wtautological-constant-out-of-range-compare, 
-Wtautological-compare, -Wpointer-bool-conversion, 
-Wnon-literal-null-conversion, -Wincompatible-pointer-types, 
-Wincompatible-pointer-types-discards-qualifiers, -Wlogical-not-parentheses" 
compile warnings under osx.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1188

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/1036.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1036


commit 47361ae71f8c90930c68985245aeef669437574b
Author: xunzhang <xunzhang...@gmail.com>
Date:   2016-12-03T08:14:10Z

HAWQ-1188. Fix "-Wtautological-constant-out-of-range-compare, 
-Wtautological-compare, -Wpointer-bool-conversion, 
-Wnon-literal-null-conversion, -Wincompatible-pointer-types, 
-Wincompatible-pointer-types-discards-qualifiers, -Wlogical-not-parentheses" 
compile warnings under osx.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1036: HAWQ-1188. Fix "-Wtautological-constant-out-of-r...

2016-12-03 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1036
  
also cc @stanlyxiang 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1036: HAWQ-1188. Fix "-Wtautological-constant-out-of-r...

2016-12-03 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1036
  
cc @paul-guo- @huor 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #602: HAWQ-669. Fix interconnect guc gp_interconnect_tr...

2016-12-02 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/602
  
There might be some problems with this modification: you add a `int64` type 
of guc value into a `config_int` option list. @wengyanqing 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1035: HAWQ-1187. Fix "-Wsometimes-uninitialized, -Wsiz...

2016-12-02 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1035
  
also cc @stanlyxiang 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1035: HAWQ-1187. Fix "-Wsometimes-uninitialized, -Wsiz...

2016-12-02 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1035
  
cc @paul-guo- @ictmalili 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1035: HAWQ-1187. Fix "-Wsometimes-uninitialized...

2016-12-02 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/1035

HAWQ-1187. Fix "-Wsometimes-uninitialized, -Wsizeof-pointer-memaccess , 
-Wdangling-else, -Wheader-guard, -Wenum-conversion, -Winvalid-source-encoding" 
compile warnings under osx.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1187

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/1035.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1035


commit ed223548164b5a5a7bedb48f759eb51451373c0a
Author: xunzhang <xunzhang...@gmail.com>
Date:   2016-12-02T16:02:35Z

HAWQ-1187. Fix "-Wsometimes-uninitialized, -Wsizeof-pointer-memaccess, 
-Wdangling-else, -Wheader-guard, -Wenum-conversion, -Winvalid-source-encoding" 
compile warnings under osx.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1033: HAWQ-1183. Writable external table with Hash dis...

2016-12-02 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1033
  
ok, maybe we could test it manually for this.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1032: HAWQ-1184. Fix risky "-Wshift-negative-value, -W...

2016-12-01 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1032
  
Merged into master.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1032: HAWQ-1184. Fix risky "-Wshift-negative-va...

2016-12-01 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/1032


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1032: HAWQ-1184. Fix risky "-Wshift-negative-va...

2016-12-01 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1032#discussion_r90584055
  
--- Diff: src/backend/catalog/pg_filesystem.c ---
@@ -384,7 +384,7 @@ FileSystemGetNameByOid(Oid  fsysOid)
 
 char *fsys_func_type_to_name(FileSystemFuncType ftype)
 {
-   if(ftype < 0 || ftype >= FSYS_FUNC_TOTALNUM)
+   if (!(ftype >= FSYS_FUNC_CONNECT && ftype < FSYS_FUNC_TOTALNUM))
--- End diff --

@paul-guo- done


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1032: HAWQ-1184. Fix risky "-Wshift-negative-value, -W...

2016-12-01 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1032
  
cc @paul-guo- 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1032: HAWQ-1184. Fix risky "-Wshift-negative-va...

2016-12-01 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/1032

HAWQ-1184. Fix risky "-Wshift-negative-value, 
-Wparentheses-equality,-Wtautological-compare" types of compile warnings under 
osx.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1184

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/1032.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1032


commit dcc45ba1b3e1eb90db13aface7f92bd59fd704ae
Author: xunzhang <xunzhang...@gmail.com>
Date:   2016-12-01T15:30:01Z

HAWQ-1184. Fix risky "-Wshift-negative-value, -Wparentheses-equality, 
-Wtautological-compare" types of compile warnings under osx.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1031: HAWQ-1182. Add Macro for unused argument ...

2016-12-01 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1031#discussion_r90413490
  
--- Diff: src/include/postgres.h ---
@@ -513,6 +513,18 @@ extern void gp_set_thread_sigmasks(void);
 
 extern void OnMoveOutCGroupForQE(void);
 
+#ifndef POSSIBLE_UNUSED_VAR
+#define POSSIBLE_UNUSED_VAR(x) ((void)x)
+#endif
+
+#ifndef POSSIBLE_UNUSED_ARG
+#define POSSIBLE_UNUSED_ARG(x) ((void)x)
+#endif
+
+#ifndef UNUSED_ARG
+#define UNUSED_ARG(x)  ((void)x)
--- End diff --

..indent


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1024: Split schedule file to sanity and full tests for...

2016-11-30 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1024
  
@ictmalili I separate the positive cases into sanity schedule for hawq 
register. Other cases should be separated further.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1024: Split schedule file to sanity and full tests for...

2016-11-26 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1024
  
also cc @radarwave 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1028: [HAWQ-1172][LIBHDFS3]. Fix typo of LIBUUI...

2016-11-26 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/1028

[HAWQ-1172][LIBHDFS3]. Fix typo of LIBUUID_INCLUDE_DIRS in 
FindLibUUID.cmake.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1172

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/1028.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1028


commit af2db4552108ad3fb55392d1d66e686c8b373107
Author: xunzhang <xunzhang...@gmail.com>
Date:   2016-11-26T17:44:52Z

[HAWQ-1172][LIBHDFS3]. Fix typo of LIBUUID_INCLUDE_DIRS in 
FindLibUUID.cmake.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1024: Split schedule file to sanity and full tests for...

2016-11-22 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1024
  
also cc @wengyanqing 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1024: Split schedule file to sanity and full tests for...

2016-11-22 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1024
  
cc @liming01 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1020: HAWQ-1167. Fix parquet format estimate column wi...

2016-11-21 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1020
  
cc @ictmalili @linwen 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1020: HAWQ-1167. Fix parquet format estimate co...

2016-11-21 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/1020

HAWQ-1167. Fix parquet format estimate column width for bpchar type.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1167

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/1020.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1020


commit 68570a7205ea8979dcc1e1c211cb2df3ba4a8f22
Author: xunzhang <xunzhang...@gmail.com>
Date:   2016-11-22T03:13:22Z

HAWQ-1167. Fix parquet format estimate column width for bpchar type.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1007: HAWQ-1148. Update gtest-parallel to make sure te...

2016-11-14 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1007
  
Please close this pull request after merge. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87323234
  
--- Diff: src/test/feature/gtest-parallel ---
@@ -234,6 +234,71 @@ class TestTimes(object):
 except IOError:
   pass  # ignore errors---saving the times isn't that important
 
+
+def get_schedule(schedule_file):
+  "read schedule file from --gtest_schedule option"
+  try:
+file = open(schedule_file, 'r')
+  except (EOFError, IOError):
+sys.exit("Read file error")
+  
+  filter_test = []
+  ptest = []
+  stest = []
+
+  for line in file.readlines():
+if not line.strip():
+  continue
+if line[0] == '#':
+  continue
+
+testline = line.split('=')
+if len(testline) != 2 or (not testline[1].strip()):
+  sys.exit("format error in schedule file")
+
+(key, value) = testline
+if key == "PARALLEL":
+  ptest.append(value) 
+elif key == "SERIAL":
+  stest.append(value)
+else:
+  sys.exit("format error in schedule file")
+
+  filter_test = ptest + stest  
+  file.close()
+  return len(ptest), filter_test
+
+
+def do_gtest_filter(list_command, command, op_filter):
+"get tests by --gtest_filter and --gtest_list_tests"
+list_command += ['--gtest_filter=' + op_filter]
+try:
+  test_list = subprocess.Popen(list_command + ['--gtest_list_tests'],
+ stdout=subprocess.PIPE).communicate()[0]
+except OSError as e:
+  sys.exit("%s: %s" % (test_binary, str(e)))
+
+command += additional_args
+tests = []
+test_group = ''
+for line in test_list.split('\n'):
+  if not line.strip():
--- End diff --

If you use `test_list.split()`, it will handle this case. For example, 
`'a\n\nc\n'.split()` will return `['a', 'c']`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87318413
  
--- Diff: src/test/feature/gtest-parallel ---
@@ -234,6 +234,71 @@ class TestTimes(object):
 except IOError:
   pass  # ignore errors---saving the times isn't that important
 
+
+def get_schedule(schedule_file):
+  "read schedule file from --gtest_schedule option"
+  try:
+file = open(schedule_file, 'r')
+  except (EOFError, IOError):
+sys.exit("Read file error")
+  
+  filter_test = []
+  ptest = []
+  stest = []
+
+  for line in file.readlines():
--- End diff --

Actually I do not like the for-loop her because I think it is a little 
tricky. If you need a key-value dict information, could we change the file with 
json format?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87317799
  
--- Diff: src/test/feature/gtest-parallel ---
@@ -234,6 +234,71 @@ class TestTimes(object):
 except IOError:
   pass  # ignore errors---saving the times isn't that important
 
+
+def get_schedule(schedule_file):
+  "read schedule file from --gtest_schedule option"
+  try:
+file = open(schedule_file, 'r')
+  except (EOFError, IOError):
+sys.exit("Read file error")
+  
+  filter_test = []
+  ptest = []
+  stest = []
--- End diff --

`filter_test, ptest, stest = [], [], []` is better in Python.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87318797
  
--- Diff: src/test/feature/gtest-parallel ---
@@ -285,41 +354,42 @@ else:
 save_file = os.path.join(os.path.expanduser("~"), ".gtest-parallel-times")
 times = TestTimes(save_file)
 tests = []
+#pull all the tests into test_map dict, in order to mark the failed test 
in FAILED log 
+test_map = {} 
+# mark the end of paralell test id by parallel_id
+parallel_id = 0
+
 for test_binary in binaries:
   command = [test_binary]
   if options.gtest_also_run_disabled_tests:
 command += ['--gtest_also_run_disabled_tests']
-
   list_command = list(command)
+  
+  if options.gtest_schedule != '' and options.gtest_filter != '':
+sys.exit("Option input failure : gtest_schedule and gtest_filter can 
not use in the same time: \n")
+
+  if options.gtest_schedule != '':
--- End diff --

`if options.gtest_schedule `


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87317655
  
--- Diff: src/test/feature/gtest-parallel ---
@@ -170,7 +170,7 @@ class FilterFormat:
   self.out.permanent_line("FAILED TESTS (%d/%d):"
   % (len(self.failures), self.total_tests))
   for (binary, test) in self.failures:
-self.out.permanent_line(" " + binary + ": " + test)
+self.out.permanent_line(" " + binary + ": " + test + " [" + 
test_map[test] + "]")
--- End diff --

I suggest you to use format string for readability and correctness. For 
example, use `" %s: %s [ %s ]" % (binary, test, test_map[test])` here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87318783
  
--- Diff: src/test/feature/gtest-parallel ---
@@ -285,41 +354,42 @@ else:
 save_file = os.path.join(os.path.expanduser("~"), ".gtest-parallel-times")
 times = TestTimes(save_file)
 tests = []
+#pull all the tests into test_map dict, in order to mark the failed test 
in FAILED log 
+test_map = {} 
+# mark the end of paralell test id by parallel_id
+parallel_id = 0
+
 for test_binary in binaries:
   command = [test_binary]
   if options.gtest_also_run_disabled_tests:
 command += ['--gtest_also_run_disabled_tests']
-
   list_command = list(command)
+  
+  if options.gtest_schedule != '' and options.gtest_filter != '':
--- End diff --

`if options.gtest_schedule  and options.gtest_filter:`


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87317889
  
--- Diff: src/test/feature/gtest-parallel ---
@@ -234,6 +234,71 @@ class TestTimes(object):
 except IOError:
   pass  # ignore errors---saving the times isn't that important
 
+
+def get_schedule(schedule_file):
+  "read schedule file from --gtest_schedule option"
+  try:
+file = open(schedule_file, 'r')
--- End diff --

Do not use default keyword `file`, it is risky.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87318874
  
--- Diff: src/test/feature/gtest-parallel ---
@@ -285,41 +354,42 @@ else:
 save_file = os.path.join(os.path.expanduser("~"), ".gtest-parallel-times")
 times = TestTimes(save_file)
 tests = []
+#pull all the tests into test_map dict, in order to mark the failed test 
in FAILED log 
+test_map = {} 
+# mark the end of paralell test id by parallel_id
+parallel_id = 0
+
 for test_binary in binaries:
   command = [test_binary]
   if options.gtest_also_run_disabled_tests:
 command += ['--gtest_also_run_disabled_tests']
-
   list_command = list(command)
+  
+  if options.gtest_schedule != '' and options.gtest_filter != '':
+sys.exit("Option input failure : gtest_schedule and gtest_filter can 
not use in the same time: \n")
+
+  if options.gtest_schedule != '':
+(pcount, filter_test) = get_schedule(options.gtest_schedule)
+for i in range(0, len(filter_test)):
--- End diff --

It is like C-style, not pythonic. Use enumerate instead to make the code 
simple. You can implement this logic using less than 10 lines of code.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87318672
  
--- Diff: src/test/feature/gtest-parallel ---
@@ -234,6 +234,71 @@ class TestTimes(object):
 except IOError:
   pass  # ignore errors---saving the times isn't that important
 
+
+def get_schedule(schedule_file):
+  "read schedule file from --gtest_schedule option"
+  try:
+file = open(schedule_file, 'r')
+  except (EOFError, IOError):
+sys.exit("Read file error")
+  
+  filter_test = []
+  ptest = []
+  stest = []
+
+  for line in file.readlines():
+if not line.strip():
+  continue
+if line[0] == '#':
+  continue
+
+testline = line.split('=')
+if len(testline) != 2 or (not testline[1].strip()):
+  sys.exit("format error in schedule file")
+
+(key, value) = testline
+if key == "PARALLEL":
+  ptest.append(value) 
+elif key == "SERIAL":
+  stest.append(value)
+else:
+  sys.exit("format error in schedule file")
+
+  filter_test = ptest + stest  
+  file.close()
+  return len(ptest), filter_test
+
+
+def do_gtest_filter(list_command, command, op_filter):
+"get tests by --gtest_filter and --gtest_list_tests"
+list_command += ['--gtest_filter=' + op_filter]
+try:
+  test_list = subprocess.Popen(list_command + ['--gtest_list_tests'],
+ stdout=subprocess.PIPE).communicate()[0]
+except OSError as e:
+  sys.exit("%s: %s" % (test_binary, str(e)))
+
+command += additional_args
+tests = []
+test_group = ''
+for line in test_list.split('\n'):
+  if not line.strip():
--- End diff --

What is the meaning of this line?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87318470
  
--- Diff: src/test/feature/gtest-parallel ---
@@ -234,6 +234,71 @@ class TestTimes(object):
 except IOError:
   pass  # ignore errors---saving the times isn't that important
 
+
+def get_schedule(schedule_file):
+  "read schedule file from --gtest_schedule option"
+  try:
+file = open(schedule_file, 'r')
+  except (EOFError, IOError):
+sys.exit("Read file error")
+  
+  filter_test = []
+  ptest = []
+  stest = []
+
+  for line in file.readlines():
--- End diff --

I do not understand, is it just one line of total file content here?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #1007: HAWQ-1148. Update gtest-parallel to make ...

2016-11-09 Thread xunzhang
Github user xunzhang commented on a diff in the pull request:

https://github.com/apache/incubator-hawq/pull/1007#discussion_r87318201
  
--- Diff: src/test/feature/schedule.txt ---
@@ -0,0 +1,6 @@
+#PARALLEL=* are the parallel tests to run, optional but should not be empty
+#SERIAL=* are the serial tests to run, optional but should not be empty
+#you can have several PARALLEL or SRRIAL
+

+PARALLEL=TestErrorTable.*:TestExternalTable.*:TestPreparedStatement.*:TestUDF.*:TestAOSnappy.*:TestAlterOwner.*:TestAlterTable.*:TestCreateTable.*:TestGuc.*:TestType.*:TestDatabase.*:TestParquet.*:TestPartition.*:TestSubplan.*:TestAggregate.*:TestCreateTypeComposite.*:TestGpDistRandom.*:TestInformationSchema.*:TestQueryInsert.*:TestQueryNestedCaseNull.*:TestQueryPolymorphism.*:TestQueryPortal.*:TestQueryPrepare.*:TestRowTypes.*:TestQuerySequence.*:TestCommonLib.*:TestToast.*:TestTransaction.*:TestCommand.*:TestCopy.*:TestExternalTable.TestExternalTableAll
--- End diff --

Should we add some checks in the python script above to ensure the valid 
input schedule?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #1006: HAWQ-1150. Fix Travis build issue (brona/iproute...

2016-11-09 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/1006
  
+1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #999: HAWQ-1140. Parallelize test cases for hawqregiste...

2016-11-03 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/999
  
Merged.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #999: HAWQ-1140. Parallelize test cases for hawq...

2016-11-03 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/999


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #999: HAWQ-1140. Parallelize test cases for hawqregiste...

2016-11-03 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/999
  
cc @ictmalili @amyrazz44 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #992: HAWQ-1133. Replace print with logger outpu...

2016-11-02 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/992


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #992: HAWQ-1133. Replace print with logger output in ha...

2016-11-02 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/992
  
Merged into master, thanks @linwen 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #999: HAWQ-1140. Parallelize test cases for hawq...

2016-11-02 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/999

HAWQ-1140. Parallelize test cases for hawqregister usage1.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1140

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/999.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #999


commit beb965533db31a6d46df5a4ba53267bc904482f2
Author: xunzhang <xunzhang...@gmail.com>
Date:   2016-11-02T10:51:38Z

HAWQ-1140. Parallelize test cases for hawqregister usage1.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #998: HAWQ-1128. Bugfix for HAWQ-1128 test code.

2016-11-02 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/998
  
Merged.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #998: HAWQ-1128. Bugfix for HAWQ-1128 test code.

2016-11-02 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/998
  
cc @linwen @stanlyxiang 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #998: HAWQ-1128. Bugfix for HAWQ-1128 test code.

2016-11-02 Thread xunzhang
GitHub user xunzhang opened a pull request:

https://github.com/apache/incubator-hawq/pull/998

HAWQ-1128. Bugfix for HAWQ-1128 test code.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/xunzhang/incubator-hawq HAWQ-1128

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-hawq/pull/998.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #998


commit e78b3acf9bc21b58cc142fa7b0f2a076e8c726be
Author: xunzhang <xunzhang...@gmail.com>
Date:   2016-11-02T09:45:41Z

HAWQ-1128. Bugfix for HAWQ-1128 test code.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #992: HAWQ-1133. Replace print with logger output in ha...

2016-11-01 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/992
  
also cc @liming01 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq pull request #990: HAWQ-1128. Support HAWQ register tables wi...

2016-11-01 Thread xunzhang
Github user xunzhang closed the pull request at:

https://github.com/apache/incubator-hawq/pull/990


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #990: HAWQ-1128. Support HAWQ register tables with same...

2016-11-01 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/990
  
Merged, thanks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] incubator-hawq issue #994: HAWQ-1135. MADlib: Raising exception leads to dat...

2016-11-01 Thread xunzhang
Github user xunzhang commented on the issue:

https://github.com/apache/incubator-hawq/pull/994
  
🍻 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


  1   2   3   4   5   >