Skip to content

Comments

Move catalog utils in a separate utility object for reuse.#708

Merged
yruslan merged 1 commit intomainfrom
feature/move-reusable-methods-to-catalog-utils
Feb 3, 2026
Merged

Move catalog utils in a separate utility object for reuse.#708
yruslan merged 1 commit intomainfrom
feature/move-reusable-methods-to-catalog-utils

Conversation

@yruslan
Copy link
Collaborator

@yruslan yruslan commented Feb 3, 2026

Summary by CodeRabbit

  • Refactor

    • Improved code organization by moving table existence validation logic to a centralized utility module, eliminating duplication and enhancing consistency for table operations.
  • Tests

    • Expanded test coverage to validate table existence checks across various scenarios and multiple supported table formats, including Iceberg, Delta, and Parquet.

@coderabbitai
Copy link

coderabbitai bot commented Feb 3, 2026

Walkthrough

This pull request refactors table utility methods by extracting them from MetastorePersistenceIceberg into a centralized CatalogUtils object. The changes consolidate table existence checks and retrieval logic with proper error handling for unsupported catalogs, supported by a new test suite.

Changes

Cohort / File(s) Summary
Iceberg Persistence Refactoring
pramen/core/src/main/scala/.../MetastorePersistenceIceberg.scala
Removed public methods doesTableExist and getExistingTable; replaced with calls to centralized CatalogUtils methods for table existence checks.
New Catalog Utilities
pramen/core/src/main/scala/.../CatalogUtils.scala
Introduced new CatalogUtils object with four overloaded public methods: doesTableExist and getExistingTable (each accepting either String or CatalogTable). Includes error handling for unsupported catalogs via IllegalArgumentException.
Test Coverage
pramen/core/src/test/scala/.../CatalogUtilsSuite.scala
New test suite validating CatalogUtils.doesTableExist across multiple scenarios: non-existing tables, temporary views, dropped views, and schema-prefixed tables.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 From Iceberg's depths we've made our way,
To Catalog's nest where utilities stay,
With hop and refactor, we've tidied the code,
Shared and reusable down a cleaner road! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: extracting reusable catalog utility methods into a separate CatalogUtils object.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/move-reusable-methods-to-catalog-utils

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Failure to add the new IP will result in interrupted reviews.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Unit Test Coverage

Overall Project 84.11% -0.02% 🍏
Files changed 79.78%

Module Coverage
pramen:core Jacoco Report 86.05% -0.02%
Files
Module File Coverage
pramen:core Jacoco Report MetastorePersistenceIceberg.scala 79.63% 🍏
CatalogUtils.scala 78.05% -21.95%

@yruslan yruslan merged commit b48f80b into main Feb 3, 2026
7 checks passed
@yruslan yruslan deleted the feature/move-reusable-methods-to-catalog-utils branch February 3, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant