Commit c1eec85
[feature](variable) enables views, materialized views, generated columns, and alias functions to persist session variables (apache#58031)
### What problem does this PR solve?
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.
#### Key Changes
- 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 <[email protected]>1 parent c893dd9 commit c1eec85
File tree
214 files changed
+4629
-1105
lines changed- be
- src
- olap
- pipeline/exec
- runtime
- vec
- aggregate_functions
- core
- data_types
- exec/scan
- exprs
- functions
- array
- test
- ai
- pipeline/operator
- testutil/mock
- vec
- aggregate_functions
- function
- fe/fe-core/src
- main/java/org/apache/doris
- alter
- analysis
- catalog
- mtmv
- nereids
- glue/translator
- jobs/executor
- memo
- minidump
- parser
- processor/post
- rules
- analysis
- exploration/mv
- expression
- rules
- implementation
- rewrite
- trees
- expressions
- functions
- agg
- executable
- scalar
- udf
- literal
- visitor
- plans
- algebra
- commands
- info
- types
- util
- persist
- qe
- test/java/org/apache/doris
- alter
- catalog
- nereids
- rules/rewrite
- trees
- expressions
- plans/commands/merge
- persist
- qe
- regression-test
- data
- datatype_p0/agg_state
- decimal_sum
- decimalv3
- nereids_p0/variables_persist
- suites
- datatype_p0/agg_state/decimalv3
- nereids_p0/variables_persist
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
214 files changed
+4629
-1105
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
123 | | - | |
| 122 | + | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
776 | 776 | | |
777 | 777 | | |
778 | 778 | | |
779 | | - | |
| 779 | + | |
| 780 | + | |
780 | 781 | | |
781 | 782 | | |
782 | 783 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
191 | | - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
192 | 198 | | |
193 | 199 | | |
194 | 200 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | 209 | | |
214 | 210 | | |
215 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | 49 | | |
51 | 50 | | |
52 | 51 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
Lines changed: 19 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | | - | |
| 36 | + | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | | - | |
49 | | - | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
60 | 63 | | |
61 | 64 | | |
62 | 65 | | |
63 | | - | |
64 | | - | |
65 | | - | |
| 66 | + | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
| |||
0 commit comments