Skip to content

[enhancement](plsql) Support show procedure and show create procedure… - #31763

Merged
yiguolei merged 1 commit into
apache:masterfrom
Vallishp:plsql_show_proc
Mar 8, 2024
Merged

yiguolei merged 1 commit into
apache:masterfrom
Vallishp:plsql_show_proc

Conversation

@Vallishp

@Vallishp Vallishp commented Mar 4, 2024 •

Copy link
Copy Markdown
Contributor

… (#31297)

Proposed changes

Issue Number: close #31297
Support Plsql framework commands.

  1. SHOW PROCEDURE STATUS
  2. SHOW CREATE PROCEDURE

Further comments

MySQL [(none)]> use mydb;
Database changed
MySQL [mydb]> show procedure status;
+------------------+-----------+-------+-------------+-----------+---------------------+---------------------+
| ProcedureName | CatalogId | DbId | PackageName | OwnerName | CreateTime | ModifyTime |
+------------------+-----------+-------+-------------+-----------+---------------------+---------------------+
| PROCEDURE_SELECT | 0 | 42013 | | root | 2024-03-04 11:58:55 | 2024-03-04 12:01:16 |
+------------------+-----------+-------+-------------+-----------+---------------------+---------------------+
1 row in set (0.15 sec)

MySQL [mydb]> show create procedure procedure_select;
+------------------+---------------------------------------------------------------------------------------------------------------+
| Procedure | Create Procedure |
+------------------+---------------------------------------------------------------------------------------------------------------+
| PROCEDURE_SELECT | CREATE OR REPLACE PROCEDURE procedure_select( IN id_n INT)
BEGIN
select * from plsql_tbl where id = id_n;
END |
+------------------+---------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

MySQL [mydb]>

If this is a relatively large or complex change, kick off the discussion at [email protected] by explaining why you chose the solution you did and what alternatives you considered, etc...

@doris-robot

Copy link
Copy Markdown

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

@Vallishp

Vallishp commented Mar 4, 2024

Copy link
Copy Markdown
Contributor Author

run buildall

@github-actions

github-actions Bot commented Mar 4, 2024

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@Vallishp
Vallishp force-pushed the plsql_show_proc branch 2 times, most recently from 0bcc25c to c9efbd0 Compare March 4, 2024 17:33
@github-actions

github-actions Bot commented Mar 4, 2024

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@doris-robot

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

------ Round 1 ----------------------------------
q1	17656	4110	3995	3995
q2	2021	152	148	148
q3	10546	958	954	954
q4	4658	961	963	961
q5	7627	2852	3013	2852
q6	195	125	128	125
q7	1313	845	829	829
q8	9485	2078	2068	2068
q9	7237	6451	6438	6438
q10	8218	2580	2537	2537
q11	434	218	216	216
q12	762	334	325	325
q13	17962	2904	2938	2904
q14	287	254	266	254
q15	484	445	447	445
q16	462	390	412	390
q17	954	873	826	826
q18	6864	5933	5861	5861
q19	1582	1518	1520	1518
q20	551	278	279	278
q21	7495	3755	3685	3685
q22	790	318	296	296
Total cold run time: 107583 ms
Total hot run time: 37905 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4015	3961	3964	3961
q2	317	222	232	222
q3	2964	2901	2894	2894
q4	1857	1810	1797	1797
q5	5266	5345	5254	5254
q6	200	116	124	116
q7	2270	1823	1832	1823
q8	3217	3279	3270	3270
q9	8487	8494	8497	8494
q10	6107	3747	3702	3702
q11	537	433	444	433
q12	699	539	549	539
q13	11685	2786	2766	2766
q14	278	250	256	250
q15	477	452	444	444
q16	466	419	393	393
q17	1685	1676	1674	1674
q18	7966	7444	7287	7287
q19	5698	1615	1620	1615
q20	1969	1727	1712	1712
q21	4968	4806	4809	4806
q22	563	415	476	415
Total cold run time: 71691 ms
Total hot run time: 53867 ms

@doris-robot

Copy link
Copy Markdown
TPC-DS: Total hot run time: 178274 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 aaa71314d92a90e2a1ec20295825ffcd7a4b7c4c, data reload: false

query1	922	371	328	328
query2	7457	2200	2140	2140
query3	6705	215	208	208
query4	26588	21093	21082	21082
query5	4348	742	550	550
query6	273	183	176	176
query7	4635	324	302	302
query8	235	177	174	174
query9	8460	2183	2165	2165
query10	439	245	244	244
query11	14972	14432	14277	14277
query12	137	94	89	89
query13	1647	442	444	442
query14	8930	6930	7072	6930
query15	243	188	187	187
query16	7245	268	273	268
query17	941	585	573	573
query18	1918	300	289	289
query19	214	172	170	170
query20	98	98	92	92
query21	205	137	132	132
query22	4545	4444	4392	4392
query23	31581	31102	30557	30557
query24	11555	3053	3108	3053
query25	675	391	395	391
query26	1689	173	176	173
query27	3014	368	377	368
query28	6406	1817	1787	1787
query29	1148	630	617	617
query30	308	150	148	148
query31	964	752	729	729
query32	102	68	59	59
query33	768	282	273	273
query34	974	494	475	475
query35	948	798	821	798
query36	938	837	831	831
query37	148	70	70	70
query38	3201	3146	3135	3135
query39	1440	1371	1389	1371
query40	302	126	121	121
query41	63	58	53	53
query42	113	107	108	107
query43	460	432	418	418
query44	1102	742	726	726
query45	211	204	192	192
query46	1072	830	802	802
query47	1645	1539	1562	1539
query48	435	367	353	353
query49	1200	343	348	343
query50	807	390	393	390
query51	6711	6620	6541	6541
query52	106	104	95	95
query53	364	287	293	287
query54	298	263	254	254
query55	99	90	92	90
query56	251	241	232	232
query57	1084	995	1000	995
query58	250	220	228	220
query59	2656	2649	2495	2495
query60	272	263	273	263
query61	119	114	116	114
query62	671	431	434	431
query63	323	287	295	287
query64	6183	3382	3222	3222
query65	3027	3013	3034	3013
query66	1176	327	316	316
query67	15143	14568	14380	14380
query68	11308	554	595	554
query69	712	392	389	389
query70	1378	1133	1134	1133
query71	592	282	290	282
query72	9983	2648	2460	2460
query73	1744	347	344	344
query74	7183	6777	6817	6777
query75	5773	2720	2657	2657
query76	7180	1059	1189	1059
query77	697	273	267	267
query78	10233	9596	9520	9520
query79	10263	527	531	527
query80	897	414	402	402
query81	467	218	204	204
query82	295	93	88	88
query83	220	144	145	144
query84	287	84	82	82
query85	1090	332	332	332
query86	363	280	302	280
query87	3360	3231	3229	3229
query88	3328	2378	2381	2378
query89	537	369	371	369
query90	2024	176	175	175
query91	165	131	131	131
query92	59	51	51	51
query93	4145	530	513	513
query94	1292	192	188	188
query95	444	353	348	348
query96	595	265	263	263
query97	4036	3847	3887	3847
query98	228	218	201	201
query99	1074	766	756	756
Total cold run time: 305111 ms
Total hot run time: 178274 ms

@doris-robot

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

query1	0.04	0.04	0.03
query2	0.06	0.03	0.03
query3	0.23	0.06	0.07
query4	1.68	0.10	0.10
query5	0.51	0.48	0.53
query6	1.27	0.65	0.66
query7	0.02	0.02	0.02
query8	0.04	0.03	0.03
query9	0.57	0.51	0.50
query10	0.57	0.58	0.57
query11	0.14	0.10	0.11
query12	0.13	0.10	0.10
query13	0.58	0.58	0.57
query14	0.74	0.75	0.75
query15	0.83	0.79	0.80
query16	0.38	0.36	0.36
query17	0.99	1.00	0.98
query18	0.26	0.26	0.25
query19	1.83	1.73	1.69
query20	0.02	0.01	0.01
query21	15.40	0.61	0.60
query22	3.32	3.56	2.45
query23	17.76	0.92	0.86
query24	2.18	0.19	0.70
query25	0.22	0.10	0.04
query26	0.20	0.14	0.14
query27	0.03	0.03	0.03
query28	12.16	0.83	0.84
query29	12.67	3.14	3.40
query30	0.62	0.57	0.54
query31	2.81	0.33	0.34
query32	3.38	0.44	0.44
query33	2.92	2.86	2.94
query34	15.51	4.31	4.30
query35	4.29	4.30	4.29
query36	1.08	1.02	1.02
query37	0.07	0.05	0.05
query38	0.04	0.03	0.03
query39	0.02	0.01	0.02
query40	0.16	0.13	0.14
query41	0.07	0.02	0.02
query42	0.02	0.02	0.01
query43	0.03	0.03	0.02
Total cold run time: 105.85 s
Total hot run time: 30.4 s

@doris-robot

Copy link
Copy Markdown

Load test result on machine: 'aliyun_ecs.c7a.8xlarge_32C64G'

Load test result on commit aaa71314d92a90e2a1ec20295825ffcd7a4b7c4c with default session variables
Stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
Stream load orc:          59 seconds loaded 1101869774 Bytes, about 17 MB/s
Stream load parquet:      31 seconds loaded 861443392 Bytes, about 26 MB/s
Insert into select:       18.2 seconds inserted 10000000 Rows, about 549K ops/s


@Override
public void showCreateProcedure(FuncNameInfo procedureName, List<List<String>> columns) {
Map<PlsqlProcedureKey, PlsqlStoredProcedure> allProc = client.getAllPlsqlStoredProcedures();

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.

use client.getPlsqlStoredProcedure(procedureName.getName(), procedureName.getCtlId(), procedureName.getDbId()) instead of getAllPlsqlStoredProcedures
do not get all then check procedureName

try {
SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String createTime = f.format(Calendar.getInstance().getTime());
String modifyTime = f.format(Calendar.getInstance().getTime());

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.

createTime and modifyTime may not be equal because get the current time separately

String modifyTime=createTime seems better

@xinyiZzz

xinyiZzz commented Mar 6, 2024

Copy link
Copy Markdown
Contributor

run buildall

@Vallishp Vallishp changed the title [enhancement][plsql] Support show procedure and show create procedure… [enhancement](plsql) Support show procedure and show create procedure… Mar 6, 2024
@Vallishp

Vallishp commented Mar 6, 2024

Copy link
Copy Markdown
Contributor Author

run buildall

@xinyiZzz

xinyiZzz commented Mar 7, 2024

Copy link
Copy Markdown
Contributor

run p0

@xinyiZzz

xinyiZzz commented Mar 7, 2024

Copy link
Copy Markdown
Contributor

run buildall

2 similar comments
@xinyiZzz

xinyiZzz commented Mar 7, 2024

Copy link
Copy Markdown
Contributor

run buildall

@xinyiZzz

xinyiZzz commented Mar 7, 2024

Copy link
Copy Markdown
Contributor

run buildall

@Vallishp

Vallishp commented Mar 7, 2024

Copy link
Copy Markdown
Contributor Author

run buildall

@xinyiZzz xinyiZzz 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.

LGTM

@github-actions

github-actions Bot commented Mar 8, 2024

Copy link
Copy Markdown
Contributor

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

@github-actions github-actions Bot added approved Indicates a PR has been approved by one committer. reviewed labels Mar 8, 2024
@github-actions

github-actions Bot commented Mar 8, 2024

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@yiguolei
yiguolei merged commit 19cb5a9 into apache:master Mar 8, 2024
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. meta-change reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] plsql support show procedure stmt

4 participants