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

Goden Yao updated HAWQ-973:
---------------------------
    Description: 
"add_projection_desc_httpheader()" extracts the indices of columns to project 
from pi_varNumbers, but calculates the length based on pi_targetList. This is 
similar to how ExecVariableList handles projection. However there are cases 
(Insert ...) where length(pi_targetList) >0 and length(pi_varNumbers) == 0, 
this will cause sigsegv when we try to iterate columns from varNumbers. 

In HAWQ Native Table, see example below, it checks pi_isVarList to make sure 
the varNumbers are not null before passing projection filters:
https://github.com/apache/incubator-hawq/blob/7fef48058c3572f4c4454d1726d07eefdfe0558c/src/backend/executor/execQual.c
{code}
if (projInfo->pi_isVarList)
{
...
}
{code}

PXF external tables should adopt the same logic, so a condition on pi_varList 
needs to be added before invoking add_projection_desc_httpheader as is done in 
ExecProject.

  was:
"add_projection_desc_httpheader()" extracts the indices of columns to project 
from pi_varNumbers, but calculates the length based on pi_targetList. This is 
similar to how ExecVariableList handles projection. However there are cases 
(Insert ...) where length(pi_targetList) >0 and length(pi_varNumbers) == 0, 
this will cause sigsegv when we try to iterate columns from varNumbers. 

In HAWQ Native Table, see example below, it checks pi_isVarList to make sure 
the varNumbers are not null before passing projection filters:
https://github.com/apache/incubator-hawq/blob/7fef48058c3572f4c4454d1726d07eefdfe0558c/src/backend/executor/execQual.c
{code:c}
if (projInfo->pi_isVarList)
{
...
}
{code}

PXF external tables should adopt the same logic, so a condition on pi_varList 
needs to be added before invoking add_projection_desc_httpheader as is done in 
ExecProject.


> Check pi_varList in pxfheaders before setting headers
> -----------------------------------------------------
>
>                 Key: HAWQ-973
>                 URL: https://issues.apache.org/jira/browse/HAWQ-973
>             Project: Apache HAWQ
>          Issue Type: Bug
>          Components: PXF
>            Reporter: Kavinder Dhaliwal
>            Assignee: Kavinder Dhaliwal
>             Fix For: backlog
>
>
> "add_projection_desc_httpheader()" extracts the indices of columns to project 
> from pi_varNumbers, but calculates the length based on pi_targetList. This is 
> similar to how ExecVariableList handles projection. However there are cases 
> (Insert ...) where length(pi_targetList) >0 and length(pi_varNumbers) == 0, 
> this will cause sigsegv when we try to iterate columns from varNumbers. 
> In HAWQ Native Table, see example below, it checks pi_isVarList to make sure 
> the varNumbers are not null before passing projection filters:
> https://github.com/apache/incubator-hawq/blob/7fef48058c3572f4c4454d1726d07eefdfe0558c/src/backend/executor/execQual.c
> {code}
> if (projInfo->pi_isVarList)
> {
> ...
> }
> {code}
> PXF external tables should adopt the same logic, so a condition on pi_varList 
> needs to be added before invoking add_projection_desc_httpheader as is done 
> in ExecProject.



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

Reply via email to