Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](JDK17) The objects stored in PriorityQueue must implement the Comparable interface #30625

Merged
merged 1 commit into from
Jan 31, 2024

Conversation

BePPPower
Copy link
Contributor

@BePPPower BePPPower commented Jan 31, 2024

Proposed changes

Issue Number: #30484

The objects stored in PriorityQueue must implement the Comparable interface or passed into the customized Comparator.

If we don't do this, run the program in the JDK17 environment will report an exception:

Caused by: java.lang.AssertionError: Expect exception msg contains 'query wait timeout', but meet
'java.sql.SQLException: ClassCastException,
msg: class org.apache.doris.resource.workloadgroup.QueueToken cannot be cast to class java.lang.Comparable 
(org.apache.doris.resource.workloadgroup.QueueToken is in unnamed module of loader 'app'; java.lang.Comparable is in module java.base of loader 'bootstrap')'

Further comments

If this is a relatively large or complex change, kick off the discussion at dev@doris.apache.org by explaining why you chose the solution you did and what alternatives you considered, etc...

@BePPPower BePPPower mentioned this pull request Jan 31, 2024
7 tasks
@BePPPower
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17732	4413	4426	4413
q2	2030	135	131	131
q3	10604	916	938	916
q4	4641	733	689	689
q5	7672	2787	2852	2787
q6	183	120	119	119
q7	1120	706	701	701
q8	9313	1969	1993	1969
q9	7195	6306	6321	6306
q10	8083	2444	2432	2432
q11	411	209	195	195
q12	748	269	270	269
q13	18007	3302	3286	3286
q14	273	246	249	246
q15	520	484	495	484
q16	457	438	395	395
q17	928	540	487	487
q18	6797	5849	6023	5849
q19	1559	1343	1302	1302
q20	612	314	317	314
q21	6548	3105	3080	3080
q22	815	296	292	292
Total cold run time: 106248 ms
Total hot run time: 36662 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4469	4374	4260	4260
q2	322	224	227	224
q3	2994	2858	2792	2792
q4	1831	1647	1643	1643
q5	5208	5194	5208	5194
q6	188	115	116	115
q7	2149	1790	1719	1719
q8	3066	3198	3259	3198
q9	8367	8297	8229	8229
q10	5855	3578	3581	3578
q11	509	481	432	432
q12	770	571	584	571
q13	12615	3194	3224	3194
q14	281	258	279	258
q15	531	487	504	487
q16	512	478	468	468
q17	1850	1673	1690	1673
q18	7976	7637	7596	7596
q19	10352	1510	1525	1510
q20	2117	1905	1890	1890
q21	4587	4609	4517	4517
q22	567	483	492	483
Total cold run time: 77116 ms
Total hot run time: 54031 ms

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

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

Copy link
Contributor

PR approved by anyone and no changes requested.

@doris-robot
Copy link

TPC-DS: Total hot run time: 173057 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 651d9bafc2dc5053cbdf6103692b95f183f45b6f, data reload: false

query1	933	326	317	317
query2	6584	1877	1892	1877
query3	6689	201	193	193
query4	27518	22056	22080	22056
query5	4443	399	420	399
query6	248	168	152	152
query7	4612	259	259	259
query8	256	173	179	173
query9	8877	2300	2288	2288
query10	414	206	208	206
query11	17072	15349	15381	15349
query12	119	65	66	65
query13	1675	370	388	370
query14	9259	6626	6474	6474
query15	245	173	179	173
query16	6531	260	244	244
query17	1907	473	462	462
query18	1934	260	246	246
query19	166	134	131	131
query20	69	69	66	66
query21	202	130	118	118
query22	5021	4856	4958	4856
query23	30979	30258	30206	30206
query24	11035	2731	2813	2731
query25	535	307	318	307
query26	823	134	139	134
query27	2816	282	281	281
query28	6200	1863	1846	1846
query29	936	634	625	625
query30	281	136	132	132
query31	914	700	715	700
query32	98	47	51	47
query33	595	202	206	202
query34	842	450	460	450
query35	876	763	733	733
query36	1309	1224	1126	1126
query37	94	59	57	57
query38	3291	3192	3181	3181
query39	1306	1255	1263	1255
query40	192	85	79	79
query41	36	35	33	33
query42	86	79	81	79
query43	517	483	474	474
query44	1065	706	707	706
query45	190	172	167	167
query46	1050	636	633	633
query47	1577	1513	1477	1477
query48	388	313	324	313
query49	1109	274	272	272
query50	663	304	309	304
query51	5245	5147	5149	5147
query52	81	80	78	78
query53	338	257	271	257
query54	260	194	179	179
query55	71	77	72	72
query56	173	150	157	150
query57	974	924	905	905
query58	174	153	151	151
query59	2419	2302	2329	2302
query60	193	185	178	178
query61	85	89	80	80
query62	640	364	344	344
query63	282	258	263	258
query64	4215	1721	1724	1721
query65	3300	3210	3205	3205
query66	1130	314	307	307
query67	14270	14455	14484	14455
query68	3985	513	483	483
query69	432	308	307	307
query70	1495	1468	1536	1468
query71	288	203	206	203
query72	3771	2851	2843	2843
query73	685	315	307	307
query74	6463	6247	6201	6201
query75	2834	2321	2340	2321
query76	2990	973	929	929
query77	339	231	224	224
query78	9132	8685	8572	8572
query79	2291	491	493	491
query80	1362	321	309	309
query81	534	196	196	196
query82	683	78	76	76
query83	218	117	116	116
query84	228	73	79	73
query85	2074	323	329	323
query86	504	373	422	373
query87	3439	3244	3256	3244
query88	3705	2204	2207	2204
query89	439	333	354	333
query90	1910	182	182	182
query91	171	114	117	114
query92	50	43	42	42
query93	2073	436	444	436
query94	1321	155	163	155
query95	505	467	452	452
query96	631	321	317	317
query97	4213	4075	4140	4075
query98	206	195	184	184
query99	1048	697	691	691
Total cold run time: 268446 ms
Total hot run time: 173057 ms

@doris-robot
Copy link

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

query1	0.04	0.03	0.03
query2	0.05	0.02	0.02
query3	0.23	0.06	0.06
query4	1.66	0.10	0.10
query5	0.53	0.51	0.51
query6	1.18	0.64	0.64
query7	0.01	0.01	0.02
query8	0.04	0.02	0.02
query9	0.56	0.49	0.50
query10	0.56	0.56	0.54
query11	0.12	0.08	0.09
query12	0.11	0.09	0.09
query13	0.61	0.60	0.61
query14	0.79	0.80	0.80
query15	0.78	0.77	0.77
query16	0.39	0.38	0.37
query17	1.03	1.01	1.02
query18	0.21	0.25	0.25
query19	1.82	1.75	1.77
query20	0.01	0.01	0.01
query21	15.40	0.56	0.55
query22	2.55	2.16	2.15
query23	17.11	0.88	0.78
query24	2.27	0.98	1.25
query25	0.21	0.21	0.20
query26	0.65	0.15	0.13
query27	0.05	0.05	0.05
query28	11.33	0.85	0.82
query29	12.50	3.26	3.27
query30	0.61	0.54	0.54
query31	2.78	0.34	0.34
query32	3.38	0.48	0.48
query33	3.22	3.17	3.23
query34	16.07	4.31	4.23
query35	4.34	4.33	4.30
query36	1.09	1.06	1.05
query37	0.06	0.05	0.05
query38	0.04	0.03	0.03
query39	0.02	0.02	0.01
query40	0.16	0.13	0.13
query41	0.07	0.01	0.02
query42	0.03	0.02	0.02
query43	0.02	0.03	0.02
Total cold run time: 104.69 s
Total hot run time: 31.45 s

@doris-robot
Copy link

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

Load test result on commit 651d9bafc2dc5053cbdf6103692b95f183f45b6f with default session variables
Stream load json:         18 seconds loaded 2358488459 Bytes, about 124 MB/s
Stream load orc:          58 seconds loaded 1101869774 Bytes, about 18 MB/s
Stream load parquet:      31 seconds loaded 861443392 Bytes, about 26 MB/s
Insert into select:       13.5 seconds inserted 10000000 Rows, about 740K ops/s

Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman merged commit b0fccc1 into apache:master Jan 31, 2024
28 of 31 checks passed
yiguolei pushed a commit that referenced this pull request Jan 31, 2024
… `Comparable` interface (#30050) (#30625)

Issue Number:  #30484 

The objects stored in PriorityQueue must implement the Comparable interface or passed into the customized `Comparator`. 

If we don't do this, run the program in the JDK17 environment will report an exception:
```java
Caused by: java.lang.AssertionError: Expect exception msg contains 'query wait timeout', but meet
'java.sql.SQLException: ClassCastException,
msg: class org.apache.doris.resource.workloadgroup.QueueToken cannot be cast to class java.lang.Comparable 
(org.apache.doris.resource.workloadgroup.QueueToken is in unnamed module of loader 'app'; java.lang.Comparable is in module java.base of loader 'bootstrap')'
```
yiguolei pushed a commit that referenced this pull request Jan 31, 2024
… `Comparable` interface (#30050) (#30625)

Issue Number:  #30484 

The objects stored in PriorityQueue must implement the Comparable interface or passed into the customized `Comparator`. 

If we don't do this, run the program in the JDK17 environment will report an exception:
```java
Caused by: java.lang.AssertionError: Expect exception msg contains 'query wait timeout', but meet
'java.sql.SQLException: ClassCastException,
msg: class org.apache.doris.resource.workloadgroup.QueueToken cannot be cast to class java.lang.Comparable 
(org.apache.doris.resource.workloadgroup.QueueToken is in unnamed module of loader 'app'; java.lang.Comparable is in module java.base of loader 'bootstrap')'
```
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. reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants