In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the knowledge of "what is the influence of server character set on List partition table in DM7". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. When you specify English characters for the partition key when creating the List partition table sales using the disql tool on the Linux platform SQL > CREATE TABLE sales2 (3 sales_id INT,4 saleman CHAR (20), 5 saledate DATETIME,6 city CHAR (10) 7) 8 PARTITION BY LIST (city) 9 (10 PARTITION p1 VALUES), 11 PARTITION p2 VALUES (12 PARTITION p3 VALUES), 13 PARTITION p4 VALUES (14) can be created when multiple values are specified. Warning: List partition not include default,partition may be not locatedexecuted successfullyused time: 115.412 (ms). Execute id is 2094.2. When you use the disql tool to create a List partition table sales on Linux platform, when you specify Chinese for the partition key, you will create an error SQL > drop table sales;executed successfullyused time: 307.935 (ms) when you specify multiple list values. Execute id is 2095.SQL > CREATE TABLE sales2 (3 sales_id INT,4 saleman CHAR (20), 5 saledate DATETIME,6 city CHAR (50) 7) 8 PARTITION BY LIST (city) 9 (10 PARTITION p1 VALUES ('Beijing', 'Tianjin'), 11 PARTITION p2 VALUES ('Shanghai', 'Nanjing', 'Hangzhou'), 12 PARTITION p3 VALUES ('Wuhan', 'Changsha'), 13 PARTITION p4 VALUES ('Guangzhou, Shenzhen) 14) CREATE TABLE sales (sales_id INT,saleman CHAR (20), saledate DATETIME,city CHAR (50)) PARTITION BY LIST (city) (PARTITION p1 VALUES ('Beijing', 'Tianjin'), PARTITION p2 VALUES ('Shanghai', 'Nanjing', 'Hangzhou'), PARTITION p3 VALUES ('Wuhan', 'Changsha'), PARTITION p4 VALUES ('Guangzhou', 'Shenzhen') PARTITION p2 VALUES ('Shanghai', 'Nanjing', 'Hangzhou'), * line 11, column 30, nearby [- 2007]: Syntax error.used time: 0.328 (ms). Execute id is 0.3. When the partitioning key is specified in Chinese when creating the List partition table sales using the disql tool on the Linux platform Successfully created SQL > CREATE TABLE sales2 (3 sales_id INT,4 saleman CHAR (20), 5 saledate DATETIME,6 city CHAR (10) 7) 8 PARTITION BY LIST (city) 9 (10 PARTITION p1 VALUES ('Beijing'), 11 PARTITION p2 VALUES ('Shanghai'), 12 PARTITION p3 VALUES ('Wuhan'), 13 PARTITION p4 VALUES ('Guangzhou') when specifying a list value) Warning: List partition not include default,partition may be not locatedexecuted successfullyused time: 19.809 (ms). Execute id is 2096.4. When the partitioning key is specified in Chinese when the List partition table sales is created by using the disql tool on the win platform, disql V7.1.6.48-Build (2018.03.01-89507) ENTSQL > conn jy/abcd@10.10.10.1:5236 server [10.10.10.1) conn jy/abcd@10.10.10.1:5236 server is created successfully when multiple list values are specified. Login usage time: 14.001 (millisecond) SQL > drop table sales Operation performed elapsed time: 352.729 (milliseconds). Execution number: 2118.SQL > CREATE TABLE SALES (2 SALES_ID INT,3 SALEMAN CHAR (20), 4 SALEDATE DATETIME,5 CITY CHAR (10) 6) 7 PARTITION BY LIST (CITY) 8 SUBPARTITION BY RANGE (SALEDATE) SUBPARTITION TEMPLATE (9 SUBPARTITION P11 VALUES LESS THAN ('2012-04-01'), 10 SUBPARTITION P12 VALUES LESS THAN ('2012-07-01'), 11 SUBPARTITION P13 VALUES LESS THAN ('2012-10-01') 12 SUBPARTITION P14 VALUES EQU OR LESS THAN (MAXVALUE) 13 (14 PARTITION P1 VALUES ('Beijing', 'Tianjin') 15 (16 SUBPARTITION P11 VALUES LESS THAN ('2012-10-01'), 17 SUBPARTITION P11 VALUES EQU OR LESS THAN (MAXVALUE) 18), 19 PARTITION P2 VALUES (Shanghai, Nanjing, Hangzhou), 20 PARTITION P3 VALUES (DEFAULT) 21) Operation performed elapsed time: 26.710 (milliseconds). Execution number: 2119.SQL >
5. When you use administrative tools to create the List partition table sales on the Linux platform, when you specify Chinese for the partition key, you can also create it successfully when you specify multiple list values.
6. Check that the operating system character set is UTF-8
[root@shard1 /] # locale
LANG=en_US.UTF-8
LC_CTYPE= "en_US.UTF-8"
LC_NUMERIC= "en_US.UTF-8"
LC_TIME= "en_US.UTF-8"
LC_COLLATE= "en_US.UTF-8"
LC_MONETARY= "en_US.UTF-8"
LC_MESSAGES= "en_US.UTF-8"
LC_PAPER= "en_US.UTF-8"
LC_NAME= "en_US.UTF-8"
LC_ADDRESS= "en_US.UTF-8"
LC_TELEPHONE= "en_US.UTF-8"
LC_MEASUREMENT= "en_US.UTF-8"
LC_IDENTIFICATION= "en_US.UTF-8"
LC_ALL=
7. Modify operating system character set
[root@shard1 /] # vi / etc/locale.conf
# LANG= "en_US.UTF-8"
LANG= "zh_CN.gb2312"
[root@shard1 ~] # locale
LANG=zh_CN.gb2312
LC_CTYPE= "zh_CN.gb2312"
LC_NUMERIC= "zh_CN.gb2312"
LC_TIME= "zh_CN.gb2312"
LC_COLLATE= "zh_CN.gb2312"
LC_MONETARY= "zh_CN.gb2312"
LC_MESSAGES= "zh_CN.gb2312"
LC_PAPER= "zh_CN.gb2312"
LC_NAME= "zh_CN.gb2312"
LC_ADDRESS= "zh_CN.gb2312"
LC_TELEPHONE= "zh_CN.gb2312"
LC_MEASUREMENT= "zh_CN.gb2312"
LC_IDENTIFICATION= "zh_CN.gb2312"
LC_ALL=
8. When you specify Chinese for the partition key when you use the disql tool to create the List partition table sales on the Linux platform after modifying the character set, it is created successfully when you specify multiple list values
[dmdba@shard1 bin] $. / disql jy/abcd@10.10.10.1:5236
Server [10.10.10.1:5236]: mode is normal, state is open
Login used time: 9.677 (ms)
Disql V7.1.6.46-Build (2018.02.08-89107) ENT
Connected to: DM 7.1.6.46
SQL > drop table sales
Executed successfully
Used time: 351.233 (ms). Execute id is 2120.
SQL > CREATE TABLE SALES (
2 SALES_ID INT
3 SALEMAN CHAR (20)
4 SALEDATE DATETIME
5 CITY CHAR (10)
6)
7 PARTITION BY LIST (CITY)
8 SUBPARTITION BY RANGE (SALEDATE) SUBPARTITION TEMPLATE (
9 SUBPARTITION P11 VALUES LESS THAN ('2012-04-01')
10 SUBPARTITION P12 VALUES LESS THAN ('2012-07-01')
11 SUBPARTITION P13 VALUES LESS THAN ('2012-10-01')
12 SUBPARTITION P14 VALUES EQU OR LESS THAN (MAXVALUE))
13 (
14 PARTITION P1 VALUES ('Beijing', 'Tianjin')
15 (
16 SUBPARTITION P11Christ 1 VALUES LESS THAN ('2012-10-01')
17 SUBPARTITION P11room2 VALUES EQU OR LESS THAN (MAXVALUE)
18)
19 PARTITION P2 VALUES ('Shanghai', 'Nanjing', 'Hangzhou')
20 PARTITION P3 VALUES (DEFAULT)
21)
Executed successfully
Used time: 22.411 (ms). Execute id is 2121.
From the above tests, the character set has an impact on the use of Chinese in List partition tables.
This is the end of the content of "what effect the server character set has on the List partition table in DM7". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.