-
Notifications
You must be signed in to change notification settings - Fork 71
Support CTE/JOIN usage for PIVOT operator #299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support CTE/JOIN usage for PIVOT operator #299
Conversation
42050d7
to
4497316
Compare
96d91da
to
14cae9f
Compare
14cae9f
to
359ad18
Compare
983a0a0
to
3a02cde
Compare
This commit fixed an issue that view cannot be created or used by stmt with pivot operator. Task: BABEL-4673 Signed-off-by: Yanjie Xu <[email protected]>
Modified internal PIVOT information analyzer -> executor passing design. Supported CTE/VIEW/JOIN as well as function/procedure for PIVOT operator. Task: BABEL-4713, BABEL-4714, BABEL-4673 Signed-off-by: Yanjie Xu <[email protected]>
Disable CREATE VIEW ON stmt with PIVOT operator due to pg_dump cannot dump pivot view with correct dependency and newly added fields in FuncExpr casued readFunc failed to parse previous minor version string parsetree during select from view after mVU. Task: BABEL-4673 Signed-off-by: Yanjie Xu <[email protected]>
Removed newly added pivot fields in fcinfo and set the fcinfo->context to pivot data when the FuncExpr is a bbf_pivot function Task: BABEL-4673 Signed-off-by: Yanjie Xu <[email protected]>
3a02cde
to
3fd80cb
Compare
src/include/fmgr.h
Outdated
@@ -18,6 +18,7 @@ | |||
#ifndef FMGR_H | |||
#define FMGR_H | |||
|
|||
#include "nodes/pg_list.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmgr.h
is a header file used by execSRF.c
. And List
hasn't been used in execSRF.c
until we added our pivot logic. So we need to include this to fmgr.h
357858f
to
3fd80cb
Compare
Replaced pivot related fields with generic Node * field in FuncCall and FuncExpr Task: BABEL-4713, BABEL-4714 Signed-off-by: Yanjie Xu <[email protected]>
Move executor pivot data passing code to Babelfish hook function. Task: BABEL-4713, BABEL-4714 Signed-off-by: Yanjie Xu <[email protected]>
4295eb2
into
babelfish-for-postgresql:BABEL_4_X_DEV__PG_16_X
…resql#299) This commit fixed an issue that CTE and JOIN cannot be used with pivot operator. We added 1 field (Node *context) in FuncExpr Struct to store pivot additional information. FuncExpr will carry the pivot information to ExecMakeTableFunctionResult. In this function, we pass the pivot information into two newly added FunctionCallInfo that we can retrieve at bbf_pivot function. Task: BABEL-4713, BABEL-4714, BABEL-4795 Signed-off-by: Yanjie Xu <[email protected]>
…resql#299) This commit fixed an issue that CTE and JOIN cannot be used with pivot operator. We added 1 field (Node *context) in FuncExpr Struct to store pivot additional information. FuncExpr will carry the pivot information to ExecMakeTableFunctionResult. In this function, we pass the pivot information into two newly added FunctionCallInfo that we can retrieve at bbf_pivot function. Task: BABEL-4713, BABEL-4714, BABEL-4795 Signed-off-by: Yanjie Xu <[email protected]>
…resql#299) This commit fixed an issue that CTE and JOIN cannot be used with pivot operator. We added 1 field (Node *context) in FuncExpr Struct to store pivot additional information. FuncExpr will carry the pivot information to ExecMakeTableFunctionResult. In this function, we pass the pivot information into two newly added FunctionCallInfo that we can retrieve at bbf_pivot function. Task: BABEL-4713, BABEL-4714, BABEL-4795 Signed-off-by: Yanjie Xu <[email protected]>
Description
This commit fixed an issue that CTE and JOIN cannot be used with pivot operator.
We added 1 field (
Node *context
) in FuncExpr Struct to store pivot additional information. FuncExpr will carry the pivot information to ExecMakeTableFunctionResult. In this function, we pass the pivot information into two newly added FunctionCallInfo that we can retrieve at bbf_pivot function.Issues Resolved
Task: BABEL-4713, BABEL-4714, BABEL-4795
Check List
By submitting this pull request, I confirm that my contribution is under the terms of the PostgreSQL license, and grant any person obtaining a copy of the contribution permission to relicense all or a portion of my contribution to the PostgreSQL License solely to contribute all or a portion of my contribution to the PostgreSQL open source project.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.