Skip to content

Conversation

@morningman
Copy link
Contributor

@morningman morningman commented May 8, 2024

Proposed changes

Followup #33610
Refactor the logic of schema cache for external table.
Before, the ExternalSchemaCache only caches the schema(which is List<Column>) of the table.
But actually, some other objects are also being refreshed when schema cache refreshing,
such as partition columns, etc.
So This PR mainly changes:

  1. Add a new class SchemaCacheValue as a parent class for all kinds of cache value in ExternalSchemaCache
  2. It contains List<Column> basically, and sub class can extend from it to add more cached objects.
  3. Move all cached objects into SchemaCacheValue, so that they will be refreshed along with schema together.

Additional:

  1. Remove unused warn log in AcceptListener.java
  2. Fix unclear error msg if trino connector's table does not exist.

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

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

@morningman morningman changed the title [fix](catalog) refactor the schema [fix](catalog) refactor the schema cache for external table May 8, 2024
@morningman
Copy link
Contributor Author

run buildall

@morningman
Copy link
Contributor Author

run buildall

morningman added a commit to morningman/doris that referenced this pull request May 8, 2024
Copy link
Contributor

@zddr zddr 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
Copy link
Contributor

github-actions bot commented May 8, 2024

PR approved by anyone and no changes requested.

@morningman
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	6807	4242	4271	4242
q2	1675	189	192	189
q3	4619	1110	1165	1110
q4	1010	871	816	816
q5	2638	2601	2697	2601
q6	223	137	139	137
q7	1121	764	666	666
q8	2087	2177	2134	2134
q9	6880	6749	6703	6703
q10	9049	4011	3746	3746
q11	450	234	236	234
q12	385	217	219	217
q13	16420	3176	3180	3176
q14	272	227	224	224
q15	531	491	474	474
q16	491	427	400	400
q17	995	665	638	638
q18	8361	7791	7811	7791
q19	3645	1584	1568	1568
q20	667	324	322	322
q21	5062	4067	4117	4067
q22	357	288	285	285
Total cold run time: 73745 ms
Total hot run time: 41740 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4453	4404	4401	4401
q2	383	267	267	267
q3	3025	2749	2697	2697
q4	1888	1597	1611	1597
q5	5313	5354	5344	5344
q6	214	124	122	122
q7	2225	1864	1860	1860
q8	3191	3371	3298	3298
q9	8400	8414	8411	8411
q10	3866	3728	3739	3728
q11	592	484	477	477
q12	748	605	579	579
q13	14688	3012	2946	2946
q14	290	253	253	253
q15	509	491	475	475
q16	472	409	408	408
q17	1796	1482	1468	1468
q18	7647	7557	7359	7359
q19	2516	1616	1551	1551
q20	1998	1769	1734	1734
q21	4955	4895	4932	4895
q22	576	492	514	492
Total cold run time: 69745 ms
Total hot run time: 54362 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 185839 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 2ef7ed893a8bba33cca6427b92fcc2eaeb8db8ec, data reload: false

query1	915	360	345	345
query2	6447	2504	2242	2242
query3	6647	207	207	207
query4	24249	21211	21133	21133
query5	4130	426	409	409
query6	266	190	177	177
query7	4601	290	288	288
query8	248	195	190	190
query9	8448	2379	2382	2379
query10	440	248	270	248
query11	14719	14181	14159	14159
query12	150	91	93	91
query13	1645	375	363	363
query14	10423	7507	8219	7507
query15	249	172	176	172
query16	8149	257	280	257
query17	1721	552	546	546
query18	2081	274	258	258
query19	197	145	145	145
query20	94	87	90	87
query21	202	126	127	126
query22	5007	4827	4784	4784
query23	33705	33045	33153	33045
query24	6744	2845	2855	2845
query25	561	366	359	359
query26	690	152	149	149
query27	2057	313	322	313
query28	3761	2050	2057	2050
query29	844	600	584	584
query30	248	159	151	151
query31	974	740	721	721
query32	87	55	56	55
query33	478	261	257	257
query34	891	481	476	476
query35	769	680	685	680
query36	1053	921	926	921
query37	106	71	71	71
query38	2892	2751	2756	2751
query39	1595	1548	1535	1535
query40	207	128	125	125
query41	47	40	39	39
query42	109	95	98	95
query43	564	533	543	533
query44	1047	714	725	714
query45	268	255	265	255
query46	1064	714	737	714
query47	1980	1877	1890	1877
query48	373	294	300	294
query49	882	404	431	404
query50	776	386	390	386
query51	6792	6778	6792	6778
query52	113	86	94	86
query53	349	277	283	277
query54	546	442	431	431
query55	75	72	72	72
query56	242	226	232	226
query57	1208	1130	1130	1130
query58	230	212	230	212
query59	3557	3168	3081	3081
query60	277	240	241	240
query61	107	106	106	106
query62	600	467	457	457
query63	315	273	276	273
query64	8482	7315	7311	7311
query65	3121	3068	3039	3039
query66	802	358	346	346
query67	15434	14989	14842	14842
query68	8999	541	545	541
query69	595	314	323	314
query70	1344	1203	1046	1046
query71	471	270	269	269
query72	8343	2586	2360	2360
query73	1605	322	320	320
query74	6553	6184	6157	6157
query75	4293	2632	2626	2626
query76	4955	934	961	934
query77	706	274	257	257
query78	10960	10196	10096	10096
query79	8193	511	524	511
query80	1217	446	443	443
query81	509	220	218	218
query82	502	94	94	94
query83	197	164	163	163
query84	262	88	84	84
query85	836	269	255	255
query86	357	316	301	301
query87	3304	3105	3077	3077
query88	4785	2442	2408	2408
query89	532	395	383	383
query90	2072	195	193	193
query91	140	101	96	96
query92	59	51	48	48
query93	6111	522	498	498
query94	1262	183	183	183
query95	392	305	293	293
query96	607	268	266	266
query97	3107	2984	2951	2951
query98	233	218	218	218
query99	1205	817	869	817
Total cold run time: 292756 ms
Total hot run time: 185839 ms

Copy link
Contributor

@Jibing-Li Jibing-Li 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 May 9, 2024
@github-actions
Copy link
Contributor

github-actions bot commented May 9, 2024

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

@morningman morningman merged commit 6802932 into apache:master May 9, 2024
morningman added a commit to morningman/doris that referenced this pull request May 9, 2024
…4517)

Followup apache#33610
Refactor the logic of schema cache for external table.
Before, the ExternalSchemaCache only caches the schema(which is `List<Column>`) of the table.
But actually, some other objects are also being refreshed when schema cache refreshing,
such as `partition columns`, etc.
So This PR mainly changes:

1. Add a new class `SchemaCacheValue` as a parent class for all kinds of cache value in ExternalSchemaCache
2. It contains `List<Column>` basically, and sub class can extend from it to add more cached objects.
3. Move all cached objects into `SchemaCacheValue`, so that they will be refreshed along with schema together.

Additional:
1. Remove unused warn log in AcceptListener.java
2. Fix unclear error msg if trino connector's table does not exist.
morningman added a commit to morningman/doris that referenced this pull request May 9, 2024
…4517)

Followup apache#33610
Refactor the logic of schema cache for external table.
Before, the ExternalSchemaCache only caches the schema(which is `List<Column>`) of the table.
But actually, some other objects are also being refreshed when schema cache refreshing,
such as `partition columns`, etc.
So This PR mainly changes:

1. Add a new class `SchemaCacheValue` as a parent class for all kinds of cache value in ExternalSchemaCache
2. It contains `List<Column>` basically, and sub class can extend from it to add more cached objects.
3. Move all cached objects into `SchemaCacheValue`, so that they will be refreshed along with schema together.

Additional:
1. Remove unused warn log in AcceptListener.java
2. Fix unclear error msg if trino connector's table does not exist.
morningman added a commit to morningman/doris that referenced this pull request May 9, 2024
…4517)

Followup apache#33610
Refactor the logic of schema cache for external table.
Before, the ExternalSchemaCache only caches the schema(which is `List<Column>`) of the table.
But actually, some other objects are also being refreshed when schema cache refreshing,
such as `partition columns`, etc.
So This PR mainly changes:

1. Add a new class `SchemaCacheValue` as a parent class for all kinds of cache value in ExternalSchemaCache
2. It contains `List<Column>` basically, and sub class can extend from it to add more cached objects.
3. Move all cached objects into `SchemaCacheValue`, so that they will be refreshed along with schema together.

Additional:
1. Remove unused warn log in AcceptListener.java
2. Fix unclear error msg if trino connector's table does not exist.
ByteYue pushed a commit to ByteYue/doris that referenced this pull request May 15, 2024
…4517)

Followup apache#33610
Refactor the logic of schema cache for external table.
Before, the ExternalSchemaCache only caches the schema(which is `List<Column>`) of the table.
But actually, some other objects are also being refreshed when schema cache refreshing,
such as `partition columns`, etc.
So This PR mainly changes:

1. Add a new class `SchemaCacheValue` as a parent class for all kinds of cache value in ExternalSchemaCache
2. It contains `List<Column>` basically, and sub class can extend from it to add more cached objects.
3. Move all cached objects into `SchemaCacheValue`, so that they will be refreshed along with schema together.

Additional:
1. Remove unused warn log in AcceptListener.java
2. Fix unclear error msg if trino connector's table does not exist.
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.4-merged dev/3.0.0-merged reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants