[ 
https://issues.apache.org/jira/browse/HAWQ-257?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shivram Mani updated HAWQ-257:
------------------------------
    Description: 
I should be able to configure which port PXF service is listening to and input 
the same value in DDL to create tables
{code}
CREATE EXTERNAL TABLE ext_table <attr list, ...>
LOCATION('pxf://<host>:<port>/path/to/data?...
{code}

*Background information*
The reason that PXF currently ignores the port value in the DDL is due to 
legacy issues: 1) user can only configure this port that PXF service listens to 
through GUC (pxf_service_port), which was a hidden secret. 2) For HA 
consideration, when you don't put port in the URI, we use 51200 to connect to 
the pxf service. 

*Acceptance Criteria*
1) If users put a port in URL, pxf should use that port to initiate connection 
and error out if it cannot connect (pxf port GUC will not be used)
2) If users don't have port in URL, we assume it's HA scenario and connect to 
name service via default port : 51200.
3) Users can still modify the GUC to change the default value, but this is only 
for HA name service scenario.

*Source Code*
The current logic is located at: [pxfuriparser.c | 
https://github.com/apache/incubator-hawq/blob/7be5148934994df819ea53127c209a82eba40f40/src/backend/access/external/pxfuriparser.c],
 which replace user input port in the url with pxf_service_port

{code}
...
GPHDUri*
parseGPHDUri(const char *uri_str)
{
        GPHDUri *uri = (GPHDUri *)palloc0(sizeof(GPHDUri));
        char    *cursor;

        uri->uri = GPHDUri_dup_without_segwork(uri_str);
        cursor = uri->uri;

        GPHDUri_parse_segwork(uri, uri_str);
        GPHDUri_parse_protocol(uri, &cursor);
        GPHDUri_parse_authority(uri, &cursor);
        GPHDUri_parse_data(uri, &cursor);
        GPHDUri_parse_options(uri, &cursor);

        port_to_str(&(uri->port), pxf_service_port);

        return uri;
}
...
{code}

  was:
I should be able to configure which port PXF service is listening to and input 
the same value in DDL to create tables
{code}
CREATE EXTERNAL TABLE ext_table <attr list, ...>
LOCATION('pxf://<host>:<port>/path/to/data?...
{code}

*Background information*
The reason that PXF currently ignores the port value in the DDL is due to 
legacy issues: 1) user can only configure this port that PXF service listens to 
through GUC (pxf_service_port), which was a hidden secret. 2) For HA 
consideration, when you don't put port in the URI, we use 51200 to connect to 
the pxf service. 

*Acceptance Criteria*
1) If users put a port in URL, pxf should use that port to initiate connection 
and error out if it cannot connect.
2) If users don't have port in URL, we assume it's HA scenario and connect to 
name service via default port : 51200.
3) Users can still modify the GUC to change the default value, but this is only 
for HA name service scenario.

*Source Code*
The current logic is located at: [pxfuriparser.c | 
https://github.com/apache/incubator-hawq/blob/7be5148934994df819ea53127c209a82eba40f40/src/backend/access/external/pxfuriparser.c],
 which replace user input port in the url with pxf_service_port

{code}
...
GPHDUri*
parseGPHDUri(const char *uri_str)
{
        GPHDUri *uri = (GPHDUri *)palloc0(sizeof(GPHDUri));
        char    *cursor;

        uri->uri = GPHDUri_dup_without_segwork(uri_str);
        cursor = uri->uri;

        GPHDUri_parse_segwork(uri, uri_str);
        GPHDUri_parse_protocol(uri, &cursor);
        GPHDUri_parse_authority(uri, &cursor);
        GPHDUri_parse_data(uri, &cursor);
        GPHDUri_parse_options(uri, &cursor);

        port_to_str(&(uri->port), pxf_service_port);

        return uri;
}
...
{code}


> PXF to honor user defined port in location URL
> ----------------------------------------------
>
>                 Key: HAWQ-257
>                 URL: https://issues.apache.org/jira/browse/HAWQ-257
>             Project: Apache HAWQ
>          Issue Type: Improvement
>          Components: PXF
>            Reporter: Goden Yao
>            Assignee: Noa Horn
>
> I should be able to configure which port PXF service is listening to and 
> input the same value in DDL to create tables
> {code}
> CREATE EXTERNAL TABLE ext_table <attr list, ...>
> LOCATION('pxf://<host>:<port>/path/to/data?...
> {code}
> *Background information*
> The reason that PXF currently ignores the port value in the DDL is due to 
> legacy issues: 1) user can only configure this port that PXF service listens 
> to through GUC (pxf_service_port), which was a hidden secret. 2) For HA 
> consideration, when you don't put port in the URI, we use 51200 to connect to 
> the pxf service. 
> *Acceptance Criteria*
> 1) If users put a port in URL, pxf should use that port to initiate 
> connection and error out if it cannot connect (pxf port GUC will not be used)
> 2) If users don't have port in URL, we assume it's HA scenario and connect to 
> name service via default port : 51200.
> 3) Users can still modify the GUC to change the default value, but this is 
> only for HA name service scenario.
> *Source Code*
> The current logic is located at: [pxfuriparser.c | 
> https://github.com/apache/incubator-hawq/blob/7be5148934994df819ea53127c209a82eba40f40/src/backend/access/external/pxfuriparser.c],
>  which replace user input port in the url with pxf_service_port
> {code}
> ...
> GPHDUri*
> parseGPHDUri(const char *uri_str)
> {
>       GPHDUri *uri = (GPHDUri *)palloc0(sizeof(GPHDUri));
>       char    *cursor;
>       uri->uri = GPHDUri_dup_without_segwork(uri_str);
>       cursor = uri->uri;
>       GPHDUri_parse_segwork(uri, uri_str);
>       GPHDUri_parse_protocol(uri, &cursor);
>       GPHDUri_parse_authority(uri, &cursor);
>       GPHDUri_parse_data(uri, &cursor);
>       GPHDUri_parse_options(uri, &cursor);
>       port_to_str(&(uri->port), pxf_service_port);
>       return uri;
> }
> ...
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to