Skip to content

[test](regression) Add ORC reader V2 Hive coverage#65480

Open
xylaaaaa wants to merge 1 commit into
apache:masterfrom
xylaaaaa:codex/orc-v2-hive-regression
Open

[test](regression) Add ORC reader V2 Hive coverage#65480
xylaaaaa wants to merge 1 commit into
apache:masterfrom
xylaaaaa:codex/orc-v2-hive-regression

Conversation

@xylaaaaa

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:
This PR adds regression coverage for the refactored ORC reader V2 path on Hive external tables. It covers ORC SARG initialization for min/max pruning, null-safe predicates, decimal/date/timestamp predicates, lazy materialization profile metrics, delete predicate behavior on Hive ACID ORC tables, and virtual row id coverage through the existing TopN lazy materialization suite.

Release note

None

Check List (For Author)

  • Test:
    • Regression test: ./run-regression-test.sh --run -d external_table_p0/hive -s test_hive_orc_predicate,test_orc_lazy_mat_profile,test_transactional_hive,test_hive_topn_lazy_mat
    • Regression test: ./run-regression-test.sh --run -d external_table_p0/hive -s test_hive_orc_predicate,test_orc_lazy_mat_profile
    • Regression test: ./run-regression-test.sh --run -d external_table_p0/hive -s test_orc_lazy_mat_profile
  • Behavior changed: No
  • Does this need documentation: No

Copilot AI review requested due to automatic review settings July 11, 2026 04:51
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Gabriel39

Copy link
Copy Markdown
Contributor

/review

@xylaaaaa

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review result: request changes due to one test-coverage gap.

Critical checkpoint conclusions:

  • Goal/test proof: this PR is intended to add ORC Reader V2 Hive coverage, but the transactional Hive ACID additions do not prove ScannerV2 coverage because those ranges still fall back to the old scanner.
  • Scope/focus: the changes are limited to regression tests and are otherwise focused.
  • Concurrency/lifecycle/data writes/persistence: no production code paths are changed by this PR.
  • Configuration/session propagation: the accepted issue is specifically that setting enable_file_scanner_v2=true is insufficient for transactional_hive ranges because scanner selection rejects that table format.
  • Parallel paths: transactional Hive has a separate old-scanner reader path, which is the reported coverage gap.
  • Test coverage/results: static review only in this runner; the base commit is absent locally, .worktree_initialized and thirdparty/installed are missing, and external Hive execution is not available here.
  • User focus: no additional user-provided review focus was present.

Subagent conclusions: optimizer-rewrite reported no optimizer/rewrite candidates. tests-session-config proposed TSC-001, accepted as the inline comment below. Convergence round 1 ended with both live subagents replying NO_NEW_VALUABLE_FINDINGS for the same final ledger/comment set.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correcting the inline anchor for the same accepted finding from the prior review summary.

Comment thread regression-test/suites/external_table_p0/hive/test_transactional_hive.groovy Outdated
@xylaaaaa xylaaaaa force-pushed the codex/orc-v2-hive-regression branch from eda21cf to 5bbdf3f Compare July 11, 2026 10:53
@Gabriel39

Copy link
Copy Markdown
Contributor

run buildall

@Gabriel39

Copy link
Copy Markdown
Contributor

/review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated review found one blocking issue in the new regression coverage: the Hive ORC predicate assertions force ScannerV2 but rely on a SARG-success session guard that only the legacy ORC reader enforces.

Critical checkpoint conclusions:

  • Goal/test proof: the PR is focused on ORC reader V2 Hive regression coverage, but the accepted inline issue means part of that coverage can pass without proving the intended V2 SARG/min-max path.
  • Scope: the PR is test-only and otherwise narrow.
  • Concurrency, lifecycle, persistence, transactionality, data writes, and FE-BE protocol compatibility: no runtime code is changed directly.
  • Configuration/session propagation: the issue is specifically a session-variable coverage gap between old and V2 ORC reader paths.
  • Parallel paths: the existing transactional Hive ScannerV2 thread is already known; this review comment covers a distinct non-transactional Hive ORC V2 case.
  • Test results and style: GitHub PR patch whitespace validation passed. I did not run regression tests because this checkout lacks thirdparty/installed and the external Hive environment.
  • User focus: no additional user-provided review focus was supplied.

Subagent conclusions: OPT-1 and TSC-1 were merged into the single inline comment. A possible profile-token pruning concern was dismissed because FE profile summaries record the original SQL text. Convergence round 1 ended with both optimizer-rewrite and tests-session-config replying NO_NEW_VALUABLE_FINDINGS for the exact final ledger/comment set.

@@ -45,8 +58,66 @@ suite("test_hive_orc_predicate", "p0,external") {

qt_predicate_null_aware_equal_in_rt """select * from table_a inner join table_b on table_a.age <=> table_b.age and table_b.id in (1,3) order by table_a.id;"""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still does not prove that ScannerV2 initialized an ORC SearchArgument. The suite forces enable_file_scanner_v2, and ordinary Hive ORC ranges are eligible for V2, but the guard you rely on here is enforced only by the legacy be/src/format/orc/vorc_reader.cpp path. In the V2 path, be/src/format_v2/orc/orc_reader.cpp::_init_search_argument_from_local_filters() just returns OK when has_pushdown is false and never checks check_orc_init_sargs_success. These assertions can therefore pass via normal row filtering even if the V2 SARG/min-max pruning path was not initialized. Please either make the V2 ORC reader honor this session variable, or assert V2-specific profile evidence such as UseScannerV2=true plus SearchArgument/stripe-pruning activity.

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: The refactored ORC reader lacked focused Hive external-table regression coverage for SARG conversion across null-safe, integer min/max, decimal, date, and timestamp predicates. It also lacked explicit Reader V2 coverage for lazy materialization result integrity, Hive ACID delete predicates, and virtual row-id planning. Add focused assertions and force FileScannerV2 in the relevant suites while preserving existing generated result files.

### Release note

None

### Check List (For Author)

- Test: Regression test
    - Ran ./run-regression-test.sh --run -d external_table_p0/hive -s test_hive_orc_predicate,test_orc_lazy_mat_profile,test_transactional_hive,test_hive_topn_lazy_mat
    - Verified all four suites load successfully; Hive external execution was not enabled in the local configuration
- Behavior changed: No
- Does this need documentation: No
@xylaaaaa xylaaaaa force-pushed the codex/orc-v2-hive-regression branch from 5bbdf3f to 4f97c46 Compare July 12, 2026 04:51
@xylaaaaa

Copy link
Copy Markdown
Contributor Author

run buildall

@hello-stephen

Copy link
Copy Markdown
Contributor

BE UT Coverage Report

Increment line coverage 14.29% (2/14) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 56.90% (23542/41373)
Line Coverage 40.56% (230186/567454)
Region Coverage 36.47% (181882/498744)
Branch Coverage 37.54% (81191/216287)

@hello-stephen

Copy link
Copy Markdown
Contributor

BE Regression && UT Coverage Report

Increment line coverage 14.29% (2/14) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 74.72% (30163/40368)
Line Coverage 58.70% (331022/563892)
Region Coverage 55.53% (277998/500640)
Branch Coverage 56.77% (122834/216365)

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-H: Total hot run time: 29432 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpch-tools
Tpch sf100 test result on commit 4f97c467a1245ab291ca44b5c7a060f1b0bc8122, data reload: false

------ Round 1 ----------------------------------
============================================
q1	17838	4184	3975	3975
q2	2008	324	196	196
q3	10279	1432	833	833
q4	4681	481	337	337
q5	7531	859	572	572
q6	208	180	138	138
q7	801	836	618	618
q8	10038	1618	1562	1562
q9	6100	4397	4382	4382
q10	6820	1777	1515	1515
q11	507	351	308	308
q12	709	555	428	428
q13	18114	3353	2719	2719
q14	273	266	244	244
q15	q16	786	770	711	711
q17	947	957	1014	957
q18	6883	5646	5675	5646
q19	1340	1262	1032	1032
q20	782	622	566	566
q21	5684	2581	2403	2403
q22	422	351	290	290
Total cold run time: 102751 ms
Total hot run time: 29432 ms

----- Round 2, with runtime_filter_mode=off -----
============================================
q1	4520	4418	4484	4418
q2	310	338	218	218
q3	4638	4966	4454	4454
q4	2140	2213	1359	1359
q5	4558	4351	4447	4351
q6	250	183	132	132
q7	2202	1928	1630	1630
q8	2687	2270	2257	2257
q9	7945	7885	8005	7885
q10	4727	4739	4245	4245
q11	609	425	559	425
q12	776	805	560	560
q13	3231	3652	2882	2882
q14	291	312	273	273
q15	q16	731	751	651	651
q17	1379	1329	1352	1329
q18	8348	7394	6980	6980
q19	1082	1053	1080	1053
q20	2223	2208	1932	1932
q21	5322	4724	4516	4516
q22	522	472	411	411
Total cold run time: 58491 ms
Total hot run time: 51961 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
TPC-DS: Total hot run time: 180139 ms
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/tpcds-tools
TPC-DS sf100 test result on commit 4f97c467a1245ab291ca44b5c7a060f1b0bc8122, data reload: false

query5	4308	635	488	488
query6	471	216	193	193
query7	4837	539	354	354
query8	335	187	187	187
query9	8779	4094	4068	4068
query10	485	354	293	293
query11	5920	2360	2137	2137
query12	161	102	108	102
query13	1285	609	431	431
query14	6247	5255	5006	5006
query14_1	4270	4350	4270	4270
query15	215	202	182	182
query16	990	436	423	423
query17	1109	713	562	562
query18	2423	454	333	333
query19	206	182	146	146
query20	110	103	105	103
query21	231	159	137	137
query22	13555	13687	13417	13417
query23	17284	16660	16192	16192
query23_1	16251	16442	16314	16314
query24	7428	1776	1307	1307
query24_1	1316	1320	1274	1274
query25	571	466	395	395
query26	1335	365	209	209
query27	2612	595	386	386
query28	4488	2012	2046	2012
query29	1096	635	489	489
query30	336	265	233	233
query31	1120	1111	993	993
query32	117	63	64	63
query33	536	344	263	263
query34	1370	1080	644	644
query35	776	811	669	669
query36	1409	1442	1218	1218
query37	154	106	96	96
query38	1875	1694	1630	1630
query39	928	913	883	883
query39_1	903	877	890	877
query40	244	159	143	143
query41	70	70	67	67
query42	93	93	91	91
query43	320	332	283	283
query44	1426	788	779	779
query45	210	187	178	178
query46	1087	1214	775	775
query47	2394	2316	2230	2230
query48	407	421	268	268
query49	585	422	316	316
query50	1031	451	344	344
query51	10955	10844	10719	10719
query52	86	82	73	73
query53	276	274	204	204
query54	273	225	236	225
query55	80	68	70	68
query56	292	292	280	280
query57	1428	1414	1307	1307
query58	279	261	260	260
query59	1561	1609	1455	1455
query60	300	274	244	244
query61	148	145	144	144
query62	680	651	584	584
query63	238	205	205	205
query64	2796	1042	878	878
query65	4814	4794	4757	4757
query66	1878	517	379	379
query67	29550	29315	29294	29294
query68	3136	1658	975	975
query69	407	299	278	278
query70	1091	961	987	961
query71	356	335	316	316
query72	3000	2662	2376	2376
query73	830	769	442	442
query74	5087	4939	4738	4738
query75	2596	2573	2214	2214
query76	2313	1166	747	747
query77	349	382	283	283
query78	12337	12360	11655	11655
query79	1316	1163	768	768
query80	647	553	453	453
query81	462	315	289	289
query82	580	161	124	124
query83	399	319	285	285
query84	279	159	129	129
query85	899	595	494	494
query86	359	290	296	290
query87	1829	1822	1750	1750
query88	3697	2832	2809	2809
query89	437	408	353	353
query90	1958	204	194	194
query91	199	187	158	158
query92	62	62	57	57
query93	1550	1519	995	995
query94	528	376	311	311
query95	781	581	454	454
query96	994	802	352	352
query97	2708	2677	2537	2537
query98	211	204	206	204
query99	1133	1157	1014	1014
Total cold run time: 264193 ms
Total hot run time: 180139 ms

@hello-stephen

Copy link
Copy Markdown
Contributor
ClickBench: Total hot run time: 24.88 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit 4f97c467a1245ab291ca44b5c7a060f1b0bc8122, data reload: false

query1	0.01	0.01	0.01
query2	0.10	0.05	0.04
query3	0.29	0.14	0.13
query4	1.62	0.13	0.14
query5	0.24	0.22	0.22
query6	1.25	1.03	1.04
query7	0.04	0.00	0.01
query8	0.06	0.04	0.04
query9	0.37	0.31	0.31
query10	0.56	0.53	0.56
query11	0.19	0.14	0.14
query12	0.18	0.15	0.14
query13	0.48	0.46	0.48
query14	1.00	1.02	1.01
query15	0.62	0.59	0.59
query16	0.33	0.33	0.32
query17	1.15	1.17	1.12
query18	0.24	0.21	0.21
query19	2.05	1.96	1.94
query20	0.02	0.01	0.02
query21	15.43	0.20	0.12
query22	4.96	0.06	0.05
query23	16.17	0.32	0.12
query24	2.96	0.43	0.32
query25	0.11	0.05	0.04
query26	0.75	0.21	0.15
query27	0.04	0.04	0.04
query28	3.51	0.87	0.55
query29	12.49	4.06	3.20
query30	0.28	0.15	0.15
query31	2.77	0.60	0.31
query32	3.21	0.60	0.48
query33	3.17	3.15	3.19
query34	15.67	4.23	3.50
query35	3.59	3.54	3.55
query36	0.54	0.44	0.41
query37	0.08	0.07	0.06
query38	0.05	0.04	0.04
query39	0.04	0.03	0.03
query40	0.17	0.16	0.14
query41	0.10	0.03	0.03
query42	0.04	0.03	0.03
query43	0.04	0.04	0.04
Total cold run time: 96.97 s
Total hot run time: 24.88 s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants