-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
[YSQL] ERROR: invalid attnum ... on query with array_agg(json_build_object()) #22533
Comments
Potential duplicate of #13117 ? |
Issue goes away when @andrei-mart It seems like Postgres when deparsing the index qual, it deparses the |
Summary: The referenced IndexScan's indextlist wasn't fixed, so in the cases where IndexScan was in a subquery the Vars in that list pointed to incorrect RTE after RTEs from the subplan's root were moved to the common RTE list. Postgres does not use the indextlist, because all vars in the original expression lists refer to the main table. It was changed in YB, when expression pushdown support was added to the IndexScan. The pushdown expressions associated with the index, should refer to the index relation instead, and that kind of fix was done. But indextlist was forgotten, and this list is needed when EXPLAIN looks up the main table columns for Vars in the Storage Index List. Also code was refactored to avoid fixing references unnecessarily if index pushdown is not present. Jira: DB-11462 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscSerial' Reviewers: tnayak Reviewed By: tnayak Subscribers: yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D37487
Problem is only with EXPLAIN, the query is executed correctly. |
Summary: 0c5102e [doc][yba] xCluster Replication update (#23417) Excluded: a9466df [#22325] YSQL, QueryDiagnostics: Adding a catalog view for queryDiagnostics b9597b3 [#23612] YSQL: Fix java unit test misuse of == for string comparison bb72624 [#23613] DocDB: Framework for different vector index coordinate types, SIFT 1B hnsw_tool support 12032f3 [PLAT-12510] Add option to use UTC for cron expression backup schedule time calculation Excluded: 141703a [#22533] YSQL: fix setrefs for index scan 1bb8c62 [#23543] docdb: Update tablegroup manager in RepartitionTable 1e28b8a [#23518] Do not include full snapshot info for list snapshot schedules RPC. e98c383 [PLAT-15048] Fix auto-master failover local test f606132 [doc][yba] Backup clarification (#23611) e80d60f [PLAT-14973] Precheck for node agent install to verify that we have correct permissions to execute in the installer directory 5230f5a [#23630]yugabyted: Modiying the APIs required for the new Migrate Schema Page. 0a310d3 [PLAT-15042] Add default pitr retention period aa15c81 [PLAT-12435] Adding a precheck for libselinux bindings for system python3 525672e [#23632] DocDB: Unify GetFlagInfos and remove duplicate code 4ab5ca0 [#23601] YSQL: Fix TestPreparedStatements tests with connection manager enabled 57a7690 [PLAT-12222][PLAT-15036][PLAT-14333] Add connection pooling support for create universe API 3407682 [PLAT-10119]: Do not allow back-tick for DB password in YBA Test Plan: Jenkins: rebase: pg15-cherrypicks Reviewers: jason, tfoucher Differential Revision: https://phorge.dev.yugabyte.com/D37578
Summary: Original commit: 141703a / D37487 - setrefs.c - set_plan_refs - The functions fix_upper_expr, fix_scan_list used in the modified code take additional parameter num_exec in pg15. The referenced IndexScan's indextlist wasn't fixed, so in the cases where IndexScan was in a subquery the Vars in that list pointed to incorrect RTE after RTEs from the subplan's root were moved to the common RTE list. Postgres does not use the indextlist, because all vars in the original expression lists refer to the main table. It was changed in YB, when expression pushdown support was added to the IndexScan. The pushdown expressions associated with the index, should refer to the index relation instead, and that kind of fix was done. But indextlist was forgotten, and this list is needed when EXPLAIN looks up the main table columns for Vars in the Storage Index List. Also code was refactored to avoid fixing references unnecessarily if index pushdown is not present. Jira: DB-11462 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscSerial' Reviewers: jason, tfoucher Reviewed By: jason Subscribers: yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D37583
Summary: Original commit: 141703a / D37487 The referenced IndexScan's indextlist wasn't fixed, so in the cases where IndexScan was in a subquery the Vars in that list pointed to incorrect RTE after RTEs from the subplan's root were moved to the common RTE list. Postgres does not use the indextlist, because all vars in the original expression lists refer to the main table. It was changed in YB, when expression pushdown support was added to the IndexScan. The pushdown expressions associated with the index, should refer to the index relation instead, and that kind of fix was done. But indextlist was forgotten, and this list is needed when EXPLAIN looks up the main table columns for Vars in the Storage Index List. Also code was refactored to avoid fixing references unnecessarily if index pushdown is not present. Jira: DB-11462 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscSerial' Reviewers: tnayak Reviewed By: tnayak Subscribers: yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D37592
Summary: Original commit: 141703a / D37487 The referenced IndexScan's indextlist wasn't fixed, so in the cases where IndexScan was in a subquery the Vars in that list pointed to incorrect RTE after RTEs from the subplan's root were moved to the common RTE list. Postgres does not use the indextlist, because all vars in the original expression lists refer to the main table. It was changed in YB, when expression pushdown support was added to the IndexScan. The pushdown expressions associated with the index, should refer to the index relation instead, and that kind of fix was done. But indextlist was forgotten, and this list is needed when EXPLAIN looks up the main table columns for Vars in the Storage Index List. Also code was refactored to avoid fixing references unnecessarily if index pushdown is not present. Jira: DB-11462 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscSerial' Reviewers: tnayak Reviewed By: tnayak Subscribers: yql Tags: #jenkins-ready Differential Revision: https://phorge.dev.yugabyte.com/D37602
Summary: The same issue and fix as was present in #22533 (fixed by D37487 / 141703a) that was required for Index Scans was also required for Bitmap Index Scans. I thought about pulling this common logic into a function that would handle both, but since the type of an `splan` is either an IndexScan or a YbBitmapIndexScan, and making it work for both seems like overcomplicating it. Jira: DB-12514 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscSerial' Reviewers: amartsinchyk Reviewed By: amartsinchyk Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D37630
…x Scan Summary: Original commit: 3bf9301 / D37630 * setrefs.c * set_plan_refs: case T_YbBitmapIndexScan * upstream PG's 41efb8340877e8ffd0023bb6b2ef22ffd1ca014d added a new parameter num_exec to fix_upper_expr * 3bf9301 / D37630 puts existing fix_upper_expr calls under an if statement and adds a new fix_scan_list call * Solution: add the new parameter to fix_upper_expr and fix_scan_list, keep the logical flow of D37630 The same issue and fix as was present in #22533 (fixed by D37487 / 141703a) that was required for Index Scans was also required for Bitmap Index Scans. I thought about pulling this common logic into a function that would handle both, but since the type of an `splan` is either an IndexScan or a YbBitmapIndexScan, and making it work for both seems like overcomplicating it. Jira: DB-12514 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscSerial' Reviewers: jason, tfoucher Reviewed By: jason Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D37945
Summary: Original commit: 3bf9301 / D37630 The same issue and fix as was present in #22533 (fixed by D37487 / 141703a) that was required for Index Scans was also required for Bitmap Index Scans. I thought about pulling this common logic into a function that would handle both, but since the type of an `splan` is either an IndexScan or a YbBitmapIndexScan, and making it work for both seems like overcomplicating it. Jira: DB-12514 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressMisc#testPgRegressMiscSerial' Reviewers: amartsinchyk Reviewed By: amartsinchyk Subscribers: yql Differential Revision: https://phorge.dev.yugabyte.com/D37937
Jira Link: DB-11462
Description
Setup
Query
Notes
A combination of factors seem to cause this:
Issue Type
kind/bug
Warning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: