Skip to content

Conversation

@weizuo93
Copy link
Contributor

Proposed changes

Issue Number: close #xxx

There is column with type date/datetime/decimalwhen create table,but the column type returned from SHOW FULL COLUMNS FROM xxxis dateV2/datetimeV2/decimalv3. For example:

Create table:

CREATE TABLE `test_table` (
  `a` DATETIME NULL,
  `b` DATE NULL,
  `c` DECIMAL(5, 1) NULL,
  `d` INT NULL
) ENGINE=OLAP
DUPLICATE KEY(`a`, `b`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`a`) BUCKETS 4
PROPERTIES (
"replication_allocation" = "tag.location.default: 1",
"storage_format" = "V2"
);

Show columns:

mysql> SHOW FULL COLUMNS FROM test_table;
+-------+-------------------+--------------+------+------+-----------+---------+--------------+--------------+
| Field | Type                    | Collation   | Null | Key  | Default   | Extra   | Privileges  | Comment |
+-------+-------------------+--------------+------+------+-----------+---------+--------------+--------------+
| a         | datetimev2(0)    |                       | YES  | YES  | NULL       |              |                        |                       |
| b         | datev2                   |                       | YES  | YES  | NULL      |              |                        |                       |
| c         | decimalv3(5, 1)  |                       | YES  | NO   | NULL      | NONE |                        |                       |
| d         | int                            |                       | YES  | NO   | NULL      | NONE |                        |                       |
+-------+-------------------+--------------+------+------+-----------+--------+---------------+--------------+
4 rows in set (0.00 sec)

It is necessary to display dateV2/datetimeV2/decimalv3 as date/datetime/decimal in ShowColumnStmt. As follows:

mysql> SHOW FULL COLUMNS FROM test_table;
+-------+-------------------+--------------+------+------+-----------+---------+--------------+--------------+
| Field | Type                    | Collation   | Null | Key  | Default   | Extra   | Privileges  | Comment |
+-------+-------------------+--------------+------+------+-----------+---------+--------------+--------------+
| a     | datetime              |                       | YES  | YES  | NULL       |              |                        |                       |
| b     | date                        |                       | YES  | YES  | NULL      |              |                        |                       |
| c     | decimal(5, 1)       |                       | YES  | NO   | NULL      | NONE |                        |                       |
| d     | int                            |                       | YES  | NO   | NULL      | NONE |                        |                       |
+-------+-------------------+--------------+------+------+-----------+--------+---------------+--------------+
4 rows in set (0.00 sec)

Related PR:#18358

@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

@weizuo93 weizuo93 force-pushed the fix-show-column branch 3 times, most recently from 5edf475 to 7451f35 Compare March 14, 2024 07:11
@weizuo93
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17653	4179	4081	4081
q2	2030	160	146	146
q3	10602	1067	902	902
q4	7773	741	743	741
q5	7449	2733	2746	2733
q6	187	129	120	120
q7	1160	807	799	799
q8	9424	1993	1978	1978
q9	7129	6416	6386	6386
q10	8466	3548	3575	3548
q11	436	220	218	218
q12	597	308	291	291
q13	17769	2885	2841	2841
q14	272	244	244	244
q15	520	447	446	446
q16	501	396	391	391
q17	944	530	620	530
q18	7049	6378	6424	6378
q19	1532	1426	1511	1426
q20	544	293	283	283
q21	6282	3520	3595	3520
q22	364	311	325	311
Total cold run time: 108683 ms
Total hot run time: 38313 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4138	4195	4142	4142
q2	320	224	225	224
q3	2980	2876	2863	2863
q4	1953	1551	1578	1551
q5	5467	5275	5282	5275
q6	197	114	117	114
q7	2262	1871	1885	1871
q8	3150	3295	3284	3284
q9	8611	8651	8606	8606
q10	3688	3731	3713	3713
q11	546	457	449	449
q12	718	556	523	523
q13	17717	3064	3053	3053
q14	308	284	273	273
q15	493	478	457	457
q16	481	425	413	413
q17	1763	1508	1475	1475
q18	8000	7658	7408	7408
q19	3386	1509	1471	1471
q20	1938	1751	1765	1751
q21	4833	4645	4691	4645
q22	547	477	482	477
Total cold run time: 73496 ms
Total hot run time: 54038 ms

@weizuo93
Copy link
Contributor Author

run buildall

@doris-robot
Copy link

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

------ Round 1 ----------------------------------
q1	17650	4327	4063	4063
q2	2022	158	144	144
q3	10659	1064	898	898
q4	8133	754	706	706
q5	7448	2715	2653	2653
q6	191	121	128	121
q7	1159	818	790	790
q8	9319	1980	1984	1980
q9	7114	6418	6384	6384
q10	8475	3507	3558	3507
q11	434	218	211	211
q12	593	294	287	287
q13	17792	2849	2851	2849
q14	273	255	242	242
q15	495	455	451	451
q16	508	384	391	384
q17	945	528	586	528
q18	7333	6408	6299	6299
q19	1568	1435	1484	1435
q20	570	275	274	274
q21	6415	3724	3496	3496
q22	364	312	328	312
Total cold run time: 109460 ms
Total hot run time: 38014 ms

----- Round 2, with runtime_filter_mode=off -----
q1	4171	4099	4107	4099
q2	317	232	225	225
q3	2925	2809	2803	2803
q4	1821	1555	1555	1555
q5	5180	5211	5251	5211
q6	205	114	115	114
q7	2256	1849	1892	1849
q8	3128	3274	3250	3250
q9	8532	8525	8474	8474
q10	3673	3680	3621	3621
q11	537	441	462	441
q12	704	555	550	550
q13	16916	2855	2880	2855
q14	286	254	250	250
q15	491	451	455	451
q16	460	420	403	403
q17	1731	1490	1444	1444
q18	7516	7128	7143	7128
q19	1636	1469	1543	1469
q20	1897	1709	1749	1709
q21	4809	4784	4637	4637
q22	526	467	452	452
Total cold run time: 69717 ms
Total hot run time: 52990 ms

@yiguolei
Copy link
Contributor

If it is date/datetime, then where could we find its actual type? For example, the user create a table with date column in 1.1.4 and then upgrade to 2.0.3, its actual type is datev1, and the user create a table in 2.0.3 and its type is also date but its actual type is datev2. How do we find the difference between the two columns?

@github-actions
Copy link
Contributor

We're closing this PR because it hasn't been updated in a while.
This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable.
If you'd like to revive this PR, please reopen it and feel free a maintainer to remove the Stale tag!

@github-actions github-actions bot added the Stale label Sep 14, 2024
@github-actions github-actions bot closed this Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants