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

[chore] remove duplicate code in schema scanner #40456

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

Vallishp
Copy link
Contributor

@Vallishp Vallishp commented Sep 5, 2024

Proposed changes

Issue Number: close #xxx

remove duplicate code in schema scanner

@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 Sep 5, 2024

run buildall

Copy link
Contributor

@dataroaring dataroaring left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

github-actions bot commented Sep 5, 2024

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 Sep 5, 2024
Copy link
Contributor

github-actions bot commented Sep 5, 2024

PR approved by anyone and no changes requested.

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	18005	4565	4416	4416
q2	2866	198	186	186
q3	11237	1156	1112	1112
q4	10251	847	768	768
q5	7824	2950	2908	2908
q6	230	145	140	140
q7	994	637	602	602
q8	9513	2048	2078	2048
q9	7261	6594	6592	6592
q10	6995	2218	2267	2218
q11	453	244	243	243
q12	398	216	220	216
q13	17768	3064	3038	3038
q14	289	233	237	233
q15	546	498	473	473
q16	518	431	426	426
q17	979	755	734	734
q18	7406	7031	6909	6909
q19	1393	1015	1100	1015
q20	672	329	344	329
q21	3938	3046	2948	2948
q22	1119	1017	1028	1017
Total cold run time: 110655 ms
Total hot run time: 38571 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4368	4339	4346	4339
q2	392	281	270	270
q3	2858	2705	2650	2650
q4	1917	1667	1674	1667
q5	5471	5393	5410	5393
q6	221	131	129	129
q7	2130	1728	1715	1715
q8	3210	3363	3364	3363
q9	8466	8415	8400	8400
q10	3418	3173	3202	3173
q11	600	489	499	489
q12	792	626	594	594
q13	10884	3073	3073	3073
q14	304	277	284	277
q15	534	482	468	468
q16	521	475	465	465
q17	1812	1494	1489	1489
q18	7651	7503	7528	7503
q19	1689	1527	1428	1428
q20	2064	1821	1830	1821
q21	5386	5301	5151	5151
q22	1117	1016	1033	1016
Total cold run time: 65805 ms
Total hot run time: 54873 ms

@doris-robot
Copy link

TPC-DS: Total hot run time: 187488 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 4cc0e3fab2c1994814e1c3c5c2198c46ae2b4d78, data reload: false

query1	916	370	368	368
query2	6483	1873	1848	1848
query3	6649	206	215	206
query4	28027	23250	23247	23247
query5	4149	519	492	492
query6	261	180	157	157
query7	4599	292	291	291
query8	268	211	227	211
query9	8668	2455	2460	2455
query10	453	278	263	263
query11	16732	14942	14988	14942
query12	153	105	101	101
query13	1628	386	372	372
query14	9738	7367	7213	7213
query15	259	167	164	164
query16	7345	442	479	442
query17	1600	562	540	540
query18	1932	281	277	277
query19	334	147	146	146
query20	123	108	111	108
query21	217	104	102	102
query22	4547	4212	4203	4203
query23	33946	33486	33442	33442
query24	11043	2946	2864	2864
query25	618	371	393	371
query26	918	157	152	152
query27	2314	275	277	275
query28	7069	2033	2029	2029
query29	729	427	406	406
query30	309	154	149	149
query31	980	730	788	730
query32	100	56	57	56
query33	756	274	284	274
query34	999	463	488	463
query35	856	709	748	709
query36	1127	955	884	884
query37	145	88	89	88
query38	3958	3839	3817	3817
query39	1436	1394	1389	1389
query40	193	118	114	114
query41	45	46	46	46
query42	115	98	95	95
query43	503	469	463	463
query44	1241	764	728	728
query45	191	164	164	164
query46	1092	730	707	707
query47	1913	1807	1837	1807
query48	370	293	304	293
query49	1128	431	441	431
query50	800	394	413	394
query51	7010	6919	6784	6784
query52	99	85	85	85
query53	250	185	182	182
query54	916	445	446	445
query55	78	75	75	75
query56	272	264	259	259
query57	1179	1050	1049	1049
query58	245	232	246	232
query59	2957	2791	2698	2698
query60	292	270	268	268
query61	101	101	104	101
query62	853	656	663	656
query63	212	184	185	184
query64	4259	696	655	655
query65	3220	3162	3155	3155
query66	1425	359	340	340
query67	15718	15556	15241	15241
query68	3545	593	569	569
query69	448	284	284	284
query70	1173	1032	1084	1032
query71	333	268	270	268
query72	6233	4003	4002	4002
query73	742	330	324	324
query74	9211	8792	8858	8792
query75	3430	2689	2645	2645
query76	2056	1007	974	974
query77	469	315	305	305
query78	10985	10128	9205	9205
query79	1031	536	534	534
query80	691	495	501	495
query81	466	235	228	228
query82	245	142	143	142
query83	170	158	153	153
query84	234	78	76	76
query85	682	288	363	288
query86	302	298	296	296
query87	4349	4218	4250	4218
query88	2962	2327	2295	2295
query89	374	282	274	274
query90	1948	201	199	199
query91	132	105	105	105
query92	62	49	50	49
query93	1033	544	539	539
query94	777	296	291	291
query95	355	256	248	248
query96	580	259	257	257
query97	3227	3051	3088	3051
query98	216	212	198	198
query99	1486	1255	1258	1255
Total cold run time: 279008 ms
Total hot run time: 187488 ms

@doris-robot
Copy link

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

query1	0.05	0.04	0.04
query2	0.08	0.04	0.04
query3	0.22	0.05	0.05
query4	1.68	0.09	0.08
query5	0.51	0.49	0.48
query6	1.12	0.73	0.74
query7	0.02	0.01	0.01
query8	0.05	0.04	0.05
query9	0.55	0.49	0.50
query10	0.56	0.57	0.54
query11	0.16	0.12	0.12
query12	0.14	0.12	0.12
query13	0.60	0.59	0.59
query14	1.38	1.44	1.46
query15	0.83	0.84	0.82
query16	0.36	0.38	0.38
query17	1.02	1.05	1.08
query18	0.20	0.19	0.20
query19	1.90	1.88	1.86
query20	0.02	0.01	0.00
query21	15.42	0.68	0.65
query22	4.55	6.71	1.96
query23	18.27	1.28	1.21
query24	2.05	0.22	0.21
query25	0.15	0.08	0.07
query26	0.26	0.18	0.18
query27	0.08	0.08	0.07
query28	13.29	1.02	0.99
query29	12.64	3.36	3.31
query30	0.24	0.06	0.06
query31	2.86	0.39	0.39
query32	3.26	0.48	0.47
query33	2.95	2.97	3.02
query34	17.06	4.37	4.37
query35	4.49	4.48	4.49
query36	0.66	0.48	0.46
query37	0.18	0.16	0.16
query38	0.16	0.16	0.15
query39	0.05	0.03	0.04
query40	0.17	0.13	0.13
query41	0.10	0.05	0.05
query42	0.06	0.05	0.05
query43	0.05	0.04	0.04
Total cold run time: 110.45 s
Total hot run time: 31.53 s

@doris-robot
Copy link

TeamCity be ut coverage result:
Function Coverage: 36.78% (9378/25500)
Line Coverage: 28.20% (77281/274047)
Region Coverage: 27.61% (39923/144578)
Branch Coverage: 24.25% (20313/83754)
Coverage Report: http://coverage.selectdb-in.cc/coverage/4cc0e3fab2c1994814e1c3c5c2198c46ae2b4d78_4cc0e3fab2c1994814e1c3c5c2198c46ae2b4d78/report/index.html

@yiguolei yiguolei merged commit c6f5fcd into apache:master Sep 6, 2024
22 of 29 checks passed
dataroaring pushed a commit that referenced this pull request Sep 11, 2024
…#40153) (#40636)

## Proposed changes

#40568
#40455
#40456
#40153


Test:
2024-09-10 14:46:14.206 INFO [suite-thread-1] (SuiteContext.groovy:299)
- Create new connection for user 'partitions_user'
2024-09-10 14:46:14.214 INFO [suite-thread-1] (Suite.groovy:1162) -
Execute tag: select_check_5, sql: select
TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME,PARTITION_NAME,SUBPARTITION_NAME,PARTITION_ORDINAL_POSITION,SUBPARTITION_ORDINAL_POSITION,PARTITION_METHOD,SUBPARTITION_METHOD,PARTITION_EXPRESSION,SUBPARTITION_EXPRESSION,PARTITION_DESCRIPTION,TABLE_ROWS,AVG_ROW_LENGTH,DATA_LENGTH,MAX_DATA_LENGTH,INDEX_LENGTH,DATA_FREE,CHECKSUM,PARTITION_COMMENT,NODEGROUP,TABLESPACE_NAME
from information_schema.partitions where
table_schema="test_partitions_schema_db" order by
TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME,PARTITION_NAME,SUBPARTITION_NAME,PARTITION_ORDINAL_POSITION,SUBPARTITION_ORDINAL_POSITION,PARTITION_METHOD,SUBPARTITION_METHOD,PARTITION_EXPRESSION,SUBPARTITION_EXPRESSION,PARTITION_DESCRIPTION,TABLE_ROWS,AVG_ROW_LENGTH,DATA_LENGTH,MAX_DATA_LENGTH,INDEX_LENGTH,DATA_FREE,CHECKSUM,PARTITION_COMMENT,NODEGROUP,TABLESPACE_NAME
2024-09-10 14:46:14.245 INFO [suite-thread-1] (SuiteContext.groovy:309)
- Recover original connection
2024-09-10 14:46:14.246 INFO [suite-thread-1] (ScriptContext.groovy:120)
- Run test_partitions_schema in
/root/doris/workspace/doris/regression-test/suites/query_p0/system/test_partitions_schema.groovy
succeed
2024-09-10 14:46:14.252 INFO [main] (RegressionTest.groovy:259) - Start
to run single scripts
2024-09-10 14:47:03.655 INFO [main] (RegressionTest.groovy:380) -
Success suites:

/root/doris/workspace/doris/regression-test/suites/query_p0/system/test_partitions_schema.groovy:
group=default,p0, name=test_partitions_schema
2024-09-10 14:47:03.656 INFO [main] (RegressionTest.groovy:459) - All
suites success.
 ____   _    ____ ____  _____ ____
|  _ \ / \  / ___/ ___|| ____|  _ \
| |_) / _ \ \___ \___ \|  _| | | | |
|  __/ ___ \ ___) |__) | |___| |_| |
|_| /_/   \_\____/____/|_____|____/

2024-09-10 14:47:03.656 INFO [main] (RegressionTest.groovy:410) - Test 1
suites, failed 0 suites, fatal 0 scripts, skipped 0 scripts

2024-09-10 14:49:48.239 INFO [suite-thread-2] (Suite.groovy:1162) -
Execute tag: sql, sql: select * from triggers
2024-09-10 14:49:48.261 INFO [suite-thread-2] (Suite.groovy:1162) -
Execute tag: sql, sql: select * from parameters
2024-09-10 14:49:48.280 INFO [suite-thread-2] (Suite.groovy:1162) -
Execute tag: sql, sql: select * from profiling
2024-09-10 14:49:48.294 INFO [suite-thread-2] (ScriptContext.groovy:120)
- Run test_query_sys_tables in
/root/doris/workspace/doris/regression-test/suites/query_p0/system/test_query_sys_tables.groovy
succeed
2024-09-10 14:49:58.800 INFO [main] (RegressionTest.groovy:259) - Start
to run single scripts
2024-09-10 14:50:48.173 INFO [main] (RegressionTest.groovy:380) -
Success suites:

/root/doris/workspace/doris/regression-test/suites/nereids_p0/system/test_query_sys_tables.groovy:
group=query,p0, name=test_query_sys_tables

/root/doris/workspace/doris/regression-test/suites/query_p0/system/test_query_sys_tables.groovy:
group=query,p0, name=test_query_sys_tables
2024-09-10 14:50:48.174 INFO [main] (RegressionTest.groovy:459) - All
suites success.
 ____   _    ____ ____  _____ ____
|  _ \ / \  / ___/ ___|| ____|  _ \
| |_) / _ \ \___ \___ \|  _| | | | |
|  __/ ___ \ ___) |__) | |___| |_| |
|_| /_/   \_\____/____/|_____|____/

2024-09-10 14:50:48.175 INFO [main] (RegressionTest.groovy:410) - Test 2
suites, failed 0 suites, fatal 0 scripts, skipped 0 scripts
2024-09-10 14:50:48.175 INFO [main] (RegressionTest.groovy:119) - Test
finished

---------

Co-authored-by: Mingyu Chen <[email protected]>
@Vallishp Vallishp deleted the remove_duplicate_code branch September 11, 2024 18:55
yiguolei pushed a commit that referenced this pull request Sep 12, 2024
#40687)

backport
#40568
#40455
#40456
#40153
#34384

Test result:
2024-09-11 11:00:45.618 INFO [suite-thread-1] (SuiteContext.groovy:309)
- Recover original connection
2024-09-11 11:00:45.619 INFO [suite-thread-1] (Suite.groovy:359) -
Execute sql: REVOKE SELECT_PRIV ON
test_partitions_schema_db.duplicate_table FROM partitions_user
2024-09-11 11:00:45.625 INFO [suite-thread-1] (SuiteContext.groovy:299)
- Create new connection for user 'partitions_user'
2024-09-11 11:00:45.632 INFO [suite-thread-1] (Suite.groovy:1162) -
Execute tag: select_check_5, sql: select
TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME,PARTITION_NAME,SUBPARTITION_NAME,PARTITION_ORDINAL_POSITION,SUBPARTITION_ORDINAL_POSITION,PARTITION_METHOD,SUBPARTITION_METHOD,PARTITION_EXPRESSION,SUBPARTITION_EXPRESSION,PARTITION_DESCRIPTION,TABLE_ROWS,AVG_ROW_LENGTH,DATA_LENGTH,MAX_DATA_LENGTH,INDEX_LENGTH,DATA_FREE,CHECKSUM,PARTITION_COMMENT,NODEGROUP,TABLESPACE_NAME
from information_schema.partitions where
table_schema="test_partitions_schema_db" order by
TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME,PARTITION_NAME,SUBPARTITION_NAME,PARTITION_ORDINAL_POSITION,SUBPARTITION_ORDINAL_POSITION,PARTITION_METHOD,SUBPARTITION_METHOD,PARTITION_EXPRESSION,SUBPARTITION_EXPRESSION,PARTITION_DESCRIPTION,TABLE_ROWS,AVG_ROW_LENGTH,DATA_LENGTH,MAX_DATA_LENGTH,INDEX_LENGTH,DATA_FREE,CHECKSUM,PARTITION_COMMENT,NODEGROUP,TABLESPACE_NAME
2024-09-11 11:00:45.644 INFO [suite-thread-1] (SuiteContext.groovy:309)
- Recover original connection
2024-09-11 11:00:45.645 INFO [suite-thread-1] (ScriptContext.groovy:120)
- Run test_partitions_schema in
/root/doris/workspace/doris/regression-test/suites/query_p0/system/test_partitions_schema.groovy
succeed
2024-09-11 11:00:45.652 INFO [main] (RegressionTest.groovy:259) - Start
to run single scripts
2024-09-11 11:01:10.321 INFO [main] (RegressionTest.groovy:380) -
Success suites:

/root/doris/workspace/doris/regression-test/suites/query_p0/system/test_partitions_schema.groovy:
group=default,p0, name=test_partitions_schema
2024-09-11 11:01:10.322 INFO [main] (RegressionTest.groovy:459) - All
suites success.
 ____   _    ____ ____  _____ ____
|  _ \ / \  / ___/ ___|| ____|  _ \
| |_) / _ \ \___ \___ \|  _| | | | |
|  __/ ___ \ ___) |__) | |___| |_| |
|_| /_/   \_\____/____/|_____|____/

2024-09-11 11:01:10.322 INFO [main] (RegressionTest.groovy:410) - Test 1
suites, failed 0 suites, fatal 0 scripts, skipped 0 scripts
2024-09-11 11:01:10.322 INFO [main] (RegressionTest.groovy:119) - Test
finished


2024-09-11 11:03:00.712 INFO [suite-thread-1] (Suite.groovy:1162) -
Execute tag: select_check_5, sql: select * from
information_schema.table_options ORDER BY
TABLE_CATALOG,TABLE_SCHEMA,TABLE_NAME,TABLE_MODEL,TABLE_MODEL_KEY,DISTRIBUTE_KEY,DISTRIBUTE_TYPE,BUCKETS_NUM,PARTITION_NUM;
2024-09-11 11:03:00.729 INFO [suite-thread-1] (SuiteContext.groovy:309)
- Recover original connection
2024-09-11 11:03:00.731 INFO [suite-thread-1] (ScriptContext.groovy:120)
- Run test_table_options in
/root/doris/workspace/doris/regression-test/suites/query_p0/system/test_table_options.groovy
succeed
2024-09-11 11:03:04.817 INFO [main] (RegressionTest.groovy:259) - Start
to run single scripts
2024-09-11 11:03:28.741 INFO [main] (RegressionTest.groovy:380) -
Success suites:

/root/doris/workspace/doris/regression-test/suites/query_p0/system/test_table_options.groovy:
group=default,p0, name=test_table_options
2024-09-11 11:03:28.742 INFO [main] (RegressionTest.groovy:459) - All
suites success.
 ____   _    ____ ____  _____ ____
|  _ \ / \  / ___/ ___|| ____|  _ \
| |_) / _ \ \___ \___ \|  _| | | | |
|  __/ ___ \ ___) |__) | |___| |_| |
|_| /_/   \_\____/____/|_____|____/

2024-09-11 11:03:28.742 INFO [main] (RegressionTest.groovy:410) - Test 1
suites, failed 0 suites, fatal 0 scripts, skipped 0 scripts
2024-09-11 11:03:28.742 INFO [main] (RegressionTest.groovy:119) - Test
finished


*************************** 7. row ***************************
             PartitionId: 18035
           PartitionName: p100
          VisibleVersion: 2
      VisibleVersionTime: 2024-09-11 10:59:28
                   State: NORMAL
            PartitionKey: col_1
Range: [types: [INT]; keys: [83647]; ..types: [INT]; keys: [2147483647];
)
         DistributionKey: pk
                 Buckets: 10
          ReplicationNum: 1
           StorageMedium: HDD
            CooldownTime: 9999-12-31 15:59:59
     RemoteStoragePolicy: 
LastConsistencyCheckTime: NULL
                DataSize: 2.872 KB
              IsInMemory: false
       ReplicaAllocation: tag.location.default: 1
               IsMutable: true
      SyncWithBaseTables: true
            UnsyncTables: NULL
        CommittedVersion: 2
                RowCount: 4
7 rows in set (0.01 sec)

---------

Co-authored-by: Mingyu Chen <[email protected]>
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.7-merged dev/3.0.2-merged reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants