Skip to content

fix: Catch SQLException in attachTableType#296

Merged
nbesimi merged 1 commit intodevelopfrom
fix/kinetica-cloud-error
Feb 4, 2026
Merged

fix: Catch SQLException in attachTableType#296
nbesimi merged 1 commit intodevelopfrom
fix/kinetica-cloud-error

Conversation

@Femi3211
Copy link
Collaborator

@Femi3211 Femi3211 commented Feb 4, 2026

Log a warning, and continue extract so shard_kind/persistence are skipped when not supported.

Summary by CodeRabbit

  • Refactor
    • Enhanced error handling for table metadata extraction operations, now logging warnings gracefully instead of propagating exceptions, improving system resilience.
    • Improved automatic resource cleanup for database connections and result objects to prevent resource leaks and enhance reliability.
    • Strengthened the robustness of table type attachment during extraction workflows.

extract so shard_kind/persistence are skipped when not supported.
@Femi3211 Femi3211 requested review from jetroni and nbesimi February 4, 2026 13:41
@coderabbitai
Copy link

coderabbitai bot commented Feb 4, 2026

📝 Walkthrough

Walkthrough

The attachTableType method in KineticaTablesExtractor.java was refactored to use try-with-resources for automatic resource management and handle exceptions internally by logging warnings instead of propagating SQLException up the call stack.

Changes

Cohort / File(s) Summary
Resource Management Refactoring
source/src/main/java/com/adataptivescale/rosetta/source/core/extractors/table/KineticaTablesExtractor.java
Method attachTableType() updated to use try-with-resources block for Statement and ResultSet management, removing manual close calls. Exception handling changed from throws SQLException to internal catch block with warning logs. Core business logic unchanged.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 With try-with-resources, the rabbit hops free,
No leaks in the streams, resources decree,
Exceptions caught gently with warnings so bright,
The code cleanup magic makes everything right! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly matches the main change: catching SQLException in attachTableType instead of throwing it.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/kinetica-cloud-error

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@source/src/main/java/com/adataptivescale/rosetta/source/core/extractors/table/KineticaTablesExtractor.java`:
- Around line 35-51: The catch block in attachTableType (class
KineticaTablesExtractor) currently swallows the SQLException; update the catch
to include the exception details in the log call (e.g., log.warn("Could not
attach table type ...", e) or append e.getMessage()) so the warning contains the
root cause; ensure you update the catch for SQLException e and keep the same
explanatory text while passing the exception object or its message to the
logger.

@nbesimi nbesimi merged commit 91704c1 into develop Feb 4, 2026
2 checks passed
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.

2 participants