Skip to content

Conversation

@Vallishp
Copy link
Contributor

@Vallishp Vallishp commented Nov 4, 2024

What problem does this PR solve?

support drop role command in nereids

Issue Number: close #42618

Related PR: #

Problem Summary:

Check List (For Committer)

  • 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 colde files have been changed.
      • Other reason

test_grant_priv.groovy already cover it.
2024-11-04 15:47:00.905 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: drop role if exists test_grant_priv_role1
2024-11-04 15:47:00.908 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: DROP DATABASE IF EXISTS test_grant_priv_db
2024-11-04 15:47:00.913 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: CREATE DATABASE test_grant_priv_db
2024-11-04 15:47:00.921 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: CREATE ROLE test_grant_priv_role1
2024-11-04 15:47:00.928 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: CREATE USER 'test_grant_priv_user1' IDENTIFIED BY '123456'
2024-11-04 15:47:00.938 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: CREATE USER 'test_grant_priv_user2' IDENTIFIED BY '123456'
2024-11-04 15:47:00.946 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: grant select_priv on test_grant_priv_db.* to test_grant_priv_user1
2024-11-04 15:47:00.969 INFO [suite-thread-1] (SuiteContext.groovy:299) - Create new connection for user 'test_grant_priv_user1' to 'jdbc:mysql://127.0.0.1:9030/test_grant_priv_db?'
2024-11-04 15:47:01.016 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: grant select_priv on test_grant_priv_db.* to test_grant_priv_user2
2024-11-04 15:47:01.034 INFO [suite-thread-1] (test_grant_priv.groovy:46) - errCode = 2, detailMessage = Access denied; you need all [Grant_priv, Select_priv] privilege(s) for this operation
2024-11-04 15:47:01.034 INFO [suite-thread-1] (SuiteContext.groovy:309) - Recover original connection to 'jdbc:mysql://127.0.0.1:9030/test_grant_priv_db?'
2024-11-04 15:47:01.035 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: grant grant_priv on test_grant_priv_db.* to test_grant_priv_user1
2024-11-04 15:47:01.042 INFO [suite-thread-1] (SuiteContext.groovy:299) - Create new connection for user 'test_grant_priv_user1' to 'jdbc:mysql://127.0.0.1:9030/test_grant_priv_db?'
2024-11-04 15:47:01.079 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: grant select_priv on test_grant_priv_db.* to test_grant_priv_user2
2024-11-04 15:47:01.090 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: grant load_priv on test_grant_priv_db.* to test_grant_priv_user2
2024-11-04 15:47:01.099 INFO [suite-thread-1] (test_grant_priv.groovy:63) - errCode = 2, detailMessage = Access denied; you need all [Grant_priv, Load_priv] privilege(s) for this operation
2024-11-04 15:47:01.100 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: grant 'test_grant_priv_role1' to test_grant_priv_user2
2024-11-04 15:47:01.116 INFO [suite-thread-1] (test_grant_priv.groovy:70) - errCode = 2, detailMessage = Access denied; you need (at least one of) the (GRANT/REVOKE) privilege(s) for this operation
2024-11-04 15:47:01.116 INFO [suite-thread-1] (SuiteContext.groovy:309) - Recover original connection to 'jdbc:mysql://127.0.0.1:9030/test_grant_priv_db?'
2024-11-04 15:47:01.117 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: grant grant_priv on . to test_grant_priv_user1
2024-11-04 15:47:01.127 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: grant 'test_grant_priv_role1' to test_grant_priv_user2
2024-11-04 15:47:01.139 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: drop user if exists test_grant_priv_user1
2024-11-04 15:47:01.149 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: drop user if exists test_grant_priv_user2
2024-11-04 15:47:01.165 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: drop role if exists test_grant_priv_role1
2024-11-04 15:47:01.172 INFO [suite-thread-1] (Suite.groovy:384) - Execute sql: DROP DATABASE IF EXISTS test_grant_priv_db
2024-11-04 15:47:01.184 INFO [suite-thread-1] (ScriptContext.groovy:120) - Run test_grant_priv in /root/doris/workspace/doris/regression-test/suites/account_p0/test_grant_priv.groovy succeed
2024-11-04 15:47:09.541 INFO [main] (RegressionTest.groovy:281) - Start to run single scripts
2024-11-04 15:48:21.903 INFO [main] (RegressionTest.groovy:410) - Success suites:
/root/doris/workspace/doris/regression-test/suites/account_p0/test_grant_priv.groovy: group=default,p0, name=test_grant_priv

  • Behavior changed:

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

    • No.
    • Yes.
  • Release note

    None

Check List (For Reviewer who merge this PR)

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

@doris-robot
Copy link

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

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@Vallishp
Copy link
Contributor Author

Vallishp commented Nov 4, 2024

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17561	7403	7245	7245
q2	2043	164	161	161
q3	10563	1118	1140	1118
q4	10249	797	828	797
q5	7746	3044	3043	3043
q6	237	144	144	144
q7	1031	591	591	591
q8	9344	1980	1976	1976
q9	6641	6432	6479	6432
q10	7074	2432	2405	2405
q11	471	249	260	249
q12	406	223	209	209
q13	17776	2990	3013	2990
q14	251	211	210	210
q15	596	539	515	515
q16	623	604	602	602
q17	1010	598	541	541
q18	7377	6815	6838	6815
q19	1325	1007	925	925
q20	496	187	182	182
q21	4120	2995	3198	2995
q22	1128	1001	1024	1001
Total cold run time: 108068 ms
Total hot run time: 41146 ms

----- Round 2, with runtime_filter_mode=off -----
q1	7260	7254	7250	7250
q2	324	228	226	226
q3	2964	2790	2804	2790
q4	1925	1670	1694	1670
q5	5450	5510	5453	5453
q6	212	135	135	135
q7	2152	1705	1702	1702
q8	3226	3382	3409	3382
q9	8593	8598	8598	8598
q10	3530	3463	3475	3463
q11	599	493	504	493
q12	763	596	602	596
q13	7466	3031	3008	3008
q14	298	259	259	259
q15	570	521	506	506
q16	679	630	638	630
q17	1830	1611	1595	1595
q18	7867	7555	7511	7511
q19	1672	1646	1439	1439
q20	2066	1799	1800	1799
q21	5430	5262	5151	5151
q22	1099	1022	1010	1010
Total cold run time: 65975 ms
Total hot run time: 58666 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 191308 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 55d5ea6501c9fd6b50d29b7a190e69728d01af0c, data reload: false

query1	991	378	384	378
query2	6524	2062	2088	2062
query3	6797	230	210	210
query4	34461	23729	23556	23556
query5	4280	454	429	429
query6	263	167	170	167
query7	4608	298	284	284
query8	292	221	225	221
query9	9764	2660	2652	2652
query10	474	247	250	247
query11	18275	15316	15313	15313
query12	148	101	101	101
query13	1675	442	417	417
query14	10530	6898	6462	6462
query15	255	179	183	179
query16	8039	480	427	427
query17	1592	586	551	551
query18	2135	297	299	297
query19	375	148	148	148
query20	114	108	109	108
query21	215	102	101	101
query22	4414	4368	4417	4368
query23	35117	33985	34345	33985
query24	11198	2799	2774	2774
query25	686	411	419	411
query26	1365	158	163	158
query27	2874	288	283	283
query28	8173	2458	2454	2454
query29	872	428	448	428
query30	317	163	157	157
query31	1044	817	822	817
query32	90	57	58	57
query33	804	279	277	277
query34	978	522	515	515
query35	897	749	739	739
query36	1079	963	939	939
query37	140	77	73	73
query38	4420	4328	4306	4306
query39	1499	1433	1435	1433
query40	283	104	104	104
query41	51	46	48	46
query42	111	100	94	94
query43	534	490	486	486
query44	1277	821	814	814
query45	193	167	166	166
query46	1130	681	691	681
query47	1978	1846	1856	1846
query48	414	330	329	329
query49	1198	416	390	390
query50	804	405	427	405
query51	7435	7133	7182	7133
query52	105	91	90	90
query53	249	188	181	181
query54	1359	416	426	416
query55	80	79	78	78
query56	279	240	242	240
query57	1303	1210	1160	1160
query58	241	212	234	212
query59	3194	3144	3023	3023
query60	288	238	245	238
query61	103	101	102	101
query62	854	671	680	671
query63	213	192	185	185
query64	5362	635	612	612
query65	3320	3203	3210	3203
query66	1426	309	299	299
query67	16078	15843	15668	15668
query68	5021	570	536	536
query69	438	254	251	251
query70	1205	1150	1087	1087
query71	412	257	249	249
query72	6481	4034	3985	3985
query73	767	362	372	362
query74	10405	9090	8982	8982
query75	3448	2646	2696	2646
query76	2932	981	1031	981
query77	405	263	270	263
query78	10332	9359	9441	9359
query79	1591	600	602	600
query80	980	419	424	419
query81	548	240	238	238
query82	935	124	114	114
query83	206	136	133	133
query84	235	73	69	69
query85	1237	302	305	302
query86	375	306	299	299
query87	4832	4734	4713	4713
query88	3321	2196	2174	2174
query89	392	293	291	291
query90	1933	188	184	184
query91	136	102	104	102
query92	59	49	48	48
query93	1090	551	544	544
query94	854	296	310	296
query95	347	254	250	250
query96	610	285	277	277
query97	2874	2715	2712	2712
query98	206	198	193	193
query99	1548	1326	1294	1294
Total cold run time: 303791 ms
Total hot run time: 191308 ms

@doris-robot
Copy link

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

query1	0.03	0.03	0.03
query2	0.06	0.04	0.03
query3	0.23	0.07	0.06
query4	1.64	0.10	0.10
query5	0.40	0.42	0.42
query6	1.16	0.65	0.66
query7	0.02	0.02	0.02
query8	0.03	0.03	0.03
query9	0.56	0.49	0.51
query10	0.54	0.54	0.59
query11	0.15	0.11	0.11
query12	0.14	0.10	0.11
query13	0.60	0.60	0.60
query14	2.70	2.71	2.72
query15	0.90	0.82	0.83
query16	0.40	0.39	0.42
query17	1.11	1.03	1.06
query18	0.24	0.22	0.22
query19	2.00	1.77	2.02
query20	0.01	0.01	0.00
query21	15.36	0.59	0.58
query22	2.70	1.95	2.35
query23	17.10	0.98	0.92
query24	2.83	2.33	1.62
query25	0.23	0.16	0.12
query26	0.54	0.13	0.13
query27	0.04	0.05	0.04
query28	9.51	1.11	1.08
query29	12.54	3.23	3.20
query30	0.24	0.06	0.06
query31	2.87	0.39	0.39
query32	3.25	0.48	0.46
query33	2.97	3.02	3.04
query34	17.22	4.46	4.42
query35	4.46	4.48	4.49
query36	0.67	0.48	0.48
query37	0.09	0.06	0.05
query38	0.04	0.03	0.04
query39	0.04	0.02	0.02
query40	0.15	0.12	0.13
query41	0.08	0.02	0.02
query42	0.04	0.02	0.02
query43	0.04	0.03	0.03
Total cold run time: 105.93 s
Total hot run time: 33.36 s

@Vallishp Vallishp force-pushed the nereids_drop_role branch 3 times, most recently from 7b59897 to 802f839 Compare November 14, 2024 05:44
@Vallishp
Copy link
Contributor Author

run buildall

1 similar comment
@Vallishp
Copy link
Contributor Author

run buildall

Vallishp and others added 3 commits November 15, 2024 02:04
Co-authored-by: starocean999 <lichi@selectdb.com>
Co-authored-by: starocean999 <lichi@selectdb.com>
@Vallishp
Copy link
Contributor Author

run buildall

Copy link
Contributor

@starocean999 starocean999 left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions github-actions bot added the approved Indicates a PR has been approved by one committer. label Nov 15, 2024
@github-actions
Copy link
Contributor

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

@github-actions
Copy link
Contributor

PR approved by anyone and no changes requested.

@starocean999 starocean999 merged commit 578a940 into apache:master Nov 15, 2024
morningman pushed a commit to morningman/doris that referenced this pull request Jun 24, 2025
morningman pushed a commit to morningman/doris that referenced this pull request Jun 24, 2025
morningman pushed a commit to morningman/doris that referenced this pull request Jun 24, 2025
morrySnow pushed a commit that referenced this pull request Jun 24, 2025
…y trace id #46882 #48942 #50791 #43231 (#52197)

bp #46882 #48942 #50791 #43231

---------

Co-authored-by: yaoxiao <yx136264032@163.com>
Co-authored-by: Vallish Pai <vallishpai@gmail.com>
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/3.1.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement] (nereids)implement DropRoleCommand in nereids

5 participants