You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hawq.apache.org by zhangh43 <gi...@git.apache.org> on 2015/12/30 08:50:49 UTC

[GitHub] incubator-hawq pull request: HAWQ-293. Enable writable external ta...

GitHub user zhangh43 opened a pull request:

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

    HAWQ-293. Enable writable external table to support on number syntax.

    writable external table is used for export data in hawq to others.
    In hawq1.x default is on all, which is deprecated in hawq2.x
    we support this feature by using on number instread of on all.


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

    $ git pull https://github.com/zhangh43/incubator-hawq hawq293

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

    https://github.com/apache/incubator-hawq/pull/229.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 #229
    
----
commit dbde72018993960a0872de0281642493a4ee65ee
Author: hubertzhang <hz...@pivotal.io>
Date:   2015-12-30T07:46:31Z

    HAWQ-293. Enable writable external table to support on number syntax.

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-293. Enable writable external ta...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-293. Enable writable external ta...

Posted by jianlirong <gi...@git.apache.org>.
Github user jianlirong commented on the pull request:

    https://github.com/apache/incubator-hawq/pull/229#issuecomment-167960472
  
    +1, 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-293. Enable writable external ta...

Posted by yaoj2 <gi...@git.apache.org>.
Github user yaoj2 commented on the pull request:

    https://github.com/apache/incubator-hawq/pull/229#issuecomment-167957578
  
    +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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-293. Enable writable external ta...

Posted by zhangh43 <gi...@git.apache.org>.
Github user zhangh43 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/229#discussion_r48809821
  
    --- Diff: src/backend/commands/tablecmds.c ---
    @@ -17666,6 +17666,12 @@ static Datum transformExecOnClause(List	*on_clause, int *preferred_segment_num)
     		}
     		else if (strcmp(defel->defname, "master") == 0)
     		{
    +			if(iswritable){
    +			  ereport(ERROR,
    +	 	      (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
    +			    errmsg("the ON master syntax for writable external tables is deprecated"),
    --- End diff --
    
    Only ON number is allowed, e.g. ON 3 will start 3 virtual segments to run the query.
    
    Here's an example to create a writable external table in Hawq 2.0:
    postgres=# create table a (i int);
    CREATE TABLE
    postgres=# insert into a values(1);
    INSERT 0 1
    postgres=# insert into a values(2);
    INSERT 0 1
    postgres=# insert into a values(10);
    INSERT 0 1
    postgres=# CREATE WRITABLE EXTERNAL WEB TABLE externala (output text)         EXECUTE 'cat > /tmp/externala' on 3 FORMAT 'TEXT'   DISTRIBUTED RANDOMLY;
    CREATE EXTERNAL TABLE
    postgres=# insert into externala select * from a;
    INSERT 0 3
    
    You can check the result file in /tmp/externala:
    1
    2
    10


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-293. Enable writable external ta...

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/229#discussion_r48811850
  
    --- Diff: src/backend/commands/tablecmds.c ---
    @@ -17666,6 +17666,12 @@ static Datum transformExecOnClause(List	*on_clause, int *preferred_segment_num)
     		}
     		else if (strcmp(defel->defname, "master") == 0)
     		{
    +			if(iswritable){
    +			  ereport(ERROR,
    +	 	      (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
    +			    errmsg("the ON master syntax for writable external tables is deprecated"),
    --- End diff --
    
    Thank you for the clarification. I meant an errhint() in the ereport message.
    Something like
       ereport(ERROR,
    	 	      (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
    			    errmsg("the ON master syntax for writable external tables is deprecated"),
                                errhint("Only ON number is allowed, where number is the number of segments"),
    		      errOmitLocation(true)));


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] incubator-hawq pull request: HAWQ-293. Enable writable external ta...

Posted by hornn <gi...@git.apache.org>.
Github user hornn commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/229#discussion_r48615693
  
    --- Diff: src/backend/commands/tablecmds.c ---
    @@ -17666,6 +17666,12 @@ static Datum transformExecOnClause(List	*on_clause, int *preferred_segment_num)
     		}
     		else if (strcmp(defel->defname, "master") == 0)
     		{
    +			if(iswritable){
    +			  ereport(ERROR,
    +	 	      (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
    +			    errmsg("the ON master syntax for writable external tables is deprecated"),
    --- End diff --
    
    would it be possible to add a hint saying what is the allowed option (ON number)?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---