Skip to content

Commit e007d15

Browse files
committed
[test](regression) Cover hidden versions in lazy TopN fetch
### What problem does this PR solve? Issue Number: None Related PR: #68125 Problem Summary: Add an execution oracle for read-time VERSION materialization through the lazy TopN row-ID fetch path. The regression forces PhysicalLazyMaterialize, interleaves rows from singleton rowset versions 2 and 3, and verifies exact hidden-column values through both direct-column and full row-store fetches. ### Release note None ### Check List (For Author) - Test: Regression test - Generated and reran point_query_p0/test_point_query_read_time_hidden_columns - Behavior changed: No - Does this need documentation: No
1 parent b8c448f commit e007d15

2 files changed

Lines changed: 88 additions & 0 deletions

File tree

‎regression-test/data/point_query_p0/test_point_query_read_time_hidden_columns.out‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,15 @@ true true
1616

1717
-- !version_minmax_normal --
1818
true true
19+
20+
-- !topn_column_store_versions --
21+
1 first-1 2
22+
2 second-2 3
23+
3 first-3 2
24+
4 second-4 3
25+
26+
-- !topn_row_store_versions --
27+
1 first-1 2
28+
2 second-2 3
29+
3 first-3 2
30+
4 second-4 3

‎regression-test/suites/point_query_p0/test_point_query_read_time_hidden_columns.groovy‎

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,81 @@ suite("test_point_query_read_time_hidden_columns") {
8484
from point_query_hidden_full_row_store
8585
"""
8686

87+
sql "set topn_lazy_materialization_threshold = 1024"
88+
89+
sql "drop table if exists hidden_version_topn_column_store"
90+
sql """
91+
create table hidden_version_topn_column_store (
92+
k int,
93+
sort_key int,
94+
payload varchar(32)
95+
) unique key(k)
96+
distributed by hash(k) buckets 1
97+
properties (
98+
"replication_num" = "1",
99+
"enable_unique_key_merge_on_write" = "true",
100+
"light_schema_change" = "true",
101+
"disable_auto_compaction" = "true"
102+
)
103+
"""
104+
// Each insert creates a singleton rowset at versions 2 and 3. The sort keys interleave
105+
// the rowsets in the lazy-fetch request, exercising per-batch replacement and scattering.
106+
sql "insert into hidden_version_topn_column_store values (1, 1, 'first-1'), (3, 3, 'first-3')"
107+
sql "insert into hidden_version_topn_column_store values (2, 2, 'second-2'), (4, 4, 'second-4')"
108+
109+
explain {
110+
sql """
111+
shape plan
112+
select k, payload, __DORIS_VERSION_COL__
113+
from hidden_version_topn_column_store
114+
order by sort_key
115+
limit 4
116+
"""
117+
contains("PhysicalLazyMaterialize")
118+
}
119+
qt_topn_column_store_versions """
120+
select k, payload, __DORIS_VERSION_COL__
121+
from hidden_version_topn_column_store
122+
order by sort_key
123+
limit 4
124+
"""
125+
126+
sql "drop table if exists hidden_version_topn_row_store"
127+
sql """
128+
create table hidden_version_topn_row_store (
129+
k int,
130+
sort_key int,
131+
payload varchar(32)
132+
) unique key(k)
133+
distributed by hash(k) buckets 1
134+
properties (
135+
"replication_num" = "1",
136+
"enable_unique_key_merge_on_write" = "true",
137+
"light_schema_change" = "true",
138+
"store_row_column" = "true",
139+
"disable_auto_compaction" = "true"
140+
)
141+
"""
142+
// Repeat the interleaved rowset fetch through the full row-store materialization path.
143+
sql "insert into hidden_version_topn_row_store values (1, 1, 'first-1'), (3, 3, 'first-3')"
144+
sql "insert into hidden_version_topn_row_store values (2, 2, 'second-2'), (4, 4, 'second-4')"
145+
146+
explain {
147+
sql """
148+
shape plan
149+
select k, payload, __DORIS_VERSION_COL__
150+
from hidden_version_topn_row_store
151+
order by sort_key
152+
limit 4
153+
"""
154+
contains("PhysicalLazyMaterialize")
155+
}
156+
qt_topn_row_store_versions """
157+
select k, payload, __DORIS_VERSION_COL__
158+
from hidden_version_topn_row_store
159+
order by sort_key
160+
limit 4
161+
"""
162+
87163
sql "set show_hidden_columns = false"
88164
}

0 commit comments

Comments
 (0)