Skip to content

[FLINK-39341][jdbc-driver] Implement DatabaseMetaData methods for DBeaver#27840

Open
navis wants to merge 2 commits intoapache:masterfrom
navis:jdbc-metadata-impl
Open

[FLINK-39341][jdbc-driver] Implement DatabaseMetaData methods for DBeaver#27840
navis wants to merge 2 commits intoapache:masterfrom
navis:jdbc-metadata-impl

Conversation

@navis
Copy link
Copy Markdown

@navis navis commented Mar 27, 2026

The most of codes/descriptions are made by claude

DatabaseMetaData

  • getTables(catalog, schemaPattern, tableNamePattern, types) — Lists tables and views across catalogs/schemas using SHOW TABLES and SHOW VIEWS SQL statements. Supports filtering by table name pattern (SQL % and _ wildcards) and table type (TABLE, VIEW).
  • getColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern) — Retrieves column metadata (name, JDBC type, nullability, ordinal position) by executing SELECT * FROM LIMIT 0 and inspecting the ResolvedSchema. Maps Flink logical types to JDBC java.sql.Types constants.
  • getSchemas(catalog, schemaPattern) — Previously threw UnsupportedOperationException. Now properly implemented with catalog and schema pattern filtering via SHOW DATABASES IN . The no-arg getSchemas() is refactored to delegate to this method.
  • getPrimaryKeys(catalog, schema, table) — Returns primary key information from the table's ResolvedSchema when available.
  • getTableTypes() — Returns the supported table types: TABLE and VIEW.
  • FlinkResultSet

    • ROW type — Converted to Map<String, Object> preserving field names and values.
    • ARRAY type — Converted to List with proper element type conversion.

@flinkbot
Copy link
Copy Markdown
Collaborator

flinkbot commented Mar 27, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Copy link
Copy Markdown
Contributor

@snuyanzin snuyanzin left a comment

Choose a reason for hiding this comment

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

Thanks for contribution

  1. since you use AI, can you use Generated-by: instead of Co-authored-by: as mentioned in Apache recommendations https://www.apache.org/legal/generative-tooling.html
  2. I don't see any test here, how can we be show that it works?
    2.1 How can we be show it will not be broken by future changes?

navis94 added 2 commits March 31, 2026 17:08
…aver compatibility

Implement getTables, getColumns, getSchemas, getPrimaryKeys, getTableTypes
in FlinkDatabaseMetaData to enable DBeaver and other JDBC tools to browse
Flink catalogs. Also add ROW and ARRAY type support in FlinkResultSet.

Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Tables view duplication

Add tests for getTables, getColumns, getSchemas, getPrimaryKeys, and
getTableTypes. Fix a bug where SHOW TABLES included views, causing
duplicate entries when views were also collected via SHOW VIEWS.

Generated-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@navis navis force-pushed the jdbc-metadata-impl branch from d3bdd8b to e83f320 Compare March 31, 2026 08:09
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.

4 participants