Repository navigation
Conversation
Contributor
Author
|
Could you please help review this PR when you have time? thanks! @swuferhong @platinumhamburg @Kaixuan-Duan |
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.
Purpose
related to: #4379
This PR introduces a read-only
$partitionsvirtual table for querying partition metadata through standard Flink SQL.Previously, partition IDs, names, and effective bucket counts could only be inspected through the
sys.list_partition_infosprocedure. A virtual table makes this metadata composable with regular SQL operations such as projection, filtering, aggregation, and joins.For example:
This is particularly useful after changing the table-level
bucket.num, because existing partitions retain their original bucket counts while newly created partitions use the new value.Brief change log
$partitionsvirtual table with the following schema:partition_id BIGINT NOT NULLpartition_name STRING NOT NULLbucket_count INT NOT NULL$partitionsto partitioned Fluss tables and reject mutation operations.$lakerouting precedence for names such astable$lake$partitions.Admin.listPartitionInfos.$bucketsand$partitions.sys.list_partition_infoswhile retaining it for backward compatibility.Predicate pushdown is not included in this initial implementation. Flink evaluates predicates after retrieving the complete partition metadata snapshot.
Tests
Added or extended tests covering:
RowDataconversion.$partitionsschema and catalog resolution.$lakerouting precedence.$bucketsmetadata source.The relevant tests passed on Flink 1.18, 1.19, and 1.20. The final package build also passed Checkstyle, Spotless, and RAT validation.
API and Format
This change adds a new SQL-facing virtual table and deprecates the Java class backing
sys.list_partition_infos.The existing procedure remains available and its behavior is unchanged.
There are no changes to the storage format, network protocol, or persisted metadata format.
Documentation
The virtual-table documentation now describes:
$partitions.The Flink procedure and bucketing documentation now recommend
$partitionsinstead ofsys.list_partition_infos.