[POC][RFC-0025] Derived column supports expression#27832
Draft
ScrapCodes wants to merge 1 commit into
Draft
Conversation
Contributor
Reviewer's GuideIntroduces derived/GENERATED column support for Iceberg tables, including new SQL syntax, table and column metadata properties, a JSON-based specification for derived column expressions, and a connector-side plan optimizer that rewrites filter predicates to reuse pre-computed derived columns, plus config/session toggles and tests. Flow diagram for CREATE TABLE with derived/GENERATED columnsflowchart LR
subgraph Parser
A[SQL: CREATE TABLE ...
col GENERATED AS expr PERSISTENT]
B[SqlBase.g4
columnDefinition rule]
C[AstBuilder.visitColumnDefinition]
D[ColumnDefinition
+DerivedColumnDefinition]
end
subgraph Analyzer
E[CreateTableTask
builds ColumnMetadata
with DERIVED_COLUMN_EXPRESSION]
F[ConnectorTableMetadata
properties include
DERIVED_COLUMN_EXPRESSION]
end
subgraph IcebergMetadata
G[IcebergAbstractMetadata.createTable]
H[DerivedColumnExpressionSpecList
+DerivedColumnExpressionSpec]
I[IcebergTableProperties
getDerivedColumnExpressionSpec]
J[IcebergUtil.populateTableProperties
stores DERIVED_COLUMNS and
DERIVED_COLUMN_EXPRESSION_SPEC]
end
A --> B --> C --> D
D --> E --> F
F --> G
G --> H
H --> I
I --> J
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
f2ef2f1 to
9aff20b
Compare
aaneja
reviewed
May 20, 2026
|
|
||
| import java.util.Comparator; | ||
|
|
||
| public class RowExpressionComparator |
Contributor
There was a problem hiding this comment.
Can you try using this implementation -
We can move it presto-common if it suffices
4d3344a to
3e04e2b
Compare
3e04e2b to
0a7f4a8
Compare
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
Following is an example of sub expression matching.
Motivation and Context
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
If release note is NOT required, use:
Summary by Sourcery
Add derived column support for Iceberg tables, including SQL syntax, metadata propagation, and a plan optimizer that rewrites filter predicates to use precomputed derived columns when enabled.
New Features:
Enhancements:
Build:
Tests: