Flink: Support reading Iceberg views in SQL - #17859
Open
talatuyarer wants to merge 1 commit into
Open
Conversation
talatuyarer
force-pushed
the
flink-views-read
branch
from
August 28, 2026 23:52
0cf3958 to
beff342
Compare
This was referenced Aug 29, 2026
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.
This PR adds the read path for Iceberg views to Flink, the first step of the plan in #17858 With this change, views created through the Iceberg
ViewCatalogAPI or by other engines such as Spark become queryable from Flink SQL.Write operations such as
CREATE VIEW,DROP VIEW,ALTER VIEW ... RENAMEandALTER VIEW ASare follow-ups tracked in #17858.Resolution semantics and limitations
Flink's
CatalogAPI gives an implementation no way to inject the resolution context that the Iceberg view spec defines, so two limitations are worth calling out:Stored
default-catalog/default-namespaceare not honored by the Flink planner. The view spec says engines should resolve unqualified references against the defaults stored in the view version, and Spark does this natively via itsView#currentCatalog()/currentNamespace()hooks. Flink has no equivalent. It always resolves unqualified references against the view's own catalog and database. For views whosedefault-namespaceequals the namespace they live in (the common case, and what the follow-upCREATE VIEWPR will always produce, the two coincide and resolution is correct. A view created by another engine with a differentdefault-namespacemay resolve unqualified references differently in Flink than in Spark/Trino. Fixing this properly needs a Flink-side API; until then this is documented behavior.Lenient dialect fallback. If a view has no
"flink"SQL representation,View#sqlForfalls back to the closest available representation (e.g. Spark SQL). ANSI-compatible SQL works across engines (covered by tests), but non-portable SQL fails at parse time or, worse, could parse with different semantics. This is the same stance Spark takes today; a strict-dialect option is planned as a follow-up. See also the https://lists.apache.org/thread/k6szpr5smyrh37sy563xpgjor4g6pr81 for the longer-term cross-engine story.Catalog names in qualified references are deployment-local. If the stored view SQL fully qualifies references with a catalog name, that name only resolves in deployments that register the Iceberg catalog under the same name. This is inherent to the view spec storing engine-local catalog names and applies to Spark equally; unqualified references (resolved per item 1) do not have this problem.