Add presto-managed-view config property to BaseJdbcConfig to control remote view SQL analysis#27815
Draft
KNagaVivek wants to merge 1 commit into
Draft
Add presto-managed-view config property to BaseJdbcConfig to control remote view SQL analysis#27815KNagaVivek wants to merge 1 commit into
presto-managed-view config property to BaseJdbcConfig to control remote view SQL analysis#27815KNagaVivek wants to merge 1 commit into
Conversation
Contributor
Reviewer's GuideIntroduces a new Sequence diagram for JdbcMetadata.getViews gated by presto-managed-viewsequenceDiagram
participant Caller
participant JdbcMetadata
participant JdbcClient
Caller->>JdbcMetadata: getViews(session, prefix)
alt [prestoAnalyzeViews is false]
JdbcMetadata-->>Caller: ImmutableMap.of()
else [prestoAnalyzeViews is true]
JdbcMetadata->>JdbcMetadata: listViews(session, Optional schema)
JdbcMetadata->>JdbcClient: getViews(session, tableNames)
JdbcClient-->>JdbcMetadata: Map<SchemaTableName, ConnectorViewDefinition>
JdbcMetadata-->>Caller: Map<SchemaTableName, ConnectorViewDefinition>
end
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
|
Please include documentation for the new configuration property "All new language features, new functions, session and config properties, and major features have documentation added" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a new configuration property
presto-managed-viewtoBaseJdbcConfigand a gatekeeper inJdbcMetadata.getViews()that controls whether Presto fetches and re-analyzes view SQL from the remote database in JDBC connectors.When a JDBC connector implements
JdbcClient.getViews()to expose remote database views, Presto currently re-analyzes the raw view SQL throughStatementAnalyzer.analyzeView()as if it were native Presto SQL. This fails for any view containing database-native constructs such asSESSION_USER, database UDFs, or SQL dialect keywords not recognized by Presto's analyzer, even though the same views work correctly from native database clients.This change introduces
presto-managed-viewas a single gatekeeper inJdbcMetadata.getViews()that applies uniformly to all JDBC connectors. When set tofalse, views are surfaced as regular tables viagetTableHandle()and all view resolution is delegated to the remote database. When set totrue, the existing Presto-managed view analysis behavior is preserved.Changes:
BaseJdbcConfig: addpresto-managed-viewproperty (default:true)JdbcClient: addgetViews(ConnectorSession, SchemaTablePrefix)to interfaceJdbcMetadata: gatekeeper ingetViews()delegates to client or returnsempty based on flag value
JdbcMetadataFactory: to create MetadataFactoryMotivation and Context
#27814
Impact
New configuration property for all JDBC connectors in
catalog.properties:presto-managed-viewtruetrue(default), Presto fetches view SQL from the remote database and analyzes it as Presto SQL. Whenfalse, views surface as tables and view resolution is delegated to the remote database.Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
Summary by Sourcery
Add a configurable gate to control whether JDBC connectors expose Presto-managed views or delegate view handling entirely to the remote database.
New Features:
Enhancements: