Skip to content

[fix](auth)Fix the issue of incorrectly checking base table permissions when querying external views#53786

Merged
starocean999 merged 4 commits intoapache:masterfrom
zddr:hms_view_auth
Jul 24, 2025
Merged

[fix](auth)Fix the issue of incorrectly checking base table permissions when querying external views#53786
starocean999 merged 4 commits intoapache:masterfrom
zddr:hms_view_auth

Conversation

@zddr
Copy link
Copy Markdown
Contributor

@zddr zddr commented Jul 23, 2025

What problem does this PR solve?

  • Add ViewIf interface.
  • Make View implement ViewIf.
  • Add ExternalView implementing ViewIf.
  • Update LogicalView to use ViewIf instead of View.

Issue Number: close #xxx

Related PR: #xxx

Problem Summary:
Fix the issue of incorrectly checking base table permissions when querying external views

Release note

Fix the issue of incorrectly checking base table permissions when querying external views

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
    • Manual test (add detailed scripts or steps below)
    • No need to test or manual test. Explain why:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

@zddr
Copy link
Copy Markdown
Contributor Author

zddr commented Jul 23, 2025

run buildall

@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?

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Jul 23, 2025
@github-actions
Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@github-actions
Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link
Copy Markdown

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

------ Round 1 ----------------------------------
q1	17558	5240	5100	5100
q2	1937	282	186	186
q3	10302	1301	712	712
q4	10218	990	509	509
q5	7526	2477	2280	2280
q6	175	158	130	130
q7	922	760	594	594
q8	9303	1336	1086	1086
q9	6826	5085	5091	5085
q10	6873	2372	1956	1956
q11	476	284	264	264
q12	339	347	222	222
q13	17765	3680	3096	3096
q14	224	228	217	217
q15	531	481	481	481
q16	421	418	375	375
q17	605	857	367	367
q18	7607	7210	7159	7159
q19	1213	937	564	564
q20	358	331	230	230
q21	3708	3172	2317	2317
q22	1080	1044	977	977
Total cold run time: 105967 ms
Total hot run time: 33907 ms

----- Round 2, with runtime_filter_mode=off -----
q1	5160	5101	5073	5073
q2	242	315	216	216
q3	2187	2629	2324	2324
q4	1343	1786	1355	1355
q5	4249	4524	4545	4524
q6	222	171	131	131
q7	1989	1975	1790	1790
q8	2640	2719	2635	2635
q9	7336	7357	7405	7357
q10	3069	3218	2893	2893
q11	565	513	523	513
q12	697	762	644	644
q13	3556	3998	3359	3359
q14	284	307	285	285
q15	514	505	509	505
q16	449	492	450	450
q17	1198	1616	1377	1377
q18	7897	7729	7671	7671
q19	832	850	833	833
q20	1998	2112	1891	1891
q21	5119	4294	4311	4294
q22	1063	1020	997	997
Total cold run time: 52609 ms
Total hot run time: 51117 ms

@doris-robot
Copy link
Copy Markdown

TPC-DS: Total hot run time: 187553 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 cb44bad640bb744387d6ca713fd48ebef43ad47e, data reload: false

query1	1013	393	422	393
query2	6511	1763	1731	1731
query3	6736	227	223	223
query4	26501	23151	23261	23151
query5	4308	598	509	509
query6	322	223	205	205
query7	4624	497	296	296
query8	297	240	218	218
query9	8598	2836	2831	2831
query10	475	321	282	282
query11	15720	15074	14739	14739
query12	157	112	114	112
query13	1663	533	389	389
query14	8588	5782	5839	5782
query15	203	182	161	161
query16	7135	659	441	441
query17	997	714	572	572
query18	2003	404	305	305
query19	188	198	169	169
query20	126	111	112	111
query21	206	124	108	108
query22	4136	4190	4077	4077
query23	33740	32997	33033	32997
query24	8160	2342	2378	2342
query25	560	503	422	422
query26	1241	276	153	153
query27	2740	500	352	352
query28	4361	2190	2173	2173
query29	774	551	459	459
query30	286	222	189	189
query31	918	809	771	771
query32	83	77	77	77
query33	563	374	328	328
query34	787	839	511	511
query35	793	790	730	730
query36	970	991	937	937
query37	121	114	87	87
query38	4076	4144	4049	4049
query39	1488	1405	1462	1405
query40	219	119	115	115
query41	58	57	53	53
query42	128	110	115	110
query43	499	482	478	478
query44	1375	859	858	858
query45	180	169	165	165
query46	845	1011	640	640
query47	1797	1871	1794	1794
query48	376	429	312	312
query49	709	508	381	381
query50	683	680	417	417
query51	5444	5379	5501	5379
query52	114	114	96	96
query53	226	257	189	189
query54	600	595	529	529
query55	88	88	86	86
query56	319	346	307	307
query57	1200	1206	1132	1132
query58	281	283	272	272
query59	2721	2758	2597	2597
query60	342	340	319	319
query61	136	127	130	127
query62	790	733	676	676
query63	226	188	186	186
query64	4407	1022	753	753
query65	4243	4163	4184	4163
query66	1173	435	415	415
query67	15976	15507	15513	15507
query68	6888	905	575	575
query69	490	316	282	282
query70	1216	1153	1122	1122
query71	420	335	306	306
query72	5791	4865	4869	4865
query73	676	647	356	356
query74	8897	8863	8807	8807
query75	3147	3106	2699	2699
query76	3172	1120	734	734
query77	507	387	321	321
query78	9816	9934	9389	9389
query79	2485	783	579	579
query80	660	533	474	474
query81	481	249	224	224
query82	492	147	112	112
query83	247	248	229	229
query84	296	94	85	85
query85	814	363	330	330
query86	384	322	299	299
query87	4324	4420	4316	4316
query88	3768	2271	2245	2245
query89	387	323	284	284
query90	1861	235	228	228
query91	149	145	110	110
query92	80	75	68	68
query93	1903	982	631	631
query94	725	408	358	358
query95	389	313	316	313
query96	492	577	280	280
query97	2707	2801	2609	2609
query98	232	213	208	208
query99	1525	1422	1272	1272
Total cold run time: 272744 ms
Total hot run time: 187553 ms

@doris-robot
Copy link
Copy Markdown

ClickBench: Total hot run time: 33.1 s
machine: 'aliyun_ecs.c7a.8xlarge_32C64G'
scripts: https://github.com/apache/doris/tree/master/tools/clickbench-tools
ClickBench test result on commit cb44bad640bb744387d6ca713fd48ebef43ad47e, data reload: false

query1	0.04	0.03	0.03
query2	0.08	0.04	0.05
query3	0.24	0.08	0.07
query4	1.63	0.11	0.10
query5	0.44	0.43	0.41
query6	1.16	0.65	0.67
query7	0.02	0.02	0.02
query8	0.05	0.04	0.03
query9	0.59	0.53	0.51
query10	0.57	0.56	0.56
query11	0.16	0.11	0.11
query12	0.15	0.12	0.11
query13	0.63	0.60	0.60
query14	0.79	0.84	0.82
query15	0.90	0.85	0.86
query16	0.39	0.40	0.39
query17	1.02	1.02	1.08
query18	0.21	0.19	0.20
query19	1.90	1.82	1.81
query20	0.01	0.01	0.02
query21	15.40	0.93	0.55
query22	0.78	1.23	0.86
query23	14.78	1.25	0.61
query24	7.07	1.36	0.94
query25	0.51	0.19	0.22
query26	0.61	0.17	0.15
query27	0.06	0.06	0.06
query28	10.15	0.87	0.43
query29	12.55	4.15	3.49
query30	3.08	2.99	2.97
query31	2.83	0.56	0.39
query32	3.23	0.54	0.48
query33	3.03	3.06	3.29
query34	16.17	5.45	4.85
query35	4.88	4.92	4.91
query36	0.70	0.50	0.49
query37	0.09	0.07	0.06
query38	0.05	0.04	0.04
query39	0.03	0.03	0.02
query40	0.17	0.14	0.15
query41	0.08	0.03	0.03
query42	0.03	0.02	0.02
query43	0.05	0.03	0.03
Total cold run time: 107.31 s
Total hot run time: 33.1 s

@zddr
Copy link
Copy Markdown
Contributor Author

zddr commented Jul 24, 2025

run p0

@zddr
Copy link
Copy Markdown
Contributor Author

zddr commented Jul 24, 2025

run cloud_p0

@zddr
Copy link
Copy Markdown
Contributor Author

zddr commented Jul 24, 2025

run p0

@starocean999 starocean999 merged commit d9623e0 into apache:master Jul 24, 2025
35 of 36 checks passed
zddr added a commit to zddr/incubator-doris that referenced this pull request Jul 29, 2025
…ns when querying external views (apache#53786)

- Add ViewIf interface.
- Make View implement ViewIf.
- Add ExternalView implementing ViewIf.
- Update LogicalView to use ViewIf instead of View.

# Conflicts:
#	fe/fe-core/src/main/java/org/apache/doris/catalog/View.java
zddr added a commit to zddr/incubator-doris that referenced this pull request Jul 29, 2025
…ns when querying external views (apache#53786)

- Add ViewIf interface.
- Make View implement ViewIf.
- Add ExternalView implementing ViewIf.
- Update LogicalView to use ViewIf instead of View.

# Conflicts:
#	fe/fe-core/src/main/java/org/apache/doris/catalog/View.java
#	fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindRelation.java
zddr added a commit to zddr/incubator-doris that referenced this pull request Jul 29, 2025
…ns when querying external views (apache#53786)

- Add ViewIf interface.
- Make View implement ViewIf.
- Add ExternalView implementing ViewIf.
- Update LogicalView to use ViewIf instead of View.

# Conflicts:
#	fe/fe-core/src/main/java/org/apache/doris/catalog/View.java
#	fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/BindRelation.java
morrySnow pushed a commit that referenced this pull request Jul 29, 2025
…le permissions when querying external views #53786 (#54000)

picked from #53786
w41ter pushed a commit to w41ter/incubator-doris that referenced this pull request Jul 30, 2025
…ns when querying external views (apache#53786)

- Add ViewIf interface.
- Make View implement ViewIf.
- Add ExternalView implementing ViewIf.
- Update LogicalView to use ViewIf instead of View.
yiguolei pushed a commit that referenced this pull request Aug 1, 2025
…e permissio… (#54005)

…ns when querying external views (#53786)

pick: #53786
zhiqiang-hhhh pushed a commit to zhiqiang-hhhh/doris that referenced this pull request Aug 4, 2025
…ns when querying external views (apache#53786)

- Add ViewIf interface.
- Make View implement ViewIf.
- Add ExternalView implementing ViewIf.
- Update LogicalView to use ViewIf instead of View.
dataroaring pushed a commit that referenced this pull request Aug 12, 2025
@gavinchou gavinchou mentioned this pull request Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. dev/2.1.11-merged dev/3.0.8-merged dev/3.1.0-merged p0_w reviewed usercase Important user case type label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants