fanfuxiaoran commented on issue #1072:
URL: https://github.com/apache/cloudberry/issues/1072#issuecomment-2833371140
Have dived into this bug, the below is my found:
- when using postgres planner, the error wouldn't happen. It's the orca's
bug.
- Only when the filter is false, it fails. The plan generated by orca is as
below:
```
(char *) 0x0000000158008850 "{RESULT :startup_cost 0.00 :total_cost 0.00
:plan_rows 0 :plan_width 12 :parallel_aware false :parallel_safe false
:plan_node_id 0 :targetlist ({TARGETENTRY :expr {VAR :varno 65001 :varattno 1
:vartype 1700 :vartypmod 2490376 :varcollid 0 :varlevelsup 0 :varnoold 65001
:varoattno 1 :location -1} :resno 1 :resname a :ressortgroupref 0 :resorigtbl 0
:resorigcol 0 :resjunk false} {TARGETENTRY :expr {VAR :varno 65001 :varattno 2
:vartype 23 :vartypmod -1 :varcollid 0 :varlevelsup 0 :varnoold 65001
:varoattno 2 :location -1} :resno 2 :resname b :ressortgroupref 0 :resorigtbl 0
:resorigcol 0 :resjunk false}) :qual <> :lefttree {RESULT :startup_cost 0.00
:total_cost 0.00 :plan_rows 0 :plan_width 12 :parallel_aware false
:parallel_safe false :plan_node_id 1 :targetlist ({TARGETENTRY :expr {CONST
:consttype 1700 :consttypmod -1 :constcollid 0 :constlen -1 :constbyval false
:constisnull true :location 0 :constvalue <>} :resno 1 :resname a
:ressortgroupref 0 :res
origtbl 0 :resorigcol 0 :resjunk false} {TARGETENTRY :expr {CONST :consttype
23 :consttypmod -1 :constcollid 0 :constlen 4 :constbyval true :constisnull
true :location 0 :constvalue <>} :resno 2 :resname b :ressortgroupref 0
:resorigtbl 0 :resorigcol 0 :resjunk false} {TARGETENTRY :expr {CONST
:consttype 27 :consttypmod -1 :constcollid 0 :constlen 6 :constbyval false
:constisnull true :location 0 :constvalue <>} :resno 3 :resname ctid
:ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false} {TARGETENTRY
:expr {CONST :consttype 28 :consttypmod -1 :constcollid 0 :constlen 4
:constbyval true :constisnull true :location 0 :constvalue <>} :resno 4
:resname xmin :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false}
{TARGETENTRY :expr {CONST :consttype 29 :consttypmod -1 :constcollid 0
:constlen 4 :constbyval true :constisnull true :location 0 :constvalue <>}
:resno 5 :resname cmin :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk
false} {TARGETENTRY :expr {CONST :cons
ttype 28 :consttypmod -1 :constcollid 0 :constlen 4 :constbyval true
:constisnull true :location 0 :constvalue <>} :resno 6 :resname xmax
:ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false} {TARGETENTRY
:expr {CONST :consttype 29 :consttypmod -1 :constcollid 0 :constlen 4
:constbyval true :constisnull true :location 0 :constvalue <>} :resno 7
:resname cmax :ressortgroupref 0 :resorigtbl 0 :resorigcol 0 :resjunk false}
{TARGETENTRY :expr {CONST :consttype 26 :consttypmod -1 :constcollid 0
:constlen 4 :constbyval true :constisnull true :location 0 :constvalue <>}
:resno 8 :resname tableoid :ressortgroupref 0 :resorigtbl 0 :resorigcol 0
:resjunk false} {TARGETENTRY :expr {CONST :consttype 23 :consttypmod -1
:constcollid 0 :constlen 4 :constbyval true :constisnull true :location 0
:constvalue <>} :resno 9 :resname gp_segment_id :ressortgroupref 0 :resorigtbl
0 :resorigcol 0 :resjunk false}) :qual <> :lefttree <> :righttree <> :initPlan
<> :extParam (b) :allParam (b) :flow <>
:operatorMemKB 0 :resconstantqual ({CONST :consttype 16 :consttypmod -1
:constcollid 0 :constlen 1 :constbyval true :constisnull false :location 0
:constvalue 1 [ 0 0 0 0 0 0 0 0 ]}) :numHashFilterCols 0 :hashFilterColIdx
:hashFilterFuncs } :righttree <> :initPlan <> :extParam (b) :allParam (b) :flow
<> :operatorMemKB 0 :resconstantqual <> :numHashFilterCols 0 :hashFilterColIdx
:hashFilterFuncs }"
```
In the function `CTranslatorExprToDXL::PdxlnResultFromConstTableGet`, orca
translates the plan into dxl. We can see that the resorigtbl lost in the above
plan.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]