-
Notifications
You must be signed in to change notification settings - Fork 132
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
fdw related commits cherry pick #885
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
There are some duplicated definitions, some exist since commit Initial Greenplum code dump. Remove that for clean codes. Authored-by: Zhang Mingli [email protected]
Authored-by: Zhang Mingli [email protected]
This commit can fix the bug reported in #16753 ### Error Without this commit, the last column name `time` and its name in FDW options `"time"` are different, shown as below, which leads to this error `column ""time"" of relation "test_quote_ext" does not exist`. ``` sql gpadmin=# \d test_quote_ext Foreign table "public.test_quote_ext" Column | Type | Collation | Nullable | Default | FDW options ---------+--------------------------+-----------+----------+---------+------------- id | bigint | | | | item | text | | | | price | integer | | | | segment | integer | | | | time | timestamp with time zone | | | | FDW options: (format 'csv', delimiter ',', "null" '', escape '"', quote '"', force_quote 'id,item,price,segment,"time"', location_uris 'gpfdist://@hostname@:7070/gpfdist2/test_quote.csv', execute_on 'ALL_SEGMENTS', log_errors 'disable', encoding 'UTF8', is_writable 'true') Distributed by: (id) ``` ### Analyse `quote_identifier()` will call `ScanKeywordLookup()`, which scans keywords in the file `kwlist.h`. Of course, `time` is a keyword, so becomes `"time"` after `quote_identifier()` in the function `list_join()`. Now, the same column has different names. So it will hit `if (attnum == InvalidAttrNumber)` and error out at function `CopyGetAttnums()` in `copy.c`. ### Solution The solution is simple, remove `quote_identifier()` in function `list_join()` to keep the column name with keywords unchanged. Big thanks to bug catchers: Wenkang Zhang <[email protected]> and Rui Wang <[email protected]> Signed-off-by: Yongtao Huang <[email protected]>
…tions (#14951) This commit is to fix issue #14892. Now using CREATE FOREIGN TABLE syntax, GPDB can create a gp_exttable_fdw foreign table with wrong options successfully, but can't access it. Even we can NOT alter/drop these failed tables. It is not reasonable. In this commit, - We add more permission checks for options of gp_exttable_fdw CREATE FOREIGN TABLE syntax. If missing some necessary options or using options with wrong format, we will report error while creating foreign tables. - We set default value for some missing options and remove related error report when getting external tables' information. (cherry picked from commit 66400e7e3e02a50a4e790b7dae13f23726ecd41b)
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.
Hi, @Mulily0513 welcome!🎊 Thanks for taking the effort to make our project better! 🙌 Keep making such awesome contributions!
Nice start! 🤙 |
reshke
approved these changes
Jan 22, 2025
fanfuxiaoran
approved these changes
Jan 22, 2025
Pushed, thanks. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #ISSUE_Number
What does this PR do?
Type of Change
Breaking Changes
Test Plan
make installcheck
make -C src/test installcheck-cbdb-parallel
Impact
Performance:
User-facing changes:
Dependencies:
Checklist
Additional Context
CI Skip Instructions