Skip to content

[core][flink] Support view operations in JDBC Catalog#6667

Closed
tchivs wants to merge 1 commit into
apache:masterfrom
tchivs:feature/jdbc-catalog-view-support
Closed

[core][flink] Support view operations in JDBC Catalog#6667
tchivs wants to merge 1 commit into
apache:masterfrom
tchivs:feature/jdbc-catalog-view-support

Conversation

@tchivs

@tchivs tchivs commented Nov 25, 2025

Copy link
Copy Markdown
Contributor

Purpose

Add view support for JDBC Catalog to enable CREATE VIEW, DROP VIEW, SHOW VIEWS and other view operations.

Changes

  • Add view method delegation to CachingCatalog for proper wrapping
  • Implement view operations in JdbcCatalog (createView, getView, listViews, dropView, renameView, alterView)
  • Add view-related SQL utilities in JdbcUtils
  • Add integration tests in JdbcCatalogViewITCase
  • Add SQLite JDBC dependency for tests

Tests

All 7 integration tests pass:

  • testCreateAndQueryView
  • testShowViews
  • testDropView
  • testViewWithAggregation
  • testCreateViewIfNotExists
  • testDropViewIfExists
  • testShowCreateView

- Add view methods to CachingCatalog for proper delegation
- Add IT tests for JDBC Catalog view operations
- Add SQLite JDBC dependency for tests
@tchivs tchivs changed the title Add view support for JDBC Catalog [core][flink] Support view operations in JDBC Catalog Nov 25, 2025
@tchivs tchivs force-pushed the feature/jdbc-catalog-view-support branch from be21196 to 7ad7450 Compare November 25, 2025 07:18
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

This pull request has had no activity for 90 days. If you'd like to keep it open, please push a new commit or leave a comment. Thanks for the contribution.

@github-actions github-actions Bot added the stale label May 9, 2026

@JingsongLi JingsongLi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice feature adding view support to JDBC Catalog (+716 lines). Review:

  1. Completeness: Implements all view operations (create, get, list, drop, rename, alter) - this is a complete feature.

  2. CachingCatalog delegation: Adding view method delegation ensures views work correctly when the catalog is wrapped. Good.

  3. JdbcUtils SQL: The view metadata is stored in JDBC tables alongside table metadata. Key questions:

    • What's the schema for the view storage table? Is it created automatically (schema migration)?
    • Is the view SQL text stored as-is, or is there any parsing/validation?
    • How are cross-database view references handled?
  4. Testing: 7 integration tests is good coverage for the basic operations. Consider adding:

    • View referencing a non-existent table (should this fail at create time or query time?)
    • Rename view across databases
    • Concurrent view creation
  5. Flink integration test: Good that there's a dedicated JdbcCatalogViewITCase testing end-to-end with Flink SQL.

  6. SQLite test dependency: Reasonable for unit tests, but ensure it doesn't leak into production classpath.

Looks well-structured. Would be good to confirm the DDL for the views table in the JDBC schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants