You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "misi1987107 (via GitHub)" <gi...@apache.org> on 2026/04/24 06:51:50 UTC

[PR] [improve] support pg partitioned table [seatunnel]

misi1987107 opened a new pull request, #10814:
URL: https://github.com/apache/seatunnel/pull/10814

   <!--
   
   Thank you for contributing to SeaTunnel! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   ## Contribution Checklist
     - Make sure that the pull request corresponds to a [GITHUB issue](https://github.com/apache/seatunnel/issues).
     - Name the pull request in the form "[Feature] [component] Title of the pull request", where *Feature* can be replaced by `Hotfix`, `Bug`, etc.
     - Minor fixes should be named following this pattern: `[hotfix] [docs] Fix typo in README.md doc`.
   -->
   
   ### Purpose of this pull request
   
   relation https://github.com/apache/seatunnel/issues/10593
   
   
   ### Does this PR introduce _any_ user-facing change?
   
   <!--
   Note that it means *any* user-facing change including all aspects such as the documentation fix.
   If yes, please clarify the previous behavior and the change this PR proposes - provide the console output, description and/or an example to show the behavior difference if possible.
   If possible, please also clarify if this is a user-facing change compared to the released SeaTunnel versions or within the unreleased branches such as dev.
   If no, write 'No'.
   If you are adding/modifying connector documents, please follow our new specifications: https://github.com/apache/seatunnel/issues/4544.
   -->
   
   
   ### How was this patch tested?
   
   <!--
   If tests were added, say they were added here. Please make sure to add some test cases that check the changes thoroughly including negative and positive cases if possible.
   If it was tested in a way different from regular unit tests, please clarify how you tested step by step, ideally copy and paste-able, so that other reviewers can test and check, and descendants can verify in the future.
   If tests were not added, please describe why they were not added and/or why it was difficult to add.
   If you are adding E2E test cases, maybe refer to https://github.com/apache/seatunnel/blob/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/connector-cdc-mysql-e2e/src/test/resources/mysqlcdc_to_mysql.conf, here is a good example.
   -->
   
   
   ### Check list
   
   * [ ] If any new Jar binary package adding in your PR, please add License Notice according
     [New License Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/contribution/new-license.md)
   * [ ] If necessary, please update the documentation to describe the new feature. https://github.com/apache/seatunnel/tree/dev/docs
   * [ ] If necessary, please update `incompatible-changes.md` to describe the incompatibility caused by this PR.
   * [ ] If you are contributing the connector code, please check that the following files are updated:
     1. Update [plugin-mapping.properties](https://github.com/apache/seatunnel/blob/dev/plugin-mapping.properties) and add new connector information in it
     2. Update the pom file of [seatunnel-dist](https://github.com/apache/seatunnel/blob/dev/seatunnel-dist/pom.xml)
     3. Add ci label in [label-scope-conf](https://github.com/apache/seatunnel/blob/dev/.github/workflows/labeler/label-scope-conf.yml)
     4. Add e2e testcase in [seatunnel-e2e](https://github.com/apache/seatunnel/tree/dev/seatunnel-e2e/seatunnel-connector-v2-e2e/)
     5. Update connector [plugin_config](https://github.com/apache/seatunnel/blob/dev/config/plugin_config)


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve] support pg partitioned table [seatunnel]

Posted by "misi1987107 (via GitHub)" <gi...@apache.org>.
misi1987107 closed pull request #10814: [improve] support pg partitioned table
URL: https://github.com/apache/seatunnel/pull/10814


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve] support pg partitioned table [seatunnel]

Posted by "LeonYoah (via GitHub)" <gi...@apache.org>.
LeonYoah commented on PR #10814:
URL: https://github.com/apache/seatunnel/pull/10814#issuecomment-4766875445

   @misi1987107 Add some unit tests to merge


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve] support pg partitioned table [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #10814:
URL: https://github.com/apache/seatunnel/pull/10814#issuecomment-4767429256

   Thanks for the follow-up, @LeonYoah. I agree with the current gate here: on the unchanged head, the remaining gap is still the focused regression coverage for partitioned-table discovery / approximate row-count handling. There is no new code since my last full review, so I am not starting another full re-review yet. @misi1987107, once the test is added and pushed, please ping again and I will re-review the latest head promptly.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve] support pg partitioned table [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #10814:
URL: https://github.com/apache/seatunnel/pull/10814#issuecomment-4430360332

   Thanks for calling this out, @chl-wxp. I agree that a focused regression test for partitioned-table discovery / approximate row-count handling would make this PR much stronger.
   
   There is still no new code after the last head I reviewed, so I am not doing a full re-review in this round, but from my side this is the main follow-up I would suggest together with getting the Build check green. Once the author pushes an update, I am happy to review the latest head again.


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [improve] support pg partitioned table [seatunnel]

Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on PR #10814:
URL: https://github.com/apache/seatunnel/pull/10814#issuecomment-4317350952

   Hi @misi1987107, thanks for the PostgreSQL partitioned-table support improvement. I reviewed the current head locally from `seatunnel-review-10814` against `upstream/dev`.
   
   # What This PR Solves
   - User pain point: PostgreSQL partitioned parent tables were not included in table discovery, and the snapshot row-count estimation only looked at regular tables.
   - Fix approach: the PR includes `PARTITIONED TABLE` in discovery and sums child partitions' `reltuples` through `pg_inherits`.
   - One-line summary: the fix direction looks right, and I do not currently see a new blocking code issue; the remaining blocker is the failing GitHub Build check.
   
   # 1. Code Change Review
   ## 1.1 Core Logic Analysis
   Local review basis:
   - Branch: `seatunnel-review-10814`
   - Head: `?` current PR head from GitHub metadata
   - Merge base with `upstream/dev`: `fe182baced10d67972173afcfb67950ebad67f4a`
   - `git diff --stat upstream/dev...HEAD`: 3 files changed, +22 / -4
   - `git diff --check upstream/dev...HEAD`: clean
   - GitHub checks: `Build` is failing, lightweight checks are passing
   - I did not run local Maven/tests in this batch; this is source-level review plus Git/GitHub metadata
   
   Runtime path I verified:
   ```text
   PostgreSQL CDC startup
     -> TableDiscoveryUtils.listTables(...)
         -> INFORMATION_SCHEMA.TABLES includes BASE TABLE + PARTITIONED TABLE
     -> snapshot splitter
         -> PostgresUtils.queryApproximateRowCnt(...) / PostgresDialect.approximateRowCntStatement(...)
             -> pg_inherits join pg_class
             -> sum child partition reltuples
     -> snapshot split generation
         -> partitioned parent table can enter the normal snapshot path
   ```
   
   Key findings:
   - The normal startup / snapshot path does hit these changes.
   - Adding `PARTITIONED TABLE` to discovery is the right entry-point fix.
   - Using `pg_inherits` plus child `reltuples` is a reasonable estimation strategy for partitioned tables.
   
   I do not currently see a new blocking code issue in the patch itself.
   
   Issue 1: the GitHub `Build` check is still red
   - Location: GitHub check `Build`
   - Problem: current metadata still shows `Build` failed.
   - Risk: the PR is not mergeable under the normal community rule while CI is red.
   - Suggested fix: inspect and fix the failing Build run first.
   - Severity: High
   
   ## 1.2 Compatibility Impact
   Verdict: fully compatible.
   - No API / config / default / protocol / serialization change.
   - This is a capability completion for PostgreSQL partitioned-table handling.
   
   ## 1.3 Performance / Side Effects
   The added `pg_inherits` aggregation query is reasonable. I do not see a notable CPU / memory / concurrency / retry regression from the patch itself.
   
   ## 1.4 Error Handling and Logs
   The main remaining risk is test confidence rather than obvious runtime error handling.
   
   # 2. Code Quality
   ## 2.1 Style
   The patch follows the existing PostgreSQL CDC / JDBC dialect style.
   
   ## 2.2 Tests
   There is no regression test in this diff. I recommend adding a focused partitioned-table discovery / approximate-row-count regression case, but I am not turning that into the only code blocker right now.
   
   ## 2.3 Docs
   A small PostgreSQL CDC doc note could help later, but I do not see a doc blocker for this specific patch.
   
   # 3. Architecture
   ## 3.1 Elegance
   This is a precise fix.
   
   ## 3.2 Maintainability
   The change is localized to discovery and row-count estimation, which keeps maintenance straightforward.
   
   ## 3.3 Extensibility
   It opens the right path for fuller PostgreSQL partitioned-table support.
   
   ## 3.4 Historical Compatibility
   Fully compatible.
   
   # 4. Issue Summary
   | No. | Issue | Location | Severity |
   |---|---|---|---|
   | 1 | GitHub `Build` is failing | GitHub check `Build` | High |
   
   # 5. Merge Decision
   ### Conclusion: can merge after fixes
   
   Blocking item:
   1. Get the `Build` check green.
   
   Suggested non-blocking follow-up:
   - Add a focused regression test for PostgreSQL partitioned-table discovery / approximate row count.
   
   Overall, the direction looks good to me. Once CI is green, I do not currently see a new blocking code issue from this patch.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org