Skip to content

Commit 5b85b28

Browse files
committed
[test](regression) Isolate ORC RowID seek injection in a serial suite
### What problem does this PR solve? Issue Number: N/A Related PR: #69465 Problem Summary: The TopN Hive suite runs concurrently, so the framework rejects its new all-BE debug point before the ORC seek is exercised. Move the injection into a separate nonConcurrent suite with its own catalog and explicit legacy-reader/cache/TopN settings. Keep the plan assertion and expected seek error, verify a successful five-row query after cleanup, and restore session settings on every exit. The original TopN suite retains its existing parallel correctness coverage. ### Release note None ### Check List (For Author) - Test: Manual test - Groovy 4.0.19 CONVERSION-phase compilation passed for both suites. - Local mock execution passed serial-group validation, independent catalog setup, recovery query, and debug-point/session cleanup on success, unexpected query error and partial debug-point enable failure. - git diff --check passed. - ./run-regression-test.sh --compile remains blocked by pre-existing duplicate Gson declarations rejected by the local Maven installation. Full external execution and BE UT are delegated to the requested CI reruns. - Behavior changed: No production behavior changes. - Does this need documentation: No
1 parent bad73d0 commit 5b85b28

2 files changed

Lines changed: 69 additions & 27 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
suite("test_hive_orc_rowid_seek_exception", "p0,external,hive,nonConcurrent") {
19+
String enabled = context.config.otherConfigs.get("enableHiveTest")
20+
if (enabled == null || !enabled.equalsIgnoreCase("true")) {
21+
logger.info("disable Hive test")
22+
return
23+
}
24+
25+
// Use a separate catalog and the preloaded Hive fixture, independent of the TopN suite.
26+
String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
27+
String hmsPort = context.config.otherConfigs.get("hive2HmsPort")
28+
sql """drop catalog if exists test_hive_orc_rowid_seek_exception"""
29+
sql """create catalog test_hive_orc_rowid_seek_exception properties (
30+
"type" = "hms",
31+
"hive.metastore.uris" = "thrift://${externalEnvIp}:${hmsPort}"
32+
)"""
33+
sql """use test_hive_orc_rowid_seek_exception.global_lazy_mat_db"""
34+
35+
def debugPoint = GetDebugPoint()
36+
def previousSettings = sql """SELECT @@enable_file_scanner_v2, @@enable_sql_cache,
37+
@@topn_lazy_materialization_threshold"""
38+
def rowIdSeekQuery = """SELECT name, value, score FROM orc_topn_lazy_mat_table
39+
ORDER BY id LIMIT 5"""
40+
try {
41+
// Phase two uses the legacy ORC reader only when V2 is disabled.
42+
sql "SET enable_file_scanner_v2=false"
43+
sql "SET enable_sql_cache=false"
44+
sql "SET topn_lazy_materialization_threshold=1024"
45+
explain {
46+
sql rowIdSeekQuery
47+
contains("VMaterializeNode")
48+
}
49+
try {
50+
// Inject after RowIDs exist, rather than during first-phase file initialization.
51+
debugPoint.enableDebugPointForAllBEs("OrcReader::rowid_seek.inject_error")
52+
test {
53+
sql rowIdSeekQuery
54+
exception "injected ORC RowID seek failure"
55+
}
56+
} finally {
57+
debugPoint.disableDebugPointForAllBEs("OrcReader::rowid_seek.inject_error")
58+
}
59+
// The materializing query must still return rows after the asynchronous failure.
60+
test {
61+
sql rowIdSeekQuery
62+
rowNum 5
63+
}
64+
} finally {
65+
sql "SET enable_file_scanner_v2=${previousSettings[0][0]}"
66+
sql "SET enable_sql_cache=${previousSettings[0][1]}"
67+
sql "SET topn_lazy_materialization_threshold=${previousSettings[0][2]}"
68+
}
69+
}

‎regression-test/suites/external_table_p0/hive/test_hive_topn_lazy_mat.groovy‎

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -292,33 +292,6 @@ suite("test_hive_topn_lazy_mat", "p0,external") {
292292

293293
runTopNLazyMatTests()
294294

295-
// Phase two uses the legacy ORC reader only when V2 is disabled. Inject after
296-
// RowIDs exist so the failure exercises seek, not first-phase file initialization.
297-
def previousSeekSettings = sql "SELECT @@enable_file_scanner_v2, @@enable_sql_cache"
298-
def rowIdSeekQuery = """SELECT name, value, score FROM orc_topn_lazy_mat_table
299-
ORDER BY id LIMIT 5"""
300-
try {
301-
sql "SET enable_file_scanner_v2=false"
302-
sql "SET enable_sql_cache=false"
303-
explain {
304-
sql rowIdSeekQuery
305-
contains("VMaterializeNode")
306-
}
307-
try {
308-
GetDebugPoint().enableDebugPointForAllBEs("OrcReader::rowid_seek.inject_error")
309-
test {
310-
sql rowIdSeekQuery
311-
exception "injected ORC RowID seek failure"
312-
}
313-
} finally {
314-
GetDebugPoint().disableDebugPointForAllBEs("OrcReader::rowid_seek.inject_error")
315-
}
316-
// A subsequent materializing query must still succeed after the asynchronous error.
317-
sql rowIdSeekQuery
318-
} finally {
319-
sql "SET enable_file_scanner_v2=${previousSeekSettings[0][0]}"
320-
sql "SET enable_sql_cache=${previousSeekSettings[0][1]}"
321-
}
322295

323296
sql """ set topn_lazy_materialization_threshold=-1; """
324297
runTopNLazyMatTests()

0 commit comments

Comments
 (0)