branch4.0: [feature](variable) enables views, materialized views, generated columns, and alias functions to persist session variables #58031#58821
Merged
yiguolei merged 3 commits intoapache:branch-4.0from Dec 12, 2025
Conversation
Contributor
Author
|
run buildall |
1 similar comment
Contributor
Author
|
run buildall |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
Author
|
run nonConcurrent |
1 similar comment
Contributor
Author
|
run nonConcurrent |
fb329dc to
0aea3c2
Compare
Contributor
Author
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
Author
|
run external |
Contributor
Author
|
run cloud_p0 |
…mns, and alias functions to persist session variables (apache#58031) Problem Summary: When creating views, generated columns, materialized views, or alias functions, session variables that affect query results (e.g., `enable_decimal256`) are not persisted. This causes inconsistent query results when session variables differ between creation and query time. This PR persists session variables marked with `affectQueryResult()` annotation for: - Views - Generated Columns - Materialized Views - Alias Functions When querying these objects, the system automatically uses the persisted session variables from creation time, ensuring consistent results. - Added `sessionVariables` field to `View`, `Column`, `MTMV`, and `AliasFunction` classes - Created `AutoCloseSessionVariable` utility to temporarily apply persisted variables during query processing - Modified view/column/MV/function parsing logic to use persisted session variables - Added `SessionVarGuardExpr` to protect expressions that depend on session variables --------- Co-authored-by: jacktengg <tengjianping@selectdb.com>
0aea3c2 to
5d22bc1
Compare
Contributor
Author
|
run buildall |
Contributor
FE UT Coverage ReportIncrement line coverage |
Contributor
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
Contributor
Author
|
run cloud_p0 |
Contributor
Author
|
run external |
yiguolei
approved these changes
Dec 12, 2025
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.
picked from #58031