Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate TABLE_TYPE listing for view from system.jdbc.tables #24525

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

agrawalreetika
Copy link
Member

@agrawalreetika agrawalreetika commented Feb 10, 2025

Description

Fix duplicate TABLE_TYPE listing for view from system.jdbc.tables

Motivation and Context

Fixes #22953

Currently, TABLE_TYPE of views are getting listed twice as TABLE and VIEW when system.jdbc.tables is queried -

nation1_prestoview is a view here,

presto> SELECT TABLE_CAT, TABLE_SCHEM, TABLE_NAME, TABLE_TYPE, REMARKS, TYPE_CAT, TYPE_SCHEM, TYPE_NAME, SELF_REFERENCING_COL_NAME, REF_GENERATION FROM system.jdbc.tables WHERE TABLE_NAME='nation1_prestoview';
 TABLE_CAT |  TABLE_SCHEM   |     TABLE_NAME     | TABLE_TYPE | REMARKS | TYPE_CAT | TYPE_SCHEM | TYPE_NAME | SELF_REFERENCING_COL_NAME | REF_GENERATION 
-----------+----------------+--------------------+------------+---------+----------+------------+-----------+---------------------------+----------------
 hive      | reetika_testdb | nation1_prestoview | TABLE      | NULL    | NULL     | NULL       | NULL      | NULL                      | NULL           
 hive      | reetika_testdb | nation1_prestoview | VIEW       | NULL    | NULL     | NULL       | NULL      | NULL                      | NULL           
(2 rows)

Impact

Fixes #22953

Test Plan

Added test

Contributor checklist

  • Please make sure your submission complies with our contributing guide, in particular code style and commit standards.
  • PR description addresses the issue accurately and concisely. If the change is non-trivial, a GitHub Issue is referenced.
  • Documented new properties (with its default value), SQL syntax, functions, or other functionality.
  • If release notes are required, they follow the release notes guidelines.
  • Adequate tests were added if applicable.
  • CI passed.

Release Notes

== NO RELEASE NOTE ==

@agrawalreetika agrawalreetika requested a review from a team as a code owner February 10, 2025 19:51
@prestodb-ci prestodb-ci added the from:IBM PR from IBM label Feb 10, 2025
@prestodb-ci prestodb-ci requested review from a team, pramodsatya and nishithakbhaskaran and removed request for a team February 10, 2025 19:51
@agrawalreetika agrawalreetika self-assigned this Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from:IBM PR from IBM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JDBC DatabaseMetadata.getTables to describe VIEWS as VIEWS and not tables. Duplicates responses in getTables.
2 participants