华为云用户手册
-
SQL7 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 select i_item_id, avg(ss_quantity) agg1, avg(ss_list_price) agg2, avg(ss_coupon_amt) agg3, avg(ss_sales_price) agg4 from store_sales, customer_demographics, date_dim, item, promotion where ss_sold_date_sk = d_date_sk and ss_item_sk = i_item_sk and ss_cdemo_sk = cd_demo_sk and ss_promo_sk = p_promo_sk and cd_gender = 'M' and cd_marital_status = 'U' and cd_education_status = 'College' and (p_channel_email = 'N' or p_channel_event = 'N') and d_year = 1999 group by i_item_id order by i_item_id limit 100;
-
SQL5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 with ssr as (select s_store_id, sum(sales_price) as sales, sum(profit) as profit, sum(return_amt) as returns, sum(net_loss) as profit_loss from ( select ss_store_sk as store_sk, ss_sold_date_sk as date_sk, ss_ext_sales_price as sales_price, ss_net_profit as profit, cast(0 as decimal(7,2)) as return_amt, cast(0 as decimal(7,2)) as net_loss from store_sales union all select sr_store_sk as store_sk, sr_returned_date_sk as date_sk, cast(0 as decimal(7,2)) as sales_price, cast(0 as decimal(7,2)) as profit, sr_return_amt as return_amt, sr_net_loss as net_loss from store_returns ) salesreturns, date_dim, store where date_sk = d_date_sk and d_date between cast('2002-08-05' as date) and (cast('2002-08-05' as date) + 14 ) and store_sk = s_store_sk group by s_store_id) , csr as (select cp_catalog_page_id, sum(sales_price) as sales, sum(profit) as profit, sum(return_amt) as returns, sum(net_loss) as profit_loss from ( select cs_catalog_page_sk as page_sk, cs_sold_date_sk as date_sk, cs_ext_sales_price as sales_price, cs_net_profit as profit, cast(0 as decimal(7,2)) as return_amt, cast(0 as decimal(7,2)) as net_loss from catalog_sales union all select cr_catalog_page_sk as page_sk, cr_returned_date_sk as date_sk, cast(0 as decimal(7,2)) as sales_price, cast(0 as decimal(7,2)) as profit, cr_return_amount as return_amt, cr_net_loss as net_loss from catalog_returns ) salesreturns, date_dim, catalog_page where date_sk = d_date_sk and d_date between cast('2002-08-05' as date) and (cast('2002-08-05' as date) + 14 ) and page_sk = cp_catalog_page_sk group by cp_catalog_page_id) , wsr as (select web_site_id, sum(sales_price) as sales, sum(profit) as profit, sum(return_amt) as returns, sum(net_loss) as profit_loss from ( select ws_web_site_sk as wsr_web_site_sk, ws_sold_date_sk as date_sk, ws_ext_sales_price as sales_price, ws_net_profit as profit, cast(0 as decimal(7,2)) as return_amt, cast(0 as decimal(7,2)) as net_loss from web_sales union all select ws_web_site_sk as wsr_web_site_sk, wr_returned_date_sk as date_sk, cast(0 as decimal(7,2)) as sales_price, cast(0 as decimal(7,2)) as profit, wr_return_amt as return_amt, wr_net_loss as net_loss from web_returns left outer join web_sales on ( wr_item_sk = ws_item_sk and wr_order_number = ws_order_number) ) salesreturns, date_dim, web_site where date_sk = d_date_sk and d_date between cast('2002-08-05' as date) and (cast('2002-08-05' as date) + 14 ) and wsr_web_site_sk = web_site_sk group by web_site_id) select channel , id , sum(sales) as sales , sum(returns) as returns , sum(profit) as profit from (select 'store channel' as channel , 'store' || s_store_id as id , sales , returns , (profit - profit_loss) as profit from ssr union all select 'catalog channel' as channel , 'catalog_page' || cp_catalog_page_id as id , sales , returns , (profit - profit_loss) as profit from csr union all select 'web channel' as channel , 'web_site' || web_site_id as id , sales , returns , (profit - profit_loss) as profit from wsr ) x group by rollup (channel, id) order by channel ,id limit 100;
-
SQL2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 with wscs as (select sold_date_sk ,sales_price from (select ws_sold_date_sk sold_date_sk ,ws_ext_sales_price sales_price from web_sales union all select cs_sold_date_sk sold_date_sk ,cs_ext_sales_price sales_price from catalog_sales)), wswscs as (select d_week_seq, sum(case when (d_day_name='Sunday') then sales_price else null end) sun_sales, sum(case when (d_day_name='Monday') then sales_price else null end) mon_sales, sum(case when (d_day_name='Tuesday') then sales_price else null end) tue_sales, sum(case when (d_day_name='Wednesday') then sales_price else null end) wed_sales, sum(case when (d_day_name='Thursday') then sales_price else null end) thu_sales, sum(case when (d_day_name='Friday') then sales_price else null end) fri_sales, sum(case when (d_day_name='Saturday') then sales_price else null end) sat_sales from wscs ,date_dim where d_date_sk = sold_date_sk group by d_week_seq) select d_week_seq1 ,round(sun_sales1/sun_sales2,2) ,round(mon_sales1/mon_sales2,2) ,round(tue_sales1/tue_sales2,2) ,round(wed_sales1/wed_sales2,2) ,round(thu_sales1/thu_sales2,2) ,round(fri_sales1/fri_sales2,2) ,round(sat_sales1/sat_sales2,2) from (select wswscs.d_week_seq d_week_seq1 ,sun_sales sun_sales1 ,mon_sales mon_sales1 ,tue_sales tue_sales1 ,wed_sales wed_sales1 ,thu_sales thu_sales1 ,fri_sales fri_sales1 ,sat_sales sat_sales1 from wswscs,date_dim where date_dim.d_week_seq = wswscs.d_week_seq and d_year = 1999) y, (select wswscs.d_week_seq d_week_seq2 ,sun_sales sun_sales2 ,mon_sales mon_sales2 ,tue_sales tue_sales2 ,wed_sales wed_sales2 ,thu_sales thu_sales2 ,fri_sales fri_sales2 ,sat_sales sat_sales2 from wswscs ,date_dim where date_dim.d_week_seq = wswscs.d_week_seq and d_year = 1999+1) z where d_week_seq1=d_week_seq2-53 order by d_week_seq1;
-
SQL3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 select dt.d_year ,item.i_brand_id brand_id ,item.i_brand brand ,sum(ss_ext_sales_price) sum_agg from date_dim dt ,store_sales ,item where dt.d_date_sk = store_sales.ss_sold_date_sk and store_sales.ss_item_sk = item.i_item_sk and item.i_manufact_id = 125 and dt.d_moy=11 group by dt.d_year ,item.i_brand ,item.i_brand_id order by dt.d_year ,sum_agg desc ,brand_id limit 100;
-
命令生成方法 TPC-DS标准99个SQL查询语句可用如下方法生成: 准备工作。生成TPC-DS查询语句前需要修改query_templates目录下的文件: 登录测试过程申请的E CS ,进入/data1/script/tpcds-kit/DSGen-software-code-3.2.0rc1/query_templates目录: 1 cd /data1/script/tpcds-kit/DSGen-software-code-3.2.0rc1/query_templates 新建文件hwdws.tpl,内容为: 1 2 3 4 5 define __LIMITA = ""; define __LIMITB = ""; define __LIMITC = "limit %d"; define _BEGIN = "-- begin query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE]; define _END = "-- end query " + [_QUERY] + " in stream " + [_STREAM] + " using template " + [_TEMPLATE]; 因TPC-DS工具中SQL语句生成模板有语法错误,需修改query77.tpl,将135行的‘, coalesce(returns, 0) returns’改为‘, coalesce(returns, 0) as returns’。 执行以下命令生成查询语句: 1 2 cd /data1/script/tpcds-kit/DSGen-software-code-3.2.0rc1/tools ./dsqgen -input ../query_templates/templates.lst -directory ../query_templates/ -scale 1000 -dialect hwdws 执行后会生成query_0.sql文件,里面放着99个标准SQL语句,需要手动去切分成99个文件。 生成的标准查询中如下日期函数语法在 GaussDB (DWS)暂不支持,需要手动进行修改: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 Q5: and (cast('2001-08-19' as date) + 14 days) 修改为 and (cast('2001-08-19' as date) + 14) Q12:and (cast('1999-02-28' as date) + 30 days) 修改为 and (cast('1999-02-28' as date) + 30) Q16:(cast('1999-4-01' as date) + 60 days) 修改为 (cast('1999-4-01' as date) + 60) Q20:and (cast('1998-05-05' as date) + 30 days) 修改为 and (cast('1998-05-05' as date) + 30) Q21:and d_date between (cast ('2000-05-19' as date) - 30 days) 修改为 and d_date between (cast ('2000-05-19' as date) - 30) and (cast ('2000-05-19' as date) + 30 days) 修改为 and (cast ('2000-05-19' as date) + 30) Q32:(cast('1999-02-22' as date) + 90 days) 修改为 (cast('1999-02-22' as date) + 90) Q37:and d_date between cast('1998-04-29' as date) and (cast('1998-04-29' as date) + 60 days) 修改为 and d_date between cast('1998-04-29' as date) and (cast('1998-04-29' as date) + 60) Q40:and d_date between (cast ('2002-05-10' as date) - 30 days) 修改为 and d_date between (cast ('2002-05-10' as date) - 30) and (cast ('2002-05-10' as date) + 30 days) 修改为 and (cast ('2002-05-10' as date) + 30) Q77:and (cast('1999-08-29' as date) + 30 days) 修改为 and (cast('1999-08-29' as date) + 30) Q80:and (cast('2002-08-04' as date) + 30 days) 修改为 and (cast('2002-08-04' as date) + 30) Q82:and d_date between cast('1998-01-18' as date) and (cast('1998-01-18' as date) + 60 days) 修改为 and d_date between cast('1998-01-18' as date) and (cast('1998-01-18' as date) + 60) Q92:(cast('2001-01-26' as date) + 90 days) 修改为 (cast('2001-01-26' as date) + 90) Q94:(cast('1999-5-01' as date) + 60 days) 修改为 (cast('1999-5-01' as date) + 60) Q95:(cast('1999-4-01' as date) + 60 days) 修改为 (cast('1999-4-01' as date) + 60) Q98:and (cast('2002-04-01' as date) + 30 days) 修改为 and (cast('2002-04-01' as date) + 30)
-
SQL13 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 select c_count, count(*) as custdist from ( select c_custkey, count(o_orderkey) from customer left outer join orders on c_custkey = o_custkey and o_comment not like '%special%requests%' group by c_custkey ) as c_orders (c_custkey, c_count) group by c_count order by custdist desc, c_count desc;
-
SQL9 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 select nation, o_year, sum(amount) as sum_profit from ( select n_name as nation, extract(year from o_orderdate) as o_year, l_extendedprice * (1 - l_discount) - ps_supplycost * l_quantity as amount from part, supplier, lineitem, partsupp, orders, nation where s_suppkey = l_suppkey and ps_suppkey = l_suppkey and ps_partkey = l_partkey and p_partkey = l_partkey and o_orderkey = l_orderkey and s_nationkey = n_nationkey and p_name like '%green%' ) as profit group by nation, o_year order by nation, o_year desc;
-
SQL2 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 select s_acctbal, s_name, n_name, p_partkey, p_mfgr, s_address, s_phone, s_comment from part, supplier, partsupp, nation, region where p_partkey = ps_partkey and s_suppkey = ps_suppkey and p_size = 15 and p_type like '%BRASS' and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = 'EUROPE' and ps_supplycost = ( select min(ps_supplycost) from partsupp, supplier, nation, region where p_partkey = ps_partkey and s_suppkey = ps_suppkey and s_nationkey = n_nationkey and n_regionkey = r_regionkey and r_name = 'EUROPE' ) order by s_acctbal desc, n_name, s_name, p_partkey limit 100;
-
SQL8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 select o_year, sum(case when nation = 'BRAZIL' then volume else 0 end) / sum(volume) as mkt_share from ( select extract(year from o_orderdate) as o_year, l_extendedprice * (1 - l_discount) as volume, n2.n_name as nation from part, supplier, lineitem, orders, customer, nation n1, nation n2, region where p_partkey = l_partkey and s_suppkey = l_suppkey and l_orderkey = o_orderkey and o_custkey = c_custkey and c_nationkey = n1.n_nationkey and n1.n_regionkey = r_regionkey and r_name = 'AMERICA' and s_nationkey = n2.n_nationkey and o_orderdate between date '1995-01-01' and date '1996-12-31' and p_type = 'ECONOMY ANODIZED STEEL' ) as all_nations group by o_year order by o_year;
-
SQL7 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 select supp_nation, cust_nation, l_year, sum(volume) as revenue from ( select n1.n_name as supp_nation, n2.n_name as cust_nation, extract(year from l_shipdate) as l_year, l_extendedprice * (1 - l_discount) as volume from supplier, lineitem, orders, customer, nation n1, nation n2 where s_suppkey = l_suppkey and o_orderkey = l_orderkey and c_custkey = o_custkey and s_nationkey = n1.n_nationkey and c_nationkey = n2.n_nationkey and ( (n1.n_name = 'FRANCE' and n2.n_name = 'GERMANY') or (n1.n_name = 'GERMANY' and n2.n_name = 'FRANCE') ) and l_shipdate between date '1995-01-01' and date '1996-12-31' ) as shipping group by supp_nation, cust_nation, l_year order by supp_nation, cust_nation, l_year;
-
操作步骤 使用gsql连接DWS成功后,执行以下SQL创建目标表(共24张表)。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 CREATE TABLE customer_address ( ca_address_sk bigint not null , ca_address_id char(16) not null, ca_street_number char(10) , ca_street_name varchar(60) , ca_street_type char(15) , ca_suite_number char(10) , ca_city varchar(60) , ca_county varchar(30) , ca_state char(2) , ca_zip char(10) , ca_country varchar(20) , ca_gmt_offset decimal(5,2) , ca_location_type char(20) ) with (orientation = column) distribute by hash (ca_address_sk); CREATE TABLE customer_demographics ( cd_demo_sk bigint not null , cd_gender char(1) , cd_marital_status char(1) , cd_education_status char(20) , cd_purchase_estimate bigint , cd_credit_rating char(10) , cd_dep_count bigint , cd_dep_employed_count bigint , cd_dep_college_count bigint ) with (orientation = column) distribute by hash (cd_demo_sk); CREATE TABLE date_dim ( d_date_sk bigint not null, d_date_id char(16) not null, d_date date , d_month_seq bigint , d_week_seq bigint , d_quarter_seq bigint , d_year bigint , d_dow bigint , d_moy bigint , d_dom bigint , d_qoy bigint , d_fy_year bigint , d_fy_quarter_seq bigint , d_fy_week_seq bigint , d_day_name char(9) , d_quarter_name char(6) , d_holiday char(1) , d_weekend char(1) , d_following_holiday char(1) , d_first_dom bigint , d_last_dom bigint , d_same_day_ly bigint , d_same_day_lq bigint , d_current_day char(1) , d_current_week char(1) , d_current_month char(1) , d_current_quarter char(1) , d_current_year char(1) ) with (orientation = column) DISTRIBUTE by hash(d_date_sk) PARTITION BY Range(d_year) ( partition p1 values less than(1950), partition p2 values less than(2000), partition p3 values less than(2050), partition p4 values less than(2100), partition p5 values less than(3000), partition p6 values less than(maxvalue) ); CREATE TABLE warehouse ( w_warehouse_sk bigint not null, w_warehouse_id char(16) not null, w_warehouse_name varchar(20) , w_warehouse_sq_ft bigint , w_street_number char(10) , w_street_name varchar(60) , w_street_type char(15) , w_suite_number char(10) , w_city varchar(60) , w_county varchar(30) , w_state char(2) , w_zip char(10) , w_country varchar(20) , w_gmt_offset decimal(5,2) ) with (orientation = column) distribute by replication; CREATE TABLE ship_mode ( sm_ship_mode_sk bigint not null, sm_ship_mode_id char(16) not null, sm_type char(30) , sm_code char(10) , sm_carrier char(20) , sm_contract char(20) ) with (orientation = column) distribute by replication; CREATE TABLE time_dim ( t_time_sk bigint not null, t_time_id char(16) not null, t_time bigint , t_hour bigint , t_minute bigint , t_second bigint , t_am_pm char(2) , t_shift char(20) , t_sub_shift char(20) , t_meal_time char(20) ) with (orientation = column) distribute by hash (t_time_sk); CREATE TABLE reason ( r_reason_sk bigint not null, r_reason_id char(16) not null, r_reason_desc char(100) ) with (orientation = column) distribute by replication; CREATE TABLE income_band ( ib_income_band_sk bigint not null, ib_lower_bound bigint , ib_upper_bound bigint ) with (orientation = column) distribute by replication; CREATE TABLE item ( i_item_sk bigint not null, i_item_id char(16) not null, i_rec_start_date date , i_rec_end_date date , i_item_desc varchar(200) , i_current_price decimal(7,2) , i_wholesale_cost decimal(7,2) , i_brand_id bigint , i_brand char(50) , i_class_id bigint , i_class char(50) , i_category_id bigint , i_category char(50) , i_manufact_id bigint , i_manufact char(50) , i_size char(20) , i_formulation char(20) , i_color char(20) , i_units char(10) , i_container char(10) , i_manager_id bigint , i_product_name char(50) ) with (orientation = column) distribute by hash (i_item_sk); CREATE TABLE store ( s_store_sk bigint not null, s_store_id char(16) not null, s_rec_start_date date , s_rec_end_date date , s_closed_date_sk bigint , s_store_name varchar(50) , s_number_employees bigint , s_floor_space bigint , s_hours char(20) , s_manager varchar(40) , s_market_id bigint , s_geography_class varchar(100) , s_market_desc varchar(100) , s_market_manager varchar(40) , s_division_id bigint , s_division_name varchar(50) , s_company_id bigint , s_company_name varchar(50) , s_street_number varchar(10) , s_street_name varchar(60) , s_street_type char(15) , s_suite_number char(10) , s_city varchar(60) , s_county varchar(30) , s_state char(2) , s_zip char(10) , s_country varchar(20) , s_gmt_offset decimal(5,2) , s_tax_precentage decimal(5,2) ) with (orientation = column) distribute by replication; CREATE TABLE call_center ( cc_call_center_sk bigint not null, cc_call_center_id char(16) not null, cc_rec_start_date date , cc_rec_end_date date , cc_closed_date_sk bigint , cc_open_date_sk bigint , cc_name varchar(50) , cc_class varchar(50) , cc_employees bigint , cc_sq_ft bigint , cc_hours char(20) , cc_manager varchar(40) , cc_mkt_id bigint , cc_mkt_class char(50) , cc_mkt_desc varchar(100) , cc_market_manager varchar(40) , cc_division bigint , cc_division_name varchar(50) , cc_company bigint , cc_company_name char(50) , cc_street_number char(10) , cc_street_name varchar(60) , cc_street_type char(15) , cc_suite_number char(10) , cc_city varchar(60) , cc_county varchar(30) , cc_state char(2) , cc_zip char(10) , cc_country varchar(20) , cc_gmt_offset decimal(5,2) , cc_tax_percentage decimal(5,2) ) with (orientation = column) distribute by replication; drop table if exists customer; CREATE TABLE customer ( c_customer_sk bigint not null, c_customer_id char(16) not null, c_current_cdemo_sk bigint , c_current_hdemo_sk bigint , c_current_addr_sk bigint , c_first_shipto_date_sk bigint , c_first_sales_date_sk bigint , c_salutation char(10) , c_first_name char(20) , c_last_name char(30) , c_preferred_cust_flag char(1) , c_birth_day bigint , c_birth_month bigint , c_birth_year bigint , c_birth_country varchar(20) , c_login char(13) , c_email_address char(50) , c_last_review_date_sk char(10) ) with (orientation = column) distribute by hash (c_customer_sk); CREATE TABLE web_site ( web_site_sk bigint not null, web_site_id char(16) not null, web_rec_start_date date , web_rec_end_date date , web_name varchar(50) , web_open_date_sk bigint , web_close_date_sk bigint , web_class varchar(50) , web_manager varchar(40) , web_mkt_id bigint , web_mkt_class varchar(50) , web_mkt_desc varchar(100) , web_market_manager varchar(40) , web_company_id bigint , web_company_name char(50) , web_street_number char(10) , web_street_name varchar(60) , web_street_type char(15) , web_suite_number char(10) , web_city varchar(60) , web_county varchar(30) , web_state char(2) , web_zip char(10) , web_country varchar(20) , web_gmt_offset decimal(5,2) , web_tax_percentage decimal(5,2) ) with (orientation = column) distribute by replication; CREATE TABLE household_demographics ( hd_demo_sk bigint not null, hd_income_band_sk bigint , hd_buy_potential char(15) , hd_dep_count bigint , hd_vehicle_count bigint ) with (orientation = column) distribute by hash (hd_demo_sk); CREATE TABLE web_page ( wp_web_page_sk bigint not null, wp_web_page_id char(16) not null, wp_rec_start_date date , wp_rec_end_date date , wp_creation_date_sk bigint , wp_access_date_sk bigint , wp_autogen_flag char(1) , wp_customer_sk bigint , wp_url varchar(100) , wp_type char(50) , wp_char_count bigint , wp_link_count bigint , wp_image_count bigint , wp_max_ad_count bigint ) with (orientation = column) distribute by replication; CREATE TABLE promotion ( p_promo_sk bigint not null, p_promo_id char(16) not null, p_start_date_sk bigint , p_end_date_sk bigint , p_item_sk bigint , p_cost decimal(15,2) , p_response_target bigint , p_promo_name char(50) , p_channel_dmail char(1) , p_channel_email char(1) , p_channel_catalog char(1) , p_channel_tv char(1) , p_channel_radio char(1) , p_channel_press char(1) , p_channel_event char(1) , p_channel_demo char(1) , p_channel_details varchar(100) , p_purpose char(15) , p_discount_active char(1) ) with (orientation = column) DISTRIBUTE BY HASH(p_promo_sk); CREATE TABLE catalog_page ( cp_catalog_page_sk bigint not null, cp_catalog_page_id char(16) not null, cp_start_date_sk bigint , cp_end_date_sk bigint , cp_department varchar(50) , cp_catalog_number bigint , cp_catalog_page_number bigint , cp_description varchar(100) , cp_type varchar(100) ) with (orientation = column) distribute by hash (cp_catalog_page_sk); CREATE TABLE inventory ( inv_date_sk bigint not null, inv_item_sk bigint not null, inv_warehouse_sk bigint not null, inv_quantity_on_hand integer ) with (orientation = column) distribute by hash (inv_item_sk) partition by range(inv_date_sk) ( partition p1 values less than(2451180), partition p2 values less than(2451545), partition p3 values less than(2451911), partition p4 values less than(2452276), partition p5 values less than(2452641), partition p6 values less than(2453006), partition p7 values less than(maxvalue) ) ; CREATE TABLE catalog_returns ( cr_returned_date_sk bigint , cr_returned_time_sk bigint , cr_item_sk bigint not null, cr_refunded_customer_sk bigint , cr_refunded_cdemo_sk bigint , cr_refunded_hdemo_sk bigint , cr_refunded_addr_sk bigint , cr_returning_customer_sk bigint , cr_returning_cdemo_sk bigint , cr_returning_hdemo_sk bigint , cr_returning_addr_sk bigint , cr_call_center_sk bigint , cr_catalog_page_sk bigint , cr_ship_mode_sk bigint , cr_warehouse_sk bigint , cr_reason_sk bigint , cr_order_number bigint not null, cr_return_quantity bigint , cr_return_amount decimal(7,2) , cr_return_tax decimal(7,2) , cr_return_amt_inc_tax decimal(7,2) , cr_fee decimal(7,2) , cr_return_ship_cost decimal(7,2) , cr_refunded_cash decimal(7,2) , cr_reversed_charge decimal(7,2) , cr_store_credit decimal(7,2) , cr_net_loss decimal(7,2) ) with (orientation = column) distribute by hash (cr_item_sk) partition by range(cr_returned_date_sk) ( partition p1 values less than(2450815), partition p2 values less than(2451180), partition p3 values less than(2451545), partition p4 values less than(2451911), partition p5 values less than(2452276), partition p6 values less than(2452641), partition p7 values less than(2453006), partition p8 values less than(maxvalue) ) ; CREATE TABLE web_returns ( wr_returned_date_sk bigint , wr_returned_time_sk bigint , wr_item_sk bigint not null, wr_refunded_customer_sk bigint , wr_refunded_cdemo_sk bigint , wr_refunded_hdemo_sk bigint , wr_refunded_addr_sk bigint , wr_returning_customer_sk bigint , wr_returning_cdemo_sk bigint , wr_returning_hdemo_sk bigint , wr_returning_addr_sk bigint , wr_web_page_sk bigint , wr_reason_sk bigint , wr_order_number bigint not null, wr_return_quantity bigint , wr_return_amt decimal(7,2) , wr_return_tax decimal(7,2) , wr_return_amt_inc_tax decimal(7,2) , wr_fee decimal(7,2) , wr_return_ship_cost decimal(7,2) , wr_refunded_cash decimal(7,2) , wr_reversed_charge decimal(7,2) , wr_account_credit decimal(7,2) , wr_net_loss decimal(7,2) ) with (orientation = column) distribute by hash (wr_item_sk) partition by range(wr_returned_date_sk) ( partition p1 values less than(2450815), partition p2 values less than(2451180), partition p3 values less than(2451545), partition p4 values less than(2451911), partition p5 values less than(2452276), partition p6 values less than(2452641), partition p7 values less than(2453006), partition p8 values less than(maxvalue) ) ; CREATE TABLE store_returns ( sr_returned_date_sk bigint , sr_return_time_sk bigint , sr_item_sk bigint not null, sr_customer_sk bigint , sr_cdemo_sk bigint , sr_hdemo_sk bigint , sr_addr_sk bigint , sr_store_sk bigint , sr_reason_sk bigint , sr_ticket_number bigint not null, sr_return_quantity bigint , sr_return_amt decimal(7,2) , sr_return_tax decimal(7,2) , sr_return_amt_inc_tax decimal(7,2) , sr_fee decimal(7,2) , sr_return_ship_cost decimal(7,2) , sr_refunded_cash decimal(7,2) , sr_reversed_charge decimal(7,2) , sr_store_credit decimal(7,2) , sr_net_loss decimal(7,2) ) with (orientation = column) distribute by hash (sr_item_sk) partition by range(sr_returned_date_sk) ( partition p1 values less than (2451180) , partition p2 values less than (2451545) , partition p3 values less than (2451911) , partition p4 values less than (2452276) , partition p5 values less than (2452641) , partition p6 values less than (2453006) , partition p7 values less than (maxvalue) ) ; CREATE TABLE web_sales ( ws_sold_date_sk bigint , ws_sold_time_sk bigint , ws_ship_date_sk bigint , ws_item_sk bigint not null, ws_bill_customer_sk bigint , ws_bill_cdemo_sk bigint , ws_bill_hdemo_sk bigint , ws_bill_addr_sk bigint , ws_ship_customer_sk bigint , ws_ship_cdemo_sk bigint , ws_ship_hdemo_sk bigint , ws_ship_addr_sk bigint , ws_web_page_sk bigint , ws_web_site_sk bigint , ws_ship_mode_sk bigint , ws_warehouse_sk bigint , ws_promo_sk bigint , ws_order_number bigint not null, ws_quantity bigint , ws_wholesale_cost decimal(7,2) , ws_list_price decimal(7,2) , ws_sales_price decimal(7,2) , ws_ext_discount_amt decimal(7,2) , ws_ext_sales_price decimal(7,2) , ws_ext_wholesale_cost decimal(7,2) , ws_ext_list_price decimal(7,2) , ws_ext_tax decimal(7,2) , ws_coupon_amt decimal(7,2) , ws_ext_ship_cost decimal(7,2) , ws_net_paid decimal(7,2) , ws_net_paid_inc_tax decimal(7,2) , ws_net_paid_inc_ship decimal(7,2) , ws_net_paid_inc_ship_tax decimal(7,2) , ws_net_profit decimal(7,2) ) with (orientation = column) distribute by hash (ws_item_sk) partition by range(ws_sold_date_sk) ( partition p1 values less than(2451180), partition p2 values less than(2451545), partition p3 values less than(2451911), partition p4 values less than(2452276), partition p5 values less than(2452641), partition p6 values less than(2453006), partition p7 values less than(maxvalue) ) ; CREATE TABLE catalog_sales ( cs_sold_date_sk bigint , cs_sold_time_sk bigint , cs_ship_date_sk bigint , cs_bill_customer_sk bigint , cs_bill_cdemo_sk bigint , cs_bill_hdemo_sk bigint , cs_bill_addr_sk bigint , cs_ship_customer_sk bigint , cs_ship_cdemo_sk bigint , cs_ship_hdemo_sk bigint , cs_ship_addr_sk bigint , cs_call_center_sk bigint , cs_catalog_page_sk bigint , cs_ship_mode_sk bigint , cs_warehouse_sk bigint , cs_item_sk bigint not null, cs_promo_sk bigint , cs_order_number bigint not null, cs_quantity bigint , cs_wholesale_cost decimal(7,2) , cs_list_price decimal(7,2) , cs_sales_price decimal(7,2) , cs_ext_discount_amt decimal(7,2) , cs_ext_sales_price decimal(7,2) , cs_ext_wholesale_cost decimal(7,2) , cs_ext_list_price decimal(7,2) , cs_ext_tax decimal(7,2) , cs_coupon_amt decimal(7,2) , cs_ext_ship_cost decimal(7,2) , cs_net_paid decimal(7,2) , cs_net_paid_inc_tax decimal(7,2) , cs_net_paid_inc_ship decimal(7,2) , cs_net_paid_inc_ship_tax decimal(7,2) , cs_net_profit decimal(7,2) ) with (orientation = column) distribute by hash (cs_item_sk) partition by range(cs_sold_date_sk) ( partition p1 values less than(2451180), partition p2 values less than(2451545), partition p3 values less than(2451911), partition p4 values less than(2452276), partition p5 values less than(2452641), partition p6 values less than(2453006), partition p7 values less than(maxvalue) ) ; CREATE TABLE store_sales ( ss_sold_date_sk bigint , ss_sold_time_sk bigint , ss_item_sk bigint not null, ss_customer_sk bigint , ss_cdemo_sk bigint , ss_hdemo_sk bigint , ss_addr_sk bigint , ss_store_sk bigint , ss_promo_sk bigint , ss_ticket_number bigint not null, ss_quantity bigint , ss_wholesale_cost decimal(7,2) , ss_list_price decimal(7,2) , ss_sales_price decimal(7,2) , ss_ext_discount_amt decimal(7,2) , ss_ext_sales_price decimal(7,2) , ss_ext_wholesale_cost decimal(7,2) , ss_ext_list_price decimal(7,2) , ss_ext_tax decimal(7,2) , ss_coupon_amt decimal(7,2) , ss_net_paid decimal(7,2) , ss_net_paid_inc_tax decimal(7,2) , ss_net_profit decimal(7,2) ) with (orientation = column) distribute by hash (ss_item_sk) partition by range(ss_sold_date_sk) ( partition p1 values less than(2451180), partition p2 values less than(2451545), partition p3 values less than(2451911), partition p4 values less than(2452276), partition p5 values less than(2452641), partition p6 values less than(2453006), partition p7 values less than(maxvalue) ) ; 执行以下SQL语句创建GDS外表(共24张表)。 以下每个外表的“gsfs://192.168.0.90:500x/xxx | gsfs://192.168.0.90:500x/xxx”中的IP地址和端口,请替换成安装和启动GDS中的对应的GDS的监听IP和端口。如启动两个GDS,则使用“|”区分。如果启动多个GDS,需要将所有GDS的监听IP和端口配置到外表中。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 DROP FOREIGN TABLE IF EXISTS customer_address_ext; CREATE FOREIGN TABLE customer_address_ext ( ca_address_sk bigint , ca_address_id char(16) , ca_street_number char(10) , ca_street_name varchar(60) , ca_street_type char(15) , ca_suite_number char(10) , ca_city varchar(60) , ca_county varchar(30) , ca_state char(2) , ca_zip char(10) , ca_country varchar(20) , ca_gmt_offset decimal(5,2) , ca_location_type char(20) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/customer_address* | gsfs://192.168.0.90:5003/customer_address*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with customer_address_err; DROP FOREIGN TABLE IF EXISTS customer_demographics_ext; CREATE FOREIGN TABLE customer_demographics_ext ( cd_demo_sk bigint , cd_gender char(1) , cd_marital_status char(1) , cd_education_status char(20) , cd_purchase_estimate bigint , cd_credit_rating char(10) , cd_dep_count bigint , cd_dep_employed_count bigint , cd_dep_college_count bigint ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/customer_demographics* | gsfs://192.168.0.90:5003/customer_demographics*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with customer_demographics_err; DROP FOREIGN TABLE IF EXISTS date_dim_ext; CREATE FOREIGN TABLE date_dim_ext ( d_date_sk bigint , d_date_id char(16) , d_date date , d_month_seq bigint , d_week_seq bigint , d_quarter_seq bigint , d_year bigint , d_dow bigint , d_moy bigint , d_dom bigint , d_qoy bigint , d_fy_year bigint , d_fy_quarter_seq bigint , d_fy_week_seq bigint , d_day_name char(9) , d_quarter_name char(6) , d_holiday char(1) , d_weekend char(1) , d_following_holiday char(1) , d_first_dom bigint , d_last_dom bigint , d_same_day_ly bigint , d_same_day_lq bigint , d_current_day char(1) , d_current_week char(1) , d_current_month char(1) , d_current_quarter char(1) , d_current_year char(1) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/date_dim* | gsfs://192.168.0.90:5003/date_dim*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with date_dim_err; DROP FOREIGN TABLE IF EXISTS warehouse_ext; CREATE FOREIGN TABLE warehouse_ext ( w_warehouse_sk bigint , w_warehouse_id char(16) , w_warehouse_name varchar(20) , w_warehouse_sq_ft bigint , w_street_number char(10) , w_street_name varchar(60) , w_street_type char(15) , w_suite_number char(10) , w_city varchar(60) , w_county varchar(30) , w_state char(2) , w_zip char(10) , w_country varchar(20) , w_gmt_offset decimal(5,2) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/warehouse* | gsfs://192.168.0.90:5003/warehouse*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with warehouse_err; DROP FOREIGN TABLE IF EXISTS ship_mode_ext; CREATE FOREIGN TABLE ship_mode_ext ( sm_ship_mode_sk bigint , sm_ship_mode_id char(16) , sm_type char(30) , sm_code char(10) , sm_carrier char(20) , sm_contract char(20) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/ship_mode* | gsfs://192.168.0.90:5003/ship_mode*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with ship_mode_err; DROP FOREIGN TABLE IF EXISTS time_dim_ext; CREATE FOREIGN TABLE time_dim_ext ( t_time_sk bigint , t_time_id char(16) , t_time bigint , t_hour bigint , t_minute bigint , t_second bigint , t_am_pm char(2) , t_shift char(20) , t_sub_shift char(20) , t_meal_time char(20) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/time_dim* | gsfs://192.168.0.90:5003/time_dim*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with time_dim_err; DROP FOREIGN TABLE IF EXISTS reason_ext; CREATE FOREIGN TABLE reason_ext ( r_reason_sk bigint , r_reason_id char(16) , r_reason_desc char(100) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/reason* | gsfs://192.168.0.90:5003/reason*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with reason_err; DROP FOREIGN TABLE IF EXISTS income_band_ext; CREATE FOREIGN TABLE income_band_ext ( ib_income_band_sk bigint , ib_lower_bound bigint , ib_upper_bound bigint ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/income_band* | gsfs://192.168.0.90:5003/income_band*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with income_band_err; DROP FOREIGN TABLE IF EXISTS item_ext; CREATE FOREIGN TABLE item_ext ( i_item_sk bigint , i_item_id char(16) , i_rec_start_date date , i_rec_end_date date , i_item_desc varchar(200) , i_current_price decimal(7,2) , i_wholesale_cost decimal(7,2) , i_brand_id bigint , i_brand char(50) , i_class_id bigint , i_class char(50) , i_category_id bigint , i_category char(50) , i_manufact_id bigint , i_manufact char(50) , i_size char(20) , i_formulation char(20) , i_color char(20) , i_units char(10) , i_container char(10) , i_manager_id bigint , i_product_name char(50) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/item* | gsfs://192.168.0.90:5003/item*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with item_err; DROP FOREIGN TABLE IF EXISTS store_ext; CREATE FOREIGN TABLE store_ext ( s_store_sk bigint , s_store_id char(16) , s_rec_start_date date , s_rec_end_date date , s_closed_date_sk bigint , s_store_name varchar(50) , s_number_employees bigint , s_floor_space bigint , s_hours char(20) , s_manager varchar(40) , s_market_id bigint , s_geography_class varchar(100) , s_market_desc varchar(100) , s_market_manager varchar(40) , s_division_id bigint , s_division_name varchar(50) , s_company_id bigint , s_company_name varchar(50) , s_street_number varchar(10) , s_street_name varchar(60) , s_street_type char(15) , s_suite_number char(10) , s_city varchar(60) , s_county varchar(30) , s_state char(2) , s_zip char(10) , s_country varchar(20) , s_gmt_offset decimal(5,2) , s_tax_precentage decimal(5,2) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/store_[^rs]* | gsfs://192.168.0.90:5003/storet_[^rs]*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with store_err; DROP FOREIGN TABLE IF EXISTS call_center_ext; CREATE FOREIGN TABLE call_center_ext ( cc_call_center_sk bigint , cc_call_center_id char(16) , cc_rec_start_date date , cc_rec_end_date date , cc_closed_date_sk bigint , cc_open_date_sk bigint , cc_name varchar(50) , cc_class varchar(50) , cc_employees bigint , cc_sq_ft bigint , cc_hours char(20) , cc_manager varchar(40) , cc_mkt_id bigint , cc_mkt_class char(50) , cc_mkt_desc varchar(100) , cc_market_manager varchar(40) , cc_division bigint , cc_division_name varchar(50) , cc_company bigint , cc_company_name char(50) , cc_street_number char(10) , cc_street_name varchar(60) , cc_street_type char(15) , cc_suite_number char(10) , cc_city varchar(60) , cc_county varchar(30) , cc_state char(2) , cc_zip char(10) , cc_country varchar(20) , cc_gmt_offset decimal(5,2) , cc_tax_percentage decimal(5,2) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/call_center* | gsfs://192.168.0.90:5003/call_center*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with call_center_err; DROP FOREIGN TABLE IF EXISTS customer_ext; CREATE FOREIGN TABLE customer_ext ( c_customer_sk bigint , c_customer_id char(16) , c_current_cdemo_sk bigint , c_current_hdemo_sk bigint , c_current_addr_sk bigint , c_first_shipto_date_sk bigint , c_first_sales_date_sk bigint , c_salutation char(10) , c_first_name char(20) , c_last_name char(30) , c_preferred_cust_flag char(1) , c_birth_day bigint , c_birth_month bigint , c_birth_year bigint , c_birth_country varchar(20) , c_login char(13) , c_email_address char(50) , c_last_review_date_sk char(10) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/customer_[^ad]* | gsfs://192.168.0.90:5003/customer_[^ad]*', FORMAT 'TEXT' , DELIMITER '|', encoding 'GBK', mode 'Normal' ) with customer_err; DROP FOREIGN TABLE IF EXISTS web_site_ext; CREATE FOREIGN TABLE web_site_ext ( web_site_sk bigint , web_site_id char(16) , web_rec_start_date date , web_rec_end_date date , web_name varchar(50) , web_open_date_sk bigint , web_close_date_sk bigint , web_class varchar(50) , web_manager varchar(40) , web_mkt_id bigint , web_mkt_class varchar(50) , web_mkt_desc varchar(100) , web_market_manager varchar(40) , web_company_id bigint , web_company_name char(50) , web_street_number char(10) , web_street_name varchar(60) , web_street_type char(15) , web_suite_number char(10) , web_city varchar(60) , web_county varchar(30) , web_state char(2) , web_zip char(10) , web_country varchar(20) , web_gmt_offset decimal(5,2) , web_tax_percentage decimal(5,2) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/web_site* | gsfs://192.168.0.90:5003/web_site*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with web_site_err; DROP FOREIGN TABLE IF EXISTS store_returns_ext; CREATE FOREIGN TABLE store_returns_ext ( sr_returned_date_sk bigint , sr_return_time_sk bigint , sr_item_sk bigint , sr_customer_sk bigint , sr_cdemo_sk bigint , sr_hdemo_sk bigint , sr_addr_sk bigint , sr_store_sk bigint , sr_reason_sk bigint , sr_ticket_number bigint , sr_return_quantity bigint , sr_return_amt decimal(7,2) , sr_return_tax decimal(7,2) , sr_return_amt_inc_tax decimal(7,2) , sr_fee decimal(7,2) , sr_return_ship_cost decimal(7,2) , sr_refunded_cash decimal(7,2) , sr_reversed_charge decimal(7,2) , sr_store_credit decimal(7,2) , sr_net_loss decimal(7,2) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/store_returns* | gsfs://192.168.0.90:5003/store_returns*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with store_returns_err; DROP FOREIGN TABLE IF EXISTS household_demographics_ext; CREATE FOREIGN TABLE household_demographics_ext ( hd_demo_sk bigint , hd_income_band_sk bigint , hd_buy_potential char(15) , hd_dep_count bigint , hd_vehicle_count bigint ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/household_demographics* | gsfs://192.168.0.90:5003/household_demographics*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with household_demographics_err; DROP FOREIGN TABLE IF EXISTS web_page_ext; CREATE FOREIGN TABLE web_page_ext ( wp_web_page_sk bigint , wp_web_page_id char(16) , wp_rec_start_date date , wp_rec_end_date date , wp_creation_date_sk bigint , wp_access_date_sk bigint , wp_autogen_flag char(1) , wp_customer_sk bigint , wp_url varchar(100) , wp_type char(50) , wp_char_count bigint , wp_link_count bigint , wp_image_count bigint , wp_max_ad_count bigint ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/web_page* | gsfs://192.168.0.90:5003/web_page*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with web_page_err; DROP FOREIGN TABLE IF EXISTS promotion_ext; CREATE FOREIGN TABLE promotion_ext ( p_promo_sk bigint , p_promo_id char(16) , p_start_date_sk bigint , p_end_date_sk bigint , p_item_sk bigint , p_cost decimal(15,2) , p_response_target bigint , p_promo_name char(50) , p_channel_dmail char(1) , p_channel_email char(1) , p_channel_catalog char(1) , p_channel_tv char(1) , p_channel_radio char(1) , p_channel_press char(1) , p_channel_event char(1) , p_channel_demo char(1) , p_channel_details varchar(100) , p_purpose char(15) , p_discount_active char(1) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/promotion* | gsfs://192.168.0.90:5003/promotion*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with promotion_err; DROP FOREIGN TABLE IF EXISTS catalog_page_ext; CREATE FOREIGN TABLE catalog_page_ext ( cp_catalog_page_sk bigint , cp_catalog_page_id char(16) , cp_start_date_sk bigint , cp_end_date_sk bigint , cp_department varchar(50) , cp_catalog_number bigint , cp_catalog_page_number bigint , cp_description varchar(100) , cp_type varchar(100) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/catalog_page* | gsfs://192.168.0.90:5003/catalog_page*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with catalog_page_err; DROP FOREIGN TABLE IF EXISTS inventory_ext; CREATE FOREIGN TABLE inventory_ext ( inv_date_sk bigint , inv_item_sk bigint , inv_warehouse_sk bigint , inv_quantity_on_hand integer ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/inventory* | gsfs://192.168.0.90:5003/inventory*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with inventory_err; DROP FOREIGN TABLE IF EXISTS catalog_returns_ext; CREATE FOREIGN TABLE catalog_returns_ext ( cr_returned_date_sk bigint , cr_returned_time_sk bigint , cr_item_sk bigint , cr_refunded_customer_sk bigint , cr_refunded_cdemo_sk bigint , cr_refunded_hdemo_sk bigint , cr_refunded_addr_sk bigint , cr_returning_customer_sk bigint , cr_returning_cdemo_sk bigint , cr_returning_hdemo_sk bigint , cr_returning_addr_sk bigint , cr_call_center_sk bigint , cr_catalog_page_sk bigint , cr_ship_mode_sk bigint , cr_warehouse_sk bigint , cr_reason_sk bigint , cr_order_number bigint , cr_return_quantity bigint , cr_return_amount decimal(7,2) , cr_return_tax decimal(7,2) , cr_return_amt_inc_tax decimal(7,2) , cr_fee decimal(7,2) , cr_return_ship_cost decimal(7,2) , cr_refunded_cash decimal(7,2) , cr_reversed_charge decimal(7,2) , cr_store_credit decimal(7,2) , cr_net_loss decimal(7,2) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/catalog_returns* | gsfs://192.168.0.90:5003/catalog_returns*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with catalog_returns_err; DROP FOREIGN TABLE IF EXISTS web_returns_ext; CREATE FOREIGN TABLE web_returns_ext ( wr_returned_date_sk bigint , wr_returned_time_sk bigint , wr_item_sk bigint , wr_refunded_customer_sk bigint , wr_refunded_cdemo_sk bigint , wr_refunded_hdemo_sk bigint , wr_refunded_addr_sk bigint , wr_returning_customer_sk bigint , wr_returning_cdemo_sk bigint , wr_returning_hdemo_sk bigint , wr_returning_addr_sk bigint , wr_web_page_sk bigint , wr_reason_sk bigint , wr_order_number bigint , wr_return_quantity bigint , wr_return_amt decimal(7,2) , wr_return_tax decimal(7,2) , wr_return_amt_inc_tax decimal(7,2) , wr_fee decimal(7,2) , wr_return_ship_cost decimal(7,2) , wr_refunded_cash decimal(7,2) , wr_reversed_charge decimal(7,2) , wr_account_credit decimal(7,2) , wr_net_loss decimal(7,2) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/web_returns* | gsfs://192.168.0.90:5003/web_returns*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with web_returns_err; DROP FOREIGN TABLE IF EXISTS web_sales_ext; CREATE FOREIGN TABLE web_sales_ext ( ws_sold_date_sk bigint , ws_sold_time_sk bigint , ws_ship_date_sk bigint , ws_item_sk bigint , ws_bill_customer_sk bigint , ws_bill_cdemo_sk bigint , ws_bill_hdemo_sk bigint , ws_bill_addr_sk bigint , ws_ship_customer_sk bigint , ws_ship_cdemo_sk bigint , ws_ship_hdemo_sk bigint , ws_ship_addr_sk bigint , ws_web_page_sk bigint , ws_web_site_sk bigint , ws_ship_mode_sk bigint , ws_warehouse_sk bigint , ws_promo_sk bigint , ws_order_number bigint , ws_quantity bigint , ws_wholesale_cost decimal(7,2) , ws_list_price decimal(7,2) , ws_sales_price decimal(7,2) , ws_ext_discount_amt decimal(7,2) , ws_ext_sales_price decimal(7,2) , ws_ext_wholesale_cost decimal(7,2) , ws_ext_list_price decimal(7,2) , ws_ext_tax decimal(7,2) , ws_coupon_amt decimal(7,2) , ws_ext_ship_cost decimal(7,2) , ws_net_paid decimal(7,2) , ws_net_paid_inc_tax decimal(7,2) , ws_net_paid_inc_ship decimal(7,2) , ws_net_paid_inc_ship_tax decimal(7,2) , ws_net_profit decimal(7,2) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/web_sales* | gsfs://192.168.0.90:5003/web_sales*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with web_sales_err; DROP FOREIGN TABLE IF EXISTS catalog_sales_ext; CREATE FOREIGN TABLE catalog_sales_ext ( cs_sold_date_sk bigint , cs_sold_time_sk bigint , cs_ship_date_sk bigint , cs_bill_customer_sk bigint , cs_bill_cdemo_sk bigint , cs_bill_hdemo_sk bigint , cs_bill_addr_sk bigint , cs_ship_customer_sk bigint , cs_ship_cdemo_sk bigint , cs_ship_hdemo_sk bigint , cs_ship_addr_sk bigint , cs_call_center_sk bigint , cs_catalog_page_sk bigint , cs_ship_mode_sk bigint , cs_warehouse_sk bigint , cs_item_sk bigint , cs_promo_sk bigint , cs_order_number bigint , cs_quantity bigint , cs_wholesale_cost decimal(7,2) , cs_list_price decimal(7,2) , cs_sales_price decimal(7,2) , cs_ext_discount_amt decimal(7,2) , cs_ext_sales_price decimal(7,2) , cs_ext_wholesale_cost decimal(7,2) , cs_ext_list_price decimal(7,2) , cs_ext_tax decimal(7,2) , cs_coupon_amt decimal(7,2) , cs_ext_ship_cost decimal(7,2) , cs_net_paid decimal(7,2) , cs_net_paid_inc_tax decimal(7,2) , cs_net_paid_inc_ship decimal(7,2) , cs_net_paid_inc_ship_tax decimal(7,2) , cs_net_profit decimal(7,2) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/catalog_sales* | gsfs://192.168.0.90:5003/catalog_sales*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with catalog_sales_err; DROP FOREIGN TABLE IF EXISTS store_sales_ext; CREATE FOREIGN TABLE store_sales_ext ( ss_sold_date_sk bigint , ss_sold_time_sk bigint , ss_item_sk bigint , ss_customer_sk bigint , ss_cdemo_sk bigint , ss_hdemo_sk bigint , ss_addr_sk bigint , ss_store_sk bigint , ss_promo_sk bigint , ss_ticket_number bigint , ss_quantity bigint , ss_wholesale_cost decimal(7,2) , ss_list_price decimal(7,2) , ss_sales_price decimal(7,2) , ss_ext_discount_amt decimal(7,2) , ss_ext_sales_price decimal(7,2) , ss_ext_wholesale_cost decimal(7,2) , ss_ext_list_price decimal(7,2) , ss_ext_tax decimal(7,2) , ss_coupon_amt decimal(7,2) , ss_net_paid decimal(7,2) , ss_net_paid_inc_tax decimal(7,2) , ss_net_profit decimal(7,2) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5002/store_sales* | gsfs://192.168.0.90:5003/store_sales*', FORMAT 'TEXT' , DELIMITER '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ) with store_sales_err; 执行以下SQL语句导入数据。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 INSERT INTO customer_address SELECT * FROM customer_address_ext; INSERT INTO customer_demographics SELECT * FROM customer_demographics_ext; INSERT INTO date_dim SELECT * FROM date_dim_ext; INSERT INTO warehouse SELECT * FROM warehouse_ext; INSERT INTO ship_mode SELECT * FROM ship_mode_ext; INSERT INTO time_dim SELECT * FROM time_dim_ext; INSERT INTO reason SELECT * FROM reason_ext; INSERT INTO income_band SELECT * FROM income_band_ext; INSERT INTO item SELECT * FROM item_ext; INSERT INTO store SELECT * FROM store_ext; INSERT INTO call_center SELECT * FROM call_center_ext; INSERT INTO customer SELECT * FROM customer_ext; INSERT INTO web_site SELECT * FROM web_site_ext; INSERT INTO household_demographics SELECT * FROM household_demographics_ext; INSERT INTO web_page SELECT * FROM web_page_ext; INSERT INTO promotion SELECT * FROM promotion_ext; INSERT INTO catalog_page SELECT * FROM catalog_page_ext; INSERT INTO inventory SELECT * FROM inventory_ext; INSERT INTO catalog_returns SELECT * FROM catalog_returns_ext; INSERT INTO web_returns SELECT * FROM web_returns_ext; INSERT INTO store_returns SELECT * FROM store_returns_ext; INSERT INTO web_sales SELECT * FROM web_sales_ext; INSERT INTO catalog_sales SELECT * FROM catalog_sales_ext; INSERT INTO store_sales SELECT * FROM store_sales_ext;
-
表数据行数 表1 TPC-DS 序号 表名 行数 1 customer_address 6,000,000 2 customer_demographics 1,920,800 3 date_dim 73,049 4 warehouse 20 5 ship_mode 20 6 time_dim 86,400 7 reason 65 8 income_band 20 9 item 300,000 10 store 1,002 11 call_center 42 12 customer 12,000,000 13 web_site 54 14 household_demographics 7,200 15 web_page 3,000 16 promotion 1,500 17 catalog_page 30,000 18 inventory 783,000,000 19 catalog_returns 143,996,756 20 web_returns 71,997,522 21 store_returns 287,999,764 22 web_sales 720,000,376 23 catalog_sales 1,439,980,416 24 store_sales 2,879,987,999
-
操作步骤 使用gsql连接DWS成功后,执行以下命令创建目标表(8张表)。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 DROP TABLE IF EXISTS region; CREATE TABLE region ( R_REGIONKEY INT NOT NULL, R_NAME CHAR(25) NOT NULL, R_COMMENT VARCHAR(152) ) with (orientation = column) distribute by replication; DROP TABLE IF EXISTS nation; CREATE TABLE nation ( N_NATIONKEY INT NOT NULL, N_NAME CHAR(25) NOT NULL, N_REGIONKEY INT NOT NULL, N_COMMENT VARCHAR(152) ) with (orientation = column) distribute by replication; DROP TABLE IF EXISTS supplier; CREATE TABLE supplier ( S_SUPPKEY INT NOT NULL, S_NAME CHAR(25) NOT NULL, S_ADDRESS VARCHAR(40) NOT NULL, S_NATIONKEY INT NOT NULL, S_PHONE CHAR(15) NOT NULL, S_ACCTBAL DECIMAL(15,2) NOT NULL, S_COMMENT VARCHAR(101) NOT NULL ) with (orientation = column) distribute by hash(S_SUPPKEY); DROP TABLE IF EXISTS customer; CREATE TABLE customer ( C_CUSTKEY INT NOT NULL, C_NAME VARCHAR(25) NOT NULL, C_ADDRESS VARCHAR(40) NOT NULL, C_NATIONKEY INT NOT NULL, C_PHONE CHAR(15) NOT NULL, C_ACCTBAL DECIMAL(15,2) NOT NULL, C_MKTSEGMENT CHAR(10) NOT NULL, C_COMMENT VARCHAR(117) NOT NULL ) with (orientation = column) distribute by hash(C_CUSTKEY); DROP TABLE IF EXISTS part; CREATE TABLE part ( P_PARTKEY INT NOT NULL, P_NAME VARCHAR(55) NOT NULL, P_MFGR CHAR(25) NOT NULL, P_BRAND CHAR(10) NOT NULL, P_TYPE VARCHAR(25) NOT NULL, P_SIZE INT NOT NULL, P_CONTAINER CHAR(10) NOT NULL, P_RETAILPRICE DECIMAL(15,2) NOT NULL, P_COMMENT VARCHAR(23) NOT NULL ) with (orientation = column) distribute by hash(P_PARTKEY); DROP TABLE IF EXISTS partsupp; CREATE TABLE partsupp ( PS_PARTKEY INT NOT NULL, PS_SUPPKEY INT NOT NULL, PS_AVAILQTY INT NOT NULL, PS_SUPPLYCOST DECIMAL(15,2) NOT NULL, PS_COMMENT VARCHAR(199) NOT NULL ) with (orientation = column) distribute by hash(PS_PARTKEY); DROP TABLE IF EXISTS orders; CREATE TABLE orders ( O_ORDERKEY BIGINT NOT NULL, O_CUSTKEY INT NOT NULL, O_ORDERSTATUS CHAR(1) NOT NULL, O_TOTALPRICE DECIMAL(15,2) NOT NULL, O_ORDERDATE DATE NOT NULL, O_ORDERPRIORITY CHAR(15) NOT NULL, O_CLERK CHAR(15) NOT NULL, O_SHIPPRIORITY INT NOT NULL, O_COMMENT VARCHAR(79) NOT NULL ) with (orientation = column) distribute by hash(O_ORDERKEY) PARTITION BY RANGE(O_ORDERDATE) ( PARTITION O_ORDERDATE_1 VALUES LESS THAN('1993-01-01 00:00:00'), PARTITION O_ORDERDATE_2 VALUES LESS THAN('1994-01-01 00:00:00'), PARTITION O_ORDERDATE_3 VALUES LESS THAN('1995-01-01 00:00:00'), PARTITION O_ORDERDATE_4 VALUES LESS THAN('1996-01-01 00:00:00'), PARTITION O_ORDERDATE_5 VALUES LESS THAN('1997-01-01 00:00:00'), PARTITION O_ORDERDATE_6 VALUES LESS THAN('1998-01-01 00:00:00'), PARTITION O_ORDERDATE_7 VALUES LESS THAN('1999-01-01 00:00:00') ); DROP TABLE IF EXISTS lineitem; CREATE TABLE lineitem ( L_ORDERKEY BIGINT NOT NULL, L_PARTKEY INT NOT NULL, L_SUPPKEY INT NOT NULL, L_LINENUMBER INT NOT NULL, L_QUANTITY DECIMAL(15,2) NOT NULL, L_EXTENDEDPRICE DECIMAL(15,2) NOT NULL, L_DISCOUNT DECIMAL(15,2) NOT NULL, L_TAX DECIMAL(15,2) NOT NULL, L_RETURNFLAG CHAR(1) NOT NULL, L_LINESTATUS CHAR(1) NOT NULL, L_SHIPDATE DATE NOT NULL, L_COMMITDATE DATE NOT NULL, L_RECEIPTDATE DATE NOT NULL, L_SHIPINSTRUCT CHAR(25) NOT NULL, L_SHIPMODE CHAR(10) NOT NULL, L_COMMENT VARCHAR(44) NOT NULL ) with (orientation = column) distribute by hash(L_ORDERKEY) PARTITION BY RANGE(L_SHIPDATE) ( PARTITION L_SHIPDATE_1 VALUES LESS THAN('1993-01-01 00:00:00'), PARTITION L_SHIPDATE_2 VALUES LESS THAN('1994-01-01 00:00:00'), PARTITION L_SHIPDATE_3 VALUES LESS THAN('1995-01-01 00:00:00'), PARTITION L_SHIPDATE_4 VALUES LESS THAN('1996-01-01 00:00:00'), PARTITION L_SHIPDATE_5 VALUES LESS THAN('1997-01-01 00:00:00'), PARTITION L_SHIPDATE_6 VALUES LESS THAN('1998-01-01 00:00:00'), PARTITION L_SHIPDATE_7 VALUES LESS THAN('1999-01-01 00:00:00') ); 执行以下命令创建GDS外表(8张表)。 以下每个外表的“gsfs://192.168.0.90:500x/xxx | gsfs://192.168.0.90:500x/xxx”中的IP地址和端口,请替换成安装和启动GDS中的对应的GDS的监听IP和端口。如启动两个GDS,则使用“|”区分。如果启动多个GDS,需要将所有GDS的监听IP和端口配置到外表中。 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 DROP FOREIGN TABLE IF EXISTS region_load; CREATE FOREIGN TABLE region_load ( R_REGIONKEY INT, R_NAME CHAR(25), R_COMMENT VARCHAR(152) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5000/region* | gsfs://192.168.0.90:5001/region*', format 'text', delimiter '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ); DROP FOREIGN TABLE IF EXISTS nation_load; CREATE FOREIGN TABLE nation_load ( N_NATIONKEY INT, N_NAME CHAR(25), N_REGIONKEY INT, N_COMMENT VARCHAR(152) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5000/nation* | gsfs://192.168.0.90:5001/nation*', format 'text', delimiter '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ); DROP FOREIGN TABLE IF EXISTS supplier_load; CREATE FOREIGN TABLE supplier_load ( S_SUPPKEY INT, S_NAME CHAR(25), S_ADDRESS VARCHAR(40), S_NATIONKEY INT, S_PHONE CHAR(15), S_ACCTBAL DECIMAL(15,2), S_COMMENT VARCHAR(101) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5000/supplier* | gsfs://192.168.0.90:5001/supplier*', format 'text', delimiter '|', encoding 'utf8', mode 'Normal' ); DROP FOREIGN TABLE IF EXISTS customer_load; CREATE FOREIGN TABLE customer_load ( C_CUSTKEY INT, C_NAME VARCHAR(25), C_ADDRESS VARCHAR(40), C_NATIONKEY INT, C_PHONE CHAR(15), C_ACCTBAL DECIMAL(15,2), C_MKTSEGMENT CHAR(10), C_COMMENT VARCHAR(117) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5000/customer* | gsfs://192.168.0.90:5001/customer*', format 'text', delimiter '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ); DROP FOREIGN TABLE IF EXISTS part_load; CREATE FOREIGN TABLE part_load ( P_PARTKEY INT, P_NAME VARCHAR(55), P_MFGR CHAR(25), P_BRAND CHAR(10), P_TYPE VARCHAR(25), P_SIZE INT, P_CONTAINER CHAR(10), P_RETAILPRICE DECIMAL(15,2), P_COMMENT VARCHAR(23) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5000/part.* | gsfs://192.168.0.90:5001/part.*', format 'text', delimiter '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ); DROP FOREIGN TABLE IF EXISTS partsupp_load; CREATE FOREIGN TABLE partsupp_load ( PS_PARTKEY INT, PS_SUPPKEY INT, PS_AVAILQTY INT, PS_SUPPLYCOST DECIMAL(15,2), PS_COMMENT VARCHAR(199) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5000/partsupp* | gsfs://192.168.0.90:5001/partsupp*', format 'text', delimiter '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ); DROP FOREIGN TABLE IF EXISTS orders_load; CREATE FOREIGN TABLE orders_load ( O_ORDERKEY BIGINT, O_CUSTKEY INT, O_ORDERSTATUS CHAR(1), O_TOTALPRICE DECIMAL(15,2), O_ORDERDATE DATE, O_ORDERPRIORITY CHAR(15), O_CLERK CHAR(15), O_SHIPPRIORITY INT, O_COMMENT VARCHAR(79) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5000/orders* | gsfs://192.168.0.90:5001/orders*', format 'text', delimiter '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ); DROP FOREIGN TABLE IF EXISTS lineitem_load; CREATE FOREIGN TABLE lineitem_load ( L_ORDERKEY BIGINT, L_PARTKEY INT, L_SUPPKEY INT, L_LINENUMBER INT, L_QUANTITY DECIMAL(15,2), L_EXTENDEDPRICE DECIMAL(15,2), L_DISCOUNT DECIMAL(15,2), L_TAX DECIMAL(15,2), L_RETURNFLAG CHAR(1), L_LINESTATUS CHAR(1), L_SHIPDATE DATE, L_COMMITDATE DATE, L_RECEIPTDATE DATE, L_SHIPINSTRUCT CHAR(25), L_SHIPMODE CHAR(10), L_COMMENT VARCHAR(44) ) SERVER gsmpp_server OPTIONS(location 'gsfs://192.168.0.90:5000/lineitem* | gsfs://192.168.0.90:5001/lineitem*', format 'text', delimiter '|', encoding 'utf8', FILL_MISSING_FIELDS 'true', IGNORE_EXTRA_DATA 'true', mode 'Normal' ); 执行以下命令导入数据。 1 2 3 4 5 6 7 8 INSERT INTO region SELECT * FROM region_load; INSERT INTO nation SELECT * FROM nation_load; INSERT INTO supplier SELECT * FROM supplier_load; INSERT INTO customer SELECT * FROM customer_load; INSERT INTO part SELECT * FROM part_load; INSERT INTO partsupp SELECT * FROM partsupp_load; INSERT INTO orders SELECT * FROM orders_load; INSERT INTO lineitem SELECT * FROM lineitem_load;
-
安装和启动GDS 登录GaussDB(DWS)管理控制台。 在左侧导航栏中,单击“连接客户端”。 在 “gsql 命令行客户端”的下拉列表中,选择对应版本的GaussDB(DWS)客户端。 请根据集群版本和安装客户端的操作系统,选择对应版本。 客户端CPU架构要和集群一致,如果集群是X86规格,则也应该选择X86客户端。 单击“下载”。 将GDS工具包上传至ECS的/opt目录中,本例以上传Euler Kunpeng版本的工具包为例。 在工具包所在目录下,解压工具包。 1 2 cd /opt/ unzip dws_client_8.1.x_euler_kunpeng_x64.zip 创建用户gds_user及其所属的用户组gdsgrp。此用户用于启动GDS,且需要拥有读取数据源文件目录的权限。 1 2 groupadd gdsgrp useradd -g gdsgrp gds_user 修改工具包以及数据源文件目录属主为创建的用户gds_user及其所属的用户组gdsgrp。 1 2 3 chown -R gds_user:gdsgrp /opt/ chown -R gds_user:gdsgrp /data1 chown -R gds_user:gdsgrp /data2 切换到gds_user用户。 1 su - gds_user 执行环境依赖脚本(仅8.1.x版本适用)。 1 2 cd /opt/gds/bin source gds_env 启动GDS。 1 2 3 4 /opt/gds/bin/gds -d /data1/script/tpch-kit/tpch1000X -p 192.168.0.90:5000 -H 192.168.0.0/24 -l /opt/gds/gds01_log.txt -D #TPC-H使用 /opt/gds/bin/gds -d /data2/script/tpch-kit/tpch1000X -p 192.168.0.90:5001 -H 192.168.0.0/24 -l /opt/gds/gds02_log.txt -D #TPC-H使用 /opt/gds/bin/gds -d /data1/script/tpcds-kit/tpcds1000X/ -p 192.168.0.90:5002 -H 192.168.0.0/24 -l /opt/gds/gds03_log.txt -D #TPC-DS使用 /opt/gds/bin/gds -d /data2/script/tpcds-kit/tpcds1000X/ -p 192.168.0.90:5003 -H 192.168.0.0/24 -l /opt/gds/gds04_log.txt -D #TPC-DS使用 命令中的斜体部分请根据实际填写,如果数据分片存放至多个数据盘目录,需要启动对应目录数量的GDS。 如果TPC-H和TPC-DS数据同时测试,需要启动以上4个GDS,如果只测试TPC-DS或TPC-H数据,请根据后面的“#xxx”备注启动对应的GDS服务即可。 -d dir:保存有待导入数据的数据文件所在目录。 -p ip:port:GDS监听IP和监听端口。IP替换为ECS的内网IP,确保GaussDB(DWS)能通过此IP与GDS的通讯;端口对于TPC-H取5000、5001,对于TPC-DS取5002、5003。 -H address_string:允许哪些主机连接和使用GDS服务。参数需为CIDR格式。此地址配置成GaussDB(DWS)的集群内网网段(即GDS所在的ECS与GaussDB(DWS)在同一个VPC下,以内网通讯即可),例如192.168.0.0/24。 -l log_file:存放GDS的日志文件路径及文件名。 -D:后台运行GDS。仅支持Linux操作系统下使用。
-
创建弹性云服务器ECS 参考《弹性云服务器用户指南》创建弹性云服务器,创建的规格可参见下表。 由于TPC-DS、TPC-H数据集占用空间较大,以TPC-DS 1000X和TPC-H 1000X为例,分别占用930GB和1100GB。请创建弹性云服务器时,根据需求添加数据盘,举例如下: 单测TPC-DS或者TPC-H时:挂载2块超高IO 600GB数据盘。 同时测TPC-DS和TPC-H时:挂载2块超高IO 1200GB数据盘。 表1 ECS规格 参数项 参数取值 计费模式 按需计费 区域 华北-北京4 可用区 可用区1 CPU架构 鲲鹏计算 规格 鲲鹏通用计算增强型 | kc1.8xlarge.2 32vCPUs|64 GiB 镜像 EulerOS 2.8 64bit with ARM(40GB) 数据盘 系统盘通用型SSD 40GB,数据盘要求如下: 单测TPC-DS或者TPC-H时:挂载2块超高IO 600GB数据盘。 同时测TPC-DS和TPC-H时:挂载2块超高IO 1200GB数据盘。 父主题: 创建弹性云服务器ECS和数据仓库GaussDB(DWS)
-
测试结果 如下为scale=1000的TPC-DS的性能测试结果,查询执行时间以秒(s)为单位。 表2 TPC-DS 1000X测试结果 编号 TPC-DS查询 测试结果(s) 1 Q1 1.46 2 Q2 9.33 3 Q3 2.40 4 Q4 142.24 5 Q5 6.36 6 Q6 0.82 7 Q7 3.20 8 Q8 1.02 9 Q9 10.92 10 Q10 1.68 11 Q11 78.92 12 Q12 0.53 13 Q13 3.95 14 Q14 113.09 15 Q15 2.99 16 Q16 8.08 17 Q17 6.94 18 Q18 3.58 19 Q19 1.20 20 Q20 0.51 21 Q21 0.51 22 Q22 11.37 23 Q23 188.13 24 Q24 14.51 25 Q25 6.90 26 Q26 1.30 27 Q27 3.42 28 Q28 18.44 29 Q29 5.27 30 Q30 1.09 31 Q31 7.13 32 Q32 2.21 33 Q33 2.35 34 Q34 4.00 35 Q35 3.60 36 Q36 10.27 37 Q37 0.56 38 Q38 52.97 39 Q39 7.00 40 Q40 1.29 41 Q41 0.08 42 Q42 0.66 43 Q43 2.99 44 Q44 3.05 45 Q45 1.38 46 Q46 5.86 47 Q47 10.98 48 Q48 2.32 49 Q49 3.54 50 Q50 10.30 51 Q51 13.90 52 Q52 0.63 53 Q53 1.68 54 Q54 6.27 55 Q55 0.57 56 Q56 1.60 57 Q57 4.76 58 Q58 1.89 59 Q59 20.85 60 Q60 3.21 61 Q61 1.89 62 Q62 1.83 63 Q63 2.10 64 Q64 35.18 65 Q65 14.18 66 Q66 2.71 67 Q67 231.01 68 Q68 5.41 69 Q69 1.48 70 Q70 10.46 71 Q71 5.34 72 Q72 7.81 73 Q73 2.19 74 Q74 49.95 75 Q75 19.64 76 Q76 6.32 77 Q77 2.55 78 Q78 136.59 79 Q79 8.08 80 Q80 4.90 81 Q81 1.77 82 Q82 1.32 83 Q83 0.46 84 Q84 0.52 85 Q85 3.43 86 Q86 5.01 87 Q87 53.19 88 Q88 8.94 89 Q89 2.23 90 Q90 0.77 91 Q91 0.42 92 Q92 1.06 93 Q93 13.28 94 Q94 4.90 95 Q95 41.46 96 Q96 2.16 97 Q97 12.01 98 Q98 2.04 99 Q99 3.35 100 总时长(s) 1545.93
-
测试结果 如下为scale=1000的TPC-H的性能测试结果,查询执行时间以秒(s)为单位。 表2 TPC-H 1000X测试结果 编号 TPC-H查询 测试结果(s) 1 Q1 22.15 2 Q2 2.65 3 Q3 28.29 4 Q4 49.07 5 Q5 44.45 6 Q6 1.24 7 Q7 33.26 8 Q8 32.10 9 Q9 112.67 10 Q10 20.63 11 Q11 6.49 12 Q12 13.73 13 Q13 20.61 14 Q14 3.10 15 Q15 3.45 16 Q16 7.77 17 Q17 16.97 18 Q18 81.23 19 Q19 16.74 20 Q20 16.99 21 Q21 53.11 22 Q22 10.20 23 总时长(s) 596.90
-
CDM 简介 云数据迁移 (Cloud Data Migration,简称CDM)提供同构/异构数据源之间批量数据迁移服务,帮助客户实现数据自由流动。支持多种常用数据源,如客户自建或公有云上的文件系统,关系数据库,数据仓库,NoSQL数据库,大数据云服务,对象存储等数据源。 CDM适用于以下场景: 数据上云:使用华为公有云服务时,用户可以将其历史数据或增量数据从私有云/本地数据中心/第三方公有云迁移到华为云。 云服务间数据交换:用户可以在华为云的大数据服务、数据库服务、 对象存储服务 之间相互迁移数据。例如,可以将由 MapReduce服务 (MapReduce Service,简称 MRS )处理的数据导入到数据仓库服务(Data Warehouse Service,简称DWS),进行交互式分析和报告统计收集。 云上数据回迁到本地:用户在使用公有云计算资源对海量数据进行处理后,将结果数据回流到本地业务系统,主要是各种关系型数据库和文件系统。
-
安全边界和风险规避 图2 风险规避 如上图所示,CDM可能存在以下威胁: 互联网威胁:恶意用户可能通过CDM控制台攻击CDM。 数据中心威胁:恶意CDM管理员获取用户的数据源访问信息(用户名和密码)。 恶意用户威胁:恶意用户窃取其他用户的数据。 数据暴露公网:从公网迁移数据时暴漏数据的威胁。 对于这些潜在的威胁,CDM提供以下机制来规避终端用户的风险: 针对互联网威胁:用户不能直接通过公网登录CDM控制台。CDM提供双层安全保障机制。 华为云控制台框架要求用户访问任何控制台页面都要进行用户认证。 Web应用防火墙 (Web Application Firewall,简称WAF)过滤所有控制台的请求内容并停止请求攻击代码/内容。 针对数据中心威胁:用户必须向CDM系统提供迁移源端和目的端的访问用户名和密码信息,才能完成数据迁移。避免CDM管理员获取此类信息并攻击用户的重要数据源对于CDM非常重要,CDM为此类信息提供三级保护机制。 CDM在本地数据库中存储经过AES-256加密的密码,确保用户隔离。本地数据库使用用户Ruby运行,数据库仅侦听127.0.0.1,用户没有远程访问数据库的权限。 用户实例发放完毕后,CDM将虚拟机的root和Ruby用户密码更改为随机密码且不会保存在任何地方,以阻止CDM管理员访问用户实例和含有密码信息的数据库。 CDM实例迁移以推拉模式进行,因此CDM实例在VPC上没有侦听端口,用户无法从VPC访问本地数据库或操作系统。 针对恶意用户的威胁:CDM对每个用户,使用单独的虚拟机来运行各自的CDM实例,用户之间的实例是完全隔离和安全的。恶意用户无法访问其他用户的实例。 针对数据暴漏公网的威胁:CDM的抽取-写入模型下,即使CDM绑定了弹性IP,也不会开放端口到弹性IP,攻击者无法通过弹性IP来访问和攻击CDM。不过从公网迁移数据的方式下,由于用户数据源也会暴漏在公网,存在被第三方攻击的威胁,推荐用户在数据源服务器上通过ACL或防火墙对源端进行防护,比如仅放通来自CDM绑定的弹性IP的访问请求。
-
CDM迁移原理 用户使用CDM服务时,CDM管理系统在用户VPC中发放全托管的CDM实例。此实例仅提供控制台和Rest API访问权限,用户无法通过其他接口(如SSH)访问实例。这种方式保证了CDM用户间的隔离,避免数据泄漏,同时保证VPC内不同华为云服务间数据迁移时的传输安全。用户还可以使用VPN网络将本地数据中心的数据迁移到华为云服务,具有高度的安全性。 CDM数据迁移以抽取-写入模式进行。CDM首先从源端抽取数据然后将数据写入到目的端,数据访问操作均由CDM主动发起,对于数据源(如RDS数据源)支持SSL时,会使用SSL加密传输。迁移过程要求用户提供源端和目的端数据源的用户名和密码,这些信息将存储在CDM实例的数据库中。保护这些信息对于CDM安全至关重要。 图1 CDM迁移原理
-
Linux系统主机配置 为确保Linux系统主机连通性验证成功,Linux主机需确保安装Python并开启SELinux机制,目标主机需要满足以下条件。 目标主机安装Python: 需安装Python2.6及以上版本,如果已安装Python2.6以下版本,需要在主机上安装以下模块,各系统安装命令如下: Ubuntu系统 sudo apt install python-minimal python-simplejson Centos或Euler系统 sudo yum install python-minimal python-simplejson ln -s /usr/bin/python2 /usr/bin/python 采用Apt或者Yum安装工具时,请确保已配置可用的源。 主机开启SELinux机制并安装“libselinux-python”模块: 查看SELinux状态,命令如下: /usr/sbin/sestatus “SELinux”状态参数值所对应的模式: SELinux=disabled:未开启。 SELinux=enforcing:强制模式,表示所有违反安全策略的行为都将被禁止。 SELinux=permissive:宽容模式,表示所有违反安全策略的行为不被禁止,但是会在日志中作记录。 若SELinux=disabled,则主机未开启该机制,需修改SELinux状态,步骤如下: 编辑SELinux的config文件,执行命令: vi /etc/selinux/config 根据实际情况选择修改SELinux参数为参数: SELinux=enforcing:强制模式,表示所有违反安全策略的行为都将被禁止。 SELinux=permissive:宽容模式,表示所有违反安全策略的行为不被禁止,但是会在日志中作记录。 修改完成按键盘“Esc键”,退出编辑模式,执行下面的命令,保存并退出文件。 wq 在根目录下创建隐藏文件.autorelabel,执行下面的命令后,重启Linux主机。 touch /.autorelabel 在主机上安装“libselinux-python”模块,各系统安装命令如下: Ubuntu系统 sudo apt install libselinux-python Centos或Euler系统 sudo yum install libselinux-python
-
Windows系统代理机配置 所需资源 已有Windows机器。 代理机和主机网络连通正常。 操作步骤 进入代理机,打开powershell窗口,执行netsh命令,注意按参数说明替换参数: netsh interface portproxy add v4tov4 listenaddress=${proxy_ip} listenport=${proxy_port} connectaddress=${host_ip} connectport=${host_port} 表2 参数说明 参数 参数释义 ${proxy_ip} 代理机私网IP ${proxy_port} 代理机监听端口,如54 ${host_ip} 主机私网IP ${host_port} 主机端口,一般为5986 进行安全配置,需要开通代理监听端口,即上述指令中的${proxy_port}。
-
从这里开始 表1 设备发放操作步骤列表 使用阶段 步骤 设备开发 1. 开通 设备接入服务 ,参考开发指南,完成设备开发。 LiteOS设备(LwM2M),设备需要具有设备发放功能。 原生MQTT协议设备,需要完成设备引导接口开发,使设备具有设备发放功能。 注:若设备需要使用物联网卡,可在 全球SIM联接 服务购买物联网卡和套餐。 2. 设备完成设备发放平台接入地址和设备鉴权信息的烧录。设备发放平台接入地址请在控制台中获取。 LiteOS设备(LwM2M):需要烧录设备发放平台接入地址、设备标识码、引导服务端PSK。 原生MQTT协议设备,需要烧录设备发放平台接入地址、设备ID、设备密钥。 设备发放 3. 证书:用于证书策略发放的设备需要上传证书,防止通信数据在传输过程被篡改造成安全风险。 4. 策略:策略用于控制设备按照指定策略或规则发放至不同的 物联网平台 。 5. 设备:将设备基本信息导入设备发放平台中,用于后续发放至不同的物联网平台。 设备接入物联网平台 6. 设备初次上电时,先接入到设备发放平台,随后通过Bootstrap流程引导设备获得目标物联网平台地址。
-
操作步骤 登录设备发放控制台。 在设备发放控制台,左侧导航窗格中,选择“证书”,单击“证书列表”条目的操作栏中的“验证证书”。 图1 上传CA证书完成页 在上传验证证书页面,单击“生成验证码”,单击“复制图标”复制此CA证书的随机验证码。 图2 复制验证码 CA证书验证码有效期为一天,请及时使用验证码生成验证证书并完成验证。 验证码的生成为替换机制,即对于一个CA证书,即使此前的验证码未过期,也将被新生成的验证码替换。 使用OpenSSL工具为验证证书生成密钥对。 openssl genrsa -out verificationCert.key 2048 利用此验证码生成证书签名请求文件CSR。 openssl req -new -key verificationCert.key -out verificationCert.csr CSR文件的Common Name (e.g. server FQDN or YOUR name) 需要填写此验证码。 使用CA证书、CA证书私钥和上一步骤中生成的CSR文件创建验证证书(verificationCert.crt)。 openssl x509 -req -in verificationCert.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out verificationCert.crt -days 36500 -sha256 生成验证证书用到的“rootCA.crt”和“rootCA.key”这两个文件,为“制作CA证书”中所生成的两个文件。 “-days”后的参数值指定了该证书的有效天数,此处示例为36500天,您可根据实际业务场景和需要进行调整。 上传验证证书进行验证。 图3 上传验证证书
-
操作步骤 使用OpenSSL工具为设备证书生成密钥对,即”设备证书(客户端证书)私钥”。 openssl genrsa -out deviceCert.key 2048 使用密钥对生成证书签名请求文件: openssl req -new -key deviceCert.key -out deviceCert.csr 生成证书签名请求文件时,要求填写证书唯一标识名称(Distinguished Name,DN)信息,参数说明如下表1所示。 表1 证书签名请求文件列表 提示 参数名称 取值样例 Country Name (2 letter code) []: 国家/地区 CN State or Province Name (full name) []: 省/市 GuangDong Locality Name (eg, city) []: 城市 ShenZhen Organization Name (eg, company) []: 组织机构(或公司名) Huawei Technologies Co., Ltd. Organizational Unit Name (eg, section) []: 机构部门 Cloud Dept. Common Name (eg, fully qualified host name) []: CA名称(CN) Huawei IoTDP CA Email Address []: 邮箱地址 / A challenge password []: 证书密码,如您不设置密码,可以直接回车 / An optional company name []: 可选公司名称,如您不设置,可以直接回车 / 使用CA证书、CA证书私钥和上一步骤中生成的CSR文件创建设备证书(deviceCert.crt)。 openssl x509 -req -in deviceCert.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out deviceCert.crt -days 36500 -sha256 生成设备证书用到的“rootCA.crt”和“rootCA.key”这两个文件,为“制作CA证书”中所生成的两个文件,且需要完成”验证CA证书”流程。 “-days”后的参数值指定了该证书的有效天数,此处示例为36500天,您可根据实际业务场景和需要进行调整
-
操作步骤 进入“策略”界面,单击展开“静态策略”,单击“添加实例”。 图1 创建静态策略详情 按照下方参数说明填写关键参数信息后,单击“确定”。 表1 静态策略参数列表 参数名称 说明 示例 关键字 即关键字来源中的关键字。设备发放时,如果关键字来源字符串中包含设置的关键字,则可按该实例进行发放。 将设备名称携带Beijing的设备发放至华北-北京四的物联网平台。 设备名称:WaterMeter-Beijing0001、WaterMeter-Beijing0002 关键字来源:设备名称 关键字:Beijing 发放区域:华北-北京四 发放应用:beijing-app1 将上报信息中携带Beijing的设备发放至华北-北京四的物联网平台。 关键字来源:数据上报 topic“$oc/devices/${device_id}/sys/bootstrap/up”上报信息:{ "baseStrategyKeyword": "WaterMeter-Beijing0003"} 关键字:Beijing 发放区域:华北-北京四 发放应用:beijing-app1 关键字来源 关键字来源指的是用于匹配关键字的字符串信息的数据来源。目前支持设备名称与数据上报两种形式。 如果为设备名称,则匹配关键字的字符串取设备创建后的设备名称。 如果为数据上报,则匹配关键字的字符串取设备发放过程中,发起发放请求Topic“$oc/devices/${device_id}/sys/bootstrap/up” 的上报信息json中的baseStrategyKeyword属性。 优先级别 发放策略的优先级,取值范围1 - 5级,1级为最低优先级。当一个设备符合多个发放策略时,按照优先级最高的策略实例发放。 发放区域 发放到指定区域后,设备将接入对应区域的设备接入服务。 所选区域未开通设备接入服务时,如果确定添加实例,系统将自动为您开通设备接入服务。不同区域设备接入服务价格不同,收费详情请参考价格说明。 发放应用 选择对应设备接入服务区域已创建的应用。在物联网平台中,设备由应用统一管理。 如果对应设备接入服务区域未创建应用,需要前往对应服务创建应用。
-
概述 静态策略,即设备关键字模糊匹配的发放策略。每条静态策略实例指:匹配上该策略实例的设备,将会被发放到该条策略实例关联的设备接入实例的对应资源空间(即应用)下。 设备匹配静态策略实例的机制为: 设备的发放策略为“静态策略”,设备的关键字来源字符串包含某一静态策略实例的关键字,即被认为该设备匹配上该条策略实例。关键字来源有以下两种来源类型: 设备名称:如果设备名称包含设置的关键字,即可按照该行策略指定的发放应用进行实例发放。 数据上报:如果设备在连接后,进行发放publish时,上报Topic “$oc/devices/${deviceId}/sys/bootstrap/up” 中,json上报的属性 “baseStrategyKeyword” 包含设置的关键字,即可按该实例进行发放。 一个设备最多匹配一条静态策略实例; 当一个设备匹配上多条静态策略实例时,则以优先级最高的策略实例为优先。
-
创建授权关系 被授权方进入“授权”界面,单击在“被授权列表”下的“发起授权请求”。 图1 发起授权请求 被授权方填写授权方的账号名称或者账号ID(即 IAM 的Domain Name或Domain ID),单击“获取短信验证码”。 图2 发起授权请求详情 系统将向授权方绑定的手机号发送短信验证码,被授权方从授权方获取到短信验证码,填入验证码输入框,填写“描述”信息。 被授权方单击“确定”,授权请求完成,授权关系建立。 被授权方将在“被授权列表”中查看到与其他租户建立的授权关系,授权方将在“授权列表”中查看到与其他租户建立的授权关系。被授权方可删除某一条授权关系,授权方可禁用或删除某一条授权关系。
-
设备发放对返回参数的约束 表1 TdpFuncResult 名称 说明 类型 statusCode String 函数执行状态码,用于标识函数执行过程是否出现异常,遵循HTTP状态码含义。 body String 字符串,但格式为JSON,结构为TdpFuncBody。 表2 TdpFuncBody 名称 说明 类型 status String 设备发放业务功能标识,allow表示发放成功,deny表示发放失败,设备发放使用此标识判断函数内业务功能执行成功与否。 context TdpFuncBodyContext 扩展字段,用于承载函数执行结果。 表3 TdpFuncBodyContext 名称 说明 类型 allocationResult String 发放结果,存放发放接口返回的响应结构体。 errorCode String 错误码,如发放失败,则此值需不为空。 errorMsg String 错误描述,如发放失败,则此值需不为空。 发放设备成功的返回参数样例 { "statusCode": 200, "body": "{\"status\":\"allow\",\"context\":{\"allocationResult\":\"dps返回的下发结果\"}}" } 发放设备失败的返回参数样例 { "statusCode": 200, "body": "{\"status\":\"deny\",\"context\":{\"errorCode\":\"错误码\",\"errorMsg\":\"错误描述\"}}" }
共100000条
- 1
- ...
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 240
- 241
- 242
- 243
- 244
- 245
- 246
- 247
- 248
- 249
- 250
- 251
- 252
- 253
- 254
- 255
- 256
- 257
- 258
- 259
- 260
- 261
- 262
- 263
- 264
- 265
- 266
- 267
- 268
- 269
- 270
- 271
- 272
- 273
- 274
- 275
- 276
- 277
- 278
- 279
- 280
- 281
- 282
- 283
- 284
- 285
- 286
- 287
- 288
- 289
- 290
- 291
- 292
- 293
- 294
- 295
- 296
- 297
- 298
- 299
- 300
- 301
- 302
- 303
- 304
- 305
- 306
- 307
- 308
- 309
- 310
- 311
- 312
- 313
- 314
- 315
- 316
- 317
- 318
- 319
- 320
- 321
- 322
- 323
- 324
- 325
- 326
- 327
- 328
- 329
- 330
- 331
- 332
- 333
- 334
- 335
- 336
- 337
- 338
- 339
- 340
- 341
- 342
- 343
- 344
- 345
- 346
- 347
- 348
- 349
- 350
- 351
- 352
- 353
- 354
- 355
- 356
- 357
- 358
- 359
- 360
- 361
- 362
- 363
- 364
- 365
- 366
- 367
- 368
- 369
- 370
- 371
- 372
- 373
- 374
- 375
- 376
- 377
- 378
- 379
- 380
- 381
- 382
- 383
- 384
- 385
- 386
- 387
- 388
- 389
- 390
- 391
- 392
- 393
- 394
- 395
- 396
- 397
- 398
- 399
- 400
- 401
- 402
- 403
- 404
- 405
- 406
- 407
- 408
- 409
- 410
- 411
- 412
- 413
- 414
- 415
- 416
- 417
- 418
- 419
- 420
- 421
- 422
- 423
- 424
- 425
- 426
- 427
- 428
- 429
- 430
- 431
- 432
- 433
- 434
- 435
- 436
- 437
- 438
- 439
- 440
- 441
- 442
- 443
- 444
- 445
- 446
- 447
- 448
- 449
- 450
- 451
- 452
- 453
- 454
- 455
- 456
- 457
- 458
- 459
- 460
- 461
- 462
- 463
- 464
- 465
- 466
- 467
- 468
- 469
- 470
- 471
- 472
- 473
- 474
- 475
- 476
- 477
- 478
- 479
- 480
- 481
- 482
- 483
- 484
- 485
- 486
- 487
- 488
- 489
- 490
- 491
- 492
- 493
- 494
- 495
- 496
- 497
- 498
- 499
- 500
- 501
- 502
- 503
- 504
- 505
- 506
- 507
- 508
- 509
- 510
- 511
- 512
- 513
- 514
- 515
- 516
- 517
- 518
- 519
- 520
- 521
- 522
- 523
- 524
- 525
- 526
- 527
- 528
- 529
- 530
- 531
- 532
- 533
- 534
- 535
- 536
- 537
- 538
- 539
- 540
- 541
- 542
- 543
- 544
- 545
- 546
- 547
- 548
- 549
- 550
- 551
- 552
- 553
- 554
- 555
- 556
- 557
- 558
- 559
- 560
- 561
- 562
- 563
- 564
- 565
- 566
- 567
- 568
- 569
- 570
- 571
- 572
- 573
- 574
- 575
- 576
- 577
- 578
- 579
- 580
- 581
- 582
- 583
- 584
- 585
- 586
- 587
- 588
- 589
- 590
- 591
- 592
- 593
- 594
- 595
- 596
- 597
- 598
- 599
- 600
- 601
- 602
- 603
- 604
- 605
- 606
- 607
- 608
- 609
- 610
- 611
- 612
- 613
- 614
- 615
- 616
- 617
- 618
- 619
- 620
- 621
- 622
- 623
- 624
- 625
- 626
- 627
- 628
- 629
- 630
- 631
- 632
- 633
- 634
- 635
- 636
- 637
- 638
- 639
- 640
- 641
- 642
- 643
- 644
- 645
- 646
- 647
- 648
- 649
- 650
- 651
- 652
- 653
- 654
- 655
- 656
- 657
- 658
- 659
- 660
- 661
- 662
- 663
- 664
- 665
- 666
- 667
- 668
- 669
- 670
- 671
- 672
- 673
- 674
- 675
- 676
- 677
- 678
- 679
- 680
- 681
- 682
- 683
- 684
- 685
- 686
- 687
- 688
- 689
- 690
- 691
- 692
- 693
- 694
- 695
- 696
- 697
- 698
- 699
- 700
- 701
- 702
- 703
- 704
- 705
- 706
- 707
- 708
- 709
- 710
- 711
- 712
- 713
- 714
- 715
- 716
- 717
- 718
- 719
- 720
- 721
- 722
- 723
- 724
- 725
- 726
- 727
- 728
- 729
- 730
- 731
- 732
- 733
- 734
- 735
- 736
- 737
- 738
- 739
- 740
- 741
- 742
- 743
- 744
- 745
- 746
- 747
- 748
- 749
- 750
- 751
- 752
- 753
- 754
- 755
- 756
- 757
- 758
- 759
- 760
- 761
- 762
- 763
- 764
- 765
- 766
- 767
- 768
- 769
- 770
- 771
- 772
- 773
- 774
- 775
- 776
- 777
- 778
- 779
- 780
- 781
- 782
- 783
- 784
- 785
- 786
- 787
- 788
- 789
- 790
- 791
- 792
- 793
- 794
- 795
- 796
- 797
- 798
- 799
- 800
- 801
- 802
- 803
- 804
- 805
- 806
- 807
- 808
- 809
- 810
- 811
- 812
- 813
- 814
- 815
- 816
- 817
- 818
- 819
- 820
- 821
- 822
- 823
- 824
- 825
- 826
- 827
- 828
- 829
- 830
- 831
- 832
- 833
- 834
- 835
- 836
- 837
- 838
- 839
- 840
- 841
- 842
- 843
- 844
- 845
- 846
- 847
- 848
- 849
- 850
- 851
- 852
- 853
- 854
- 855
- 856
- 857
- 858
- 859
- 860
- 861
- 862
- 863
- 864
- 865
- 866
- 867
- 868
- 869
- 870
- 871
- 872
- 873
- 874
- 875
- 876
- 877
- 878
- 879
- 880
- 881
- 882
- 883
- 884
- 885
- 886
- 887
- 888
- 889
- 890
- 891
- 892
- 893
- 894
- 895
- 896
- 897
- 898
- 899
- 900
- 901
- 902
- 903
- 904
- 905
- 906
- 907
- 908
- 909
- 910
- 911
- 912
- 913
- 914
- 915
- 916
- 917
- 918
- 919
- 920
- 921
- 922
- 923
- 924
- 925
- 926
- 927
- 928
- 929
- 930
- 931
- 932
- 933
- 934
- 935
- 936
- 937
- 938
- 939
- 940
- 941
- 942
- 943
- 944
- 945
- 946
- 947
- 948
- 949
- 950
- 951
- 952
- 953
- 954
- 955
- 956
- 957
- 958
- 959
- 960
- 961
- 962
- 963
- 964
- 965
- 966
- 967
- 968
- 969
- 970
- 971
- 972
- 973
- 974
- 975
- 976
- 977
- 978
- 979
- 980
- 981
- 982
- 983
- 984
- 985
- 986
- 987
- 988
- 989
- 990
- 991
- 992
- 993
- 994
- 995
- 996
- 997
- 998
- 999
- 1000
- 1001
- 1002
- 1003
- 1004
- 1005
- 1006
- 1007
- 1008
- 1009
- 1010
- 1011
- 1012
- 1013
- 1014
- 1015
- 1016
- 1017
- 1018
- 1019
- 1020
- 1021
- 1022
- 1023
- 1024
- 1025
- 1026
- 1027
- 1028
- 1029
- 1030
- 1031
- 1032
- 1033
- 1034
- 1035
- 1036
- 1037
- 1038
- 1039
- 1040
- 1041
- 1042
- 1043
- 1044
- 1045
- 1046
- 1047
- 1048
- 1049
- 1050
- 1051
- 1052
- 1053
- 1054
- 1055
- 1056
- 1057
- 1058
- 1059
- 1060
- 1061
- 1062
- 1063
- 1064
- 1065
- 1066
- 1067
- 1068
- 1069
- 1070
- 1071
- 1072
- 1073
- 1074
- 1075
- 1076
- 1077
- 1078
- 1079
- 1080
- 1081
- 1082
- 1083
- 1084
- 1085
- 1086
- 1087
- 1088
- 1089
- 1090
- 1091
- 1092
- 1093
- 1094
- 1095
- 1096
- 1097
- 1098
- 1099
- 1100
- 1101
- 1102
- 1103
- 1104
- 1105
- 1106
- 1107
- 1108
- 1109
- 1110
- 1111
- 1112
- 1113
- 1114
- 1115
- 1116
- 1117
- 1118
- 1119
- 1120
- 1121
- 1122
- 1123
- 1124
- 1125
- 1126
- 1127
- 1128
- 1129
- 1130
- 1131
- 1132
- 1133
- 1134
- 1135
- 1136
- 1137
- 1138
- 1139
- 1140
- 1141
- 1142
- 1143
- 1144
- 1145
- 1146
- 1147
- 1148
- 1149
- 1150
- 1151
- 1152
- 1153
- 1154
- 1155
- 1156
- 1157
- 1158
- 1159
- 1160
- 1161
- 1162
- 1163
- 1164
- 1165
- 1166
- 1167
- 1168
- 1169
- 1170
- 1171
- 1172
- 1173
- 1174
- 1175
- 1176
- 1177
- 1178
- 1179
- 1180
- 1181
- 1182
- 1183
- 1184
- 1185
- 1186
- 1187
- 1188
- 1189
- 1190
- 1191
- 1192
- 1193
- 1194
- 1195
- 1196
- 1197
- 1198
- 1199
- 1200
- 1201
- 1202
- 1203
- 1204
- 1205
- 1206
- 1207
- 1208
- 1209
- 1210
- 1211
- 1212
- 1213
- 1214
- 1215
- 1216
- 1217
- 1218
- 1219
- 1220
- 1221
- 1222
- 1223
- 1224
- 1225
- 1226
- 1227
- 1228
- 1229
- 1230
- 1231
- 1232
- 1233
- 1234
- 1235
- 1236
- 1237
- 1238
- 1239
- 1240
- 1241
- 1242
- 1243
- 1244
- 1245
- 1246
- 1247
- 1248
- 1249
- 1250
- 1251
- 1252
- 1253
- 1254
- 1255
- 1256
- 1257
- 1258
- 1259
- 1260
- 1261
- 1262
- 1263
- 1264
- 1265
- 1266
- 1267
- 1268
- 1269
- 1270
- 1271
- 1272
- 1273
- 1274
- 1275
- 1276
- 1277
- 1278
- 1279
- 1280
- 1281
- 1282
- 1283
- 1284
- 1285
- 1286
- 1287
- 1288
- 1289
- 1290
- 1291
- 1292
- 1293
- 1294
- 1295
- 1296
- 1297
- 1298
- 1299
- 1300
- 1301
- 1302
- 1303
- 1304
- 1305
- 1306
- 1307
- 1308
- 1309
- 1310
- 1311
- 1312
- 1313
- 1314
- 1315
- 1316
- 1317
- 1318
- 1319
- 1320
- 1321
- 1322
- 1323
- 1324
- 1325
- 1326
- 1327
- 1328
- 1329
- 1330
- 1331
- 1332
- 1333
- 1334
- 1335
- 1336
- 1337
- 1338
- 1339
- 1340
- 1341
- 1342
- 1343
- 1344
- 1345
- 1346
- 1347
- 1348
- 1349
- 1350
- 1351
- 1352
- 1353
- 1354
- 1355
- 1356
- 1357
- 1358
- 1359
- 1360
- 1361
- 1362
- 1363
- 1364
- 1365
- 1366
- 1367
- 1368
- 1369
- 1370
- 1371
- 1372
- 1373
- 1374
- 1375
- 1376
- 1377
- 1378
- 1379
- 1380
- 1381
- 1382
- 1383
- 1384
- 1385
- 1386
- 1387
- 1388
- 1389
- 1390
- 1391
- 1392
- 1393
- 1394
- 1395
- 1396
- 1397
- 1398
- 1399
- 1400
- 1401
- 1402
- 1403
- 1404
- 1405
- 1406
- 1407
- 1408
- 1409
- 1410
- 1411
- 1412
- 1413
- 1414
- 1415
- 1416
- 1417
- 1418
- 1419
- 1420
- 1421
- 1422
- 1423
- 1424
- 1425
- 1426
- 1427
- 1428
- 1429
- 1430
- 1431
- 1432
- 1433
- 1434
- 1435
- 1436
- 1437
- 1438
- 1439
- 1440
- 1441
- 1442
- 1443
- 1444
- 1445
- 1446
- 1447
- 1448
- 1449
- 1450
- 1451
- 1452
- 1453
- 1454
- 1455
- 1456
- 1457
- 1458
- 1459
- 1460
- 1461
- 1462
- 1463
- 1464
- 1465
- 1466
- 1467
- 1468
- 1469
- 1470
- 1471
- 1472
- 1473
- 1474
- 1475
- 1476
- 1477
- 1478
- 1479
- 1480
- 1481
- 1482
- 1483
- 1484
- 1485
- 1486
- 1487
- 1488
- 1489
- 1490
- 1491
- 1492
- 1493
- 1494
- 1495
- 1496
- 1497
- 1498
- 1499
- 1500
- 1501
- 1502
- 1503
- 1504
- 1505
- 1506
- 1507
- 1508
- 1509
- 1510
- 1511
- 1512
- 1513
- 1514
- 1515
- 1516
- 1517
- 1518
- 1519
- 1520
- 1521
- 1522
- 1523
- 1524
- 1525
- 1526
- 1527
- 1528
- 1529
- 1530
- 1531
- 1532
- 1533
- 1534
- 1535
- 1536
- 1537
- 1538
- 1539
- 1540
- 1541
- 1542
- 1543
- 1544
- 1545
- 1546
- 1547
- 1548
- 1549
- 1550
- 1551
- 1552
- 1553
- 1554
- 1555
- 1556
- 1557
- 1558
- 1559
- 1560
- 1561
- 1562
- 1563
- 1564
- 1565
- 1566
- 1567
- 1568
- 1569
- 1570
- 1571
- 1572
- 1573
- 1574
- 1575
- 1576
- 1577
- 1578
- 1579
- 1580
- 1581
- 1582
- 1583
- 1584
- 1585
- 1586
- 1587
- 1588
- 1589
- 1590
- 1591
- 1592
- 1593
- 1594
- 1595
- 1596
- 1597
- 1598
- 1599
- 1600
- 1601
- 1602
- 1603
- 1604
- 1605
- 1606
- 1607
- 1608
- 1609
- 1610
- 1611
- 1612
- 1613
- 1614
- 1615
- 1616
- 1617
- 1618
- 1619
- 1620
- 1621
- 1622
- 1623
- 1624
- 1625
- 1626
- 1627
- 1628
- 1629
- 1630
- 1631
- 1632
- 1633
- 1634
- 1635
- 1636
- 1637
- 1638
- 1639
- 1640
- 1641
- 1642
- 1643
- 1644
- 1645
- 1646
- 1647
- 1648
- 1649
- 1650
- 1651
- 1652
- 1653
- 1654
- 1655
- 1656
- 1657
- 1658
- 1659
- 1660
- 1661
- 1662
- 1663
- 1664
- 1665
- 1666
- 1667
- 1668
- 1669
- 1670
- 1671
- 1672
- 1673
- 1674
- 1675
- 1676
- 1677
- 1678
- 1679
- 1680
- 1681
- 1682
- 1683
- 1684
- 1685
- 1686
- 1687
- 1688
- 1689
- 1690
- 1691
- 1692
- 1693
- 1694
- 1695
- 1696
- 1697
- 1698
- 1699
- 1700
- 1701
- 1702
- 1703
- 1704
- 1705
- 1706
- 1707
- 1708
- 1709
- 1710
- 1711
- 1712
- 1713
- 1714
- 1715
- 1716
- 1717
- 1718
- 1719
- 1720
- 1721
- 1722
- 1723
- 1724
- 1725
- 1726
- 1727
- 1728
- 1729
- 1730
- 1731
- 1732
- 1733
- 1734
- 1735
- 1736
- 1737
- 1738
- 1739
- 1740
- 1741
- 1742
- 1743
- 1744
- 1745
- 1746
- 1747
- 1748
- 1749
- 1750
- 1751
- 1752
- 1753
- 1754
- 1755
- 1756
- 1757
- 1758
- 1759
- 1760
- 1761
- 1762
- 1763
- 1764
- 1765
- 1766
- 1767
- 1768
- 1769
- 1770
- 1771
- 1772
- 1773
- 1774
- 1775
- 1776
- 1777
- 1778
- 1779
- 1780
- 1781
- 1782
- 1783
- 1784
- 1785
- 1786
- 1787
- 1788
- 1789
- 1790
- 1791
- 1792
- 1793
- 1794
- 1795
- 1796
- 1797
- 1798
- 1799
- 1800
- 1801
- 1802
- 1803
- 1804
- 1805
- 1806
- 1807
- 1808
- 1809
- 1810
- 1811
- 1812
- 1813
- 1814
- 1815
- 1816
- 1817
- 1818
- 1819
- 1820
- 1821
- 1822
- 1823
- 1824
- 1825
- 1826
- 1827
- 1828
- 1829
- 1830
- 1831
- 1832
- 1833
- 1834
- ...
- 1835
- 1836
- 1837
- 1838
- 1839
- 1840
- 1841
- 1842
- 1843
- 1844
- 1845
- 1846
- 1847
- 1848
- 1849
- 1850
- 1851
- 1852
- 1853
- 1854
- 1855
- 1856
- 1857
- 1858
- 1859
- 1860
- 1861
- 1862
- 1863
- 1864
- 1865
- 1866
- 1867
- 1868
- 1869
- 1870
- 1871
- 1872
- 1873
- 1874
- 1875
- 1876
- 1877
- 1878
- 1879
- 1880
- 1881
- 1882
- 1883
- 1884
- 1885
- 1886
- 1887
- 1888
- 1889
- 1890
- 1891
- 1892
- 1893
- 1894
- 1895
- 1896
- 1897
- 1898
- 1899
- 1900
- 1901
- 1902
- 1903
- 1904
- 1905
- 1906
- 1907
- 1908
- 1909
- 1910
- 1911
- 1912
- 1913
- 1914
- 1915
- 1916
- 1917
- 1918
- 1919
- 1920
- 1921
- 1922
- 1923
- 1924
- 1925
- 1926
- 1927
- 1928
- 1929
- 1930
- 1931
- 1932
- 1933
- 1934
- 1935
- 1936
- 1937
- 1938
- 1939
- 1940
- 1941
- 1942
- 1943
- 1944
- 1945
- 1946
- 1947
- 1948
- 1949
- 1950
- 1951
- 1952
- 1953
- 1954
- 1955
- 1956
- 1957
- 1958
- 1959
- 1960
- 1961
- 1962
- 1963
- 1964
- 1965
- 1966
- 1967
- 1968
- 1969
- 1970
- 1971
- 1972
- 1973
- 1974
- 1975
- 1976
- 1977
- 1978
- 1979
- 1980
- 1981
- 1982
- 1983
- 1984
- 1985
- 1986
- 1987
- 1988
- 1989
- 1990
- 1991
- 1992
- 1993
- 1994
- 1995
- 1996
- 1997
- 1998
- 1999
- 2000
- 2001
- 2002
- 2003
- 2004
- 2005
- 2006
- 2007
- 2008
- 2009
- 2010
- 2011
- 2012
- 2013
- 2014
- 2015
- 2016
- 2017
- 2018
- 2019
- 2020
- 2021
- 2022
- 2023
- 2024
- 2025
- 2026
- 2027
- 2028
- 2029
- 2030
- 2031
- 2032
- 2033
- 2034
- 2035
- 2036
- 2037
- 2038
- 2039
- 2040
- 2041
- 2042
- 2043
- 2044
- 2045
- 2046
- 2047
- 2048
- 2049
- 2050
- 2051
- 2052
- 2053
- 2054
- 2055
- 2056
- 2057
- 2058
- 2059
- 2060
- 2061
- 2062
- 2063
- 2064
- 2065
- 2066
- 2067
- 2068
- 2069
- 2070
- 2071
- 2072
- 2073
- 2074
- 2075
- 2076
- 2077
- 2078
- 2079
- 2080
- 2081
- 2082
- 2083
- 2084
- 2085
- 2086
- 2087
- 2088
- 2089
- 2090
- 2091
- 2092
- 2093
- 2094
- 2095
- 2096
- 2097
- 2098
- 2099
- 2100
- 2101
- 2102
- 2103
- 2104
- 2105
- 2106
- 2107
- 2108
- 2109
- 2110
- 2111
- 2112
- 2113
- 2114
- 2115
- 2116
- 2117
- 2118
- 2119
- 2120
- 2121
- 2122
- 2123
- 2124
- 2125
- 2126
- 2127
- 2128
- 2129
- 2130
- 2131
- 2132
- 2133
- 2134
- 2135
- 2136
- 2137
- 2138
- 2139
- 2140
- 2141
- 2142
- 2143
- 2144
- 2145
- 2146
- 2147
- 2148
- 2149
- 2150
- 2151
- 2152
- 2153
- 2154
- 2155
- 2156
- 2157
- 2158
- 2159
- 2160
- 2161
- 2162
- 2163
- 2164
- 2165
- 2166
- 2167
- 2168
- 2169
- 2170
- 2171
- 2172
- 2173
- 2174
- 2175
- 2176
- 2177
- 2178
- 2179
- 2180
- 2181
- 2182
- 2183
- 2184
- 2185
- 2186
- 2187
- 2188
- 2189
- 2190
- 2191
- 2192
- 2193
- 2194
- 2195
- 2196
- 2197
- 2198
- 2199
- 2200
- 2201
- 2202
- 2203
- 2204
- 2205
- 2206
- 2207
- 2208
- 2209
- 2210
- 2211
- 2212
- 2213
- 2214
- 2215
- 2216
- 2217
- 2218
- 2219
- 2220
- 2221
- 2222
- 2223
- 2224
- 2225
- 2226
- 2227
- 2228
- 2229
- 2230
- 2231
- 2232
- 2233
- 2234
- 2235
- 2236
- 2237
- 2238
- 2239
- 2240
- 2241
- 2242
- 2243
- 2244
- 2245
- 2246
- 2247
- 2248
- 2249
- 2250
- 2251
- 2252
- 2253
- 2254
- 2255
- 2256
- 2257
- 2258
- 2259
- 2260
- 2261
- 2262
- 2263
- 2264
- 2265
- 2266
- 2267
- 2268
- 2269
- 2270
- 2271
- 2272
- 2273
- 2274
- 2275
- 2276
- 2277
- 2278
- 2279
- 2280
- 2281
- 2282
- 2283
- 2284
- 2285
- 2286
- 2287
- 2288
- 2289
- 2290
- 2291
- 2292
- 2293
- 2294
- 2295
- 2296
- 2297
- 2298
- 2299
- 2300
- 2301
- 2302
- 2303
- 2304
- 2305
- 2306
- 2307
- 2308
- 2309
- 2310
- 2311
- 2312
- 2313
- 2314
- 2315
- 2316
- 2317
- 2318
- 2319
- 2320
- 2321
- 2322
- 2323
- 2324
- 2325
- 2326
- 2327
- 2328
- 2329
- 2330
- 2331
- 2332
- 2333
- 2334
- 2335
- 2336
- 2337
- 2338
- 2339
- 2340
- 2341
- 2342
- 2343
- 2344
- 2345
- 2346
- 2347
- 2348
- 2349
- 2350
- 2351
- 2352
- 2353
- 2354
- 2355
- 2356
- 2357
- 2358
- 2359
- 2360
- 2361
- 2362
- 2363
- 2364
- 2365
- 2366
- 2367
- 2368
- 2369
- 2370
- 2371
- 2372
- 2373
- 2374
- 2375
- 2376
- 2377
- 2378
- 2379
- 2380
- 2381
- 2382
- 2383
- 2384
- 2385
- 2386
- 2387
- 2388
- 2389
- 2390
- 2391
- 2392
- 2393
- 2394
- 2395
- 2396
- 2397
- 2398
- 2399
- 2400
- 2401
- 2402
- 2403
- 2404
- 2405
- 2406
- 2407
- 2408
- 2409
- 2410
- 2411
- 2412
- 2413
- 2414
- 2415
- 2416
- 2417
- 2418
- 2419
- 2420
- 2421
- 2422
- 2423
- 2424
- 2425
- 2426
- 2427
- 2428
- 2429
- 2430
- 2431
- 2432
- 2433
- 2434
- 2435
- 2436
- 2437
- 2438
- 2439
- 2440
- 2441
- 2442
- 2443
- 2444
- 2445
- 2446
- 2447
- 2448
- 2449
- 2450
- 2451
- 2452
- 2453
- 2454
- 2455
- 2456
- 2457
- 2458
- 2459
- 2460
- 2461
- 2462
- 2463
- 2464
- 2465
- 2466
- 2467
- 2468
- 2469
- 2470
- 2471
- 2472
- 2473
- 2474
- 2475
- 2476
- 2477
- 2478
- 2479
- 2480
- 2481
- 2482
- 2483
- 2484
- 2485
- 2486
- 2487
- 2488
- 2489
- 2490
- 2491
- 2492
- 2493
- 2494
- 2495
- 2496
- 2497
- 2498
- 2499
- 2500
- 2501
- 2502
- 2503
- 2504
- 2505
- 2506
- 2507
- 2508
- 2509
- 2510
- 2511
- 2512
- 2513
- 2514
- 2515
- 2516
- 2517
- 2518
- 2519
- 2520
- 2521
- 2522
- 2523
- 2524
- 2525
- 2526
- 2527
- 2528
- 2529
- 2530
- 2531
- 2532
- 2533
- 2534
- 2535
- 2536
- 2537
- 2538
- 2539
- 2540
- 2541
- 2542
- 2543
- 2544
- 2545
- 2546
- 2547
- 2548
- 2549
- 2550
- 2551
- 2552
- 2553
- 2554
- 2555
- 2556
- 2557
- 2558
- 2559
- 2560
- 2561
- 2562
- 2563
- 2564
- 2565
- 2566
- 2567
- 2568
- 2569
- 2570
- 2571
- 2572
- 2573
- 2574
- 2575
- 2576
- 2577
- 2578
- 2579
- 2580
- 2581
- 2582
- 2583
- 2584
- 2585
- 2586
- 2587
- 2588
- 2589
- 2590
- 2591
- 2592
- 2593
- 2594
- 2595
- 2596
- 2597
- 2598
- 2599
- 2600
- 2601
- 2602
- 2603
- 2604
- 2605
- 2606
- 2607
- 2608
- 2609
- 2610
- 2611
- 2612
- 2613
- 2614
- 2615
- 2616
- 2617
- 2618
- 2619
- 2620
- 2621
- 2622
- 2623
- 2624
- 2625
- 2626
- 2627
- 2628
- 2629
- 2630
- 2631
- 2632
- 2633
- 2634
- 2635
- 2636
- 2637
- 2638
- 2639
- 2640
- 2641
- 2642
- 2643
- 2644
- 2645
- 2646
- 2647
- 2648
- 2649
- 2650
- 2651
- 2652
- 2653
- 2654
- 2655
- 2656
- 2657
- 2658
- 2659
- 2660
- 2661
- 2662
- 2663
- 2664
- 2665
- 2666
- 2667
- 2668
- 2669
- 2670
- 2671
- 2672
- 2673
- 2674
- 2675
- 2676
- 2677
- 2678
- 2679
- 2680
- 2681
- 2682
- 2683
- 2684
- 2685
- 2686
- 2687
- 2688
- 2689
- 2690
- 2691
- 2692
- 2693
- 2694
- 2695
- 2696
- 2697
- 2698
- 2699
- 2700
- 2701
- 2702
- 2703
- 2704
- 2705
- 2706
- 2707
- 2708
- 2709
- 2710
- 2711
- 2712
- 2713
- 2714
- 2715
- 2716
- 2717
- 2718
- 2719
- 2720
- 2721
- 2722
- 2723
- 2724
- 2725
- 2726
- 2727
- 2728
- 2729
- 2730
- 2731
- 2732
- 2733
- 2734
- 2735
- 2736
- 2737
- 2738
- 2739
- 2740
- 2741
- 2742
- 2743
- 2744
- 2745
- 2746
- 2747
- 2748
- 2749
- 2750
- 2751
- 2752
- 2753
- 2754
- 2755
- 2756
- 2757
- 2758
- 2759
- 2760
- 2761
- 2762
- 2763
- 2764
- 2765
- 2766
- 2767
- 2768
- 2769
- 2770
- 2771
- 2772
- 2773
- 2774
- 2775
- 2776
- 2777
- 2778
- 2779
- 2780
- 2781
- 2782
- 2783
- 2784
- 2785
- 2786
- 2787
- 2788
- 2789
- 2790
- 2791
- 2792
- 2793
- 2794
- 2795
- 2796
- 2797
- 2798
- 2799
- 2800
- 2801
- 2802
- 2803
- 2804
- 2805
- 2806
- 2807
- 2808
- 2809
- 2810
- 2811
- 2812
- 2813
- 2814
- 2815
- 2816
- 2817
- 2818
- 2819
- 2820
- 2821
- 2822
- 2823
- 2824
- 2825
- 2826
- 2827
- 2828
- 2829
- 2830
- 2831
- 2832
- 2833
- 2834
- 2835
- 2836
- 2837
- 2838
- 2839
- 2840
- 2841
- 2842
- 2843
- 2844
- 2845
- 2846
- 2847
- 2848
- 2849
- 2850
- 2851
- 2852
- 2853
- 2854
- 2855
- 2856
- 2857
- 2858
- 2859
- 2860
- 2861
- 2862
- 2863
- 2864
- 2865
- 2866
- 2867
- 2868
- 2869
- 2870
- 2871
- 2872
- 2873
- 2874
- 2875
- 2876
- 2877
- 2878
- 2879
- 2880
- 2881
- 2882
- 2883
- 2884
- 2885
- 2886
- 2887
- 2888
- 2889
- 2890
- 2891
- 2892
- 2893
- 2894
- 2895
- 2896
- 2897
- 2898
- 2899
- 2900
- 2901
- 2902
- 2903
- 2904
- 2905
- 2906
- 2907
- 2908
- 2909
- 2910
- 2911
- 2912
- 2913
- 2914
- 2915
- 2916
- 2917
- 2918
- 2919
- 2920
- 2921
- 2922
- 2923
- 2924
- 2925
- 2926
- 2927
- 2928
- 2929
- 2930
- 2931
- 2932
- 2933
- 2934
- 2935
- 2936
- 2937
- 2938
- 2939
- 2940
- 2941
- 2942
- 2943
- 2944
- 2945
- 2946
- 2947
- 2948
- 2949
- 2950
- 2951
- 2952
- 2953
- 2954
- 2955
- 2956
- 2957
- 2958
- 2959
- 2960
- 2961
- 2962
- 2963
- 2964
- 2965
- 2966
- 2967
- 2968
- 2969
- 2970
- 2971
- 2972
- 2973
- 2974
- 2975
- 2976
- 2977
- 2978
- 2979
- 2980
- 2981
- 2982
- 2983
- 2984
- 2985
- 2986
- 2987
- 2988
- 2989
- 2990
- 2991
- 2992
- 2993
- 2994
- 2995
- 2996
- 2997
- 2998
- 2999
- 3000
- 3001
- 3002
- 3003
- 3004
- 3005
- 3006
- 3007
- 3008
- 3009
- 3010
- 3011
- 3012
- 3013
- 3014
- 3015
- 3016
- 3017
- 3018
- 3019
- 3020
- 3021
- 3022
- 3023
- 3024
- 3025
- 3026
- 3027
- 3028
- 3029
- 3030
- 3031
- 3032
- 3033
- 3034
- 3035
- 3036
- 3037
- 3038
- 3039
- 3040
- 3041
- 3042
- 3043
- 3044
- 3045
- 3046
- 3047
- 3048
- 3049
- 3050
- 3051
- 3052
- 3053
- 3054
- 3055
- 3056
- 3057
- 3058
- 3059
- 3060
- 3061
- 3062
- 3063
- 3064
- 3065
- 3066
- 3067
- 3068
- 3069
- 3070
- 3071
- 3072
- 3073
- 3074
- 3075
- 3076
- 3077
- 3078
- 3079
- 3080
- 3081
- 3082
- 3083
- 3084
- 3085
- 3086
- 3087
- 3088
- 3089
- 3090
- 3091
- 3092
- 3093
- 3094
- 3095
- 3096
- 3097
- 3098
- 3099
- 3100
- 3101
- 3102
- 3103
- 3104
- 3105
- 3106
- 3107
- 3108
- 3109
- 3110
- 3111
- 3112
- 3113
- 3114
- 3115
- 3116
- 3117
- 3118
- 3119
- 3120
- 3121
- 3122
- 3123
- 3124
- 3125
- 3126
- 3127
- 3128
- 3129
- 3130
- 3131
- 3132
- 3133
- 3134
- 3135
- 3136
- 3137
- 3138
- 3139
- 3140
- 3141
- 3142
- 3143
- 3144
- 3145
- 3146
- 3147
- 3148
- 3149
- 3150
- 3151
- 3152
- 3153
- 3154
- 3155
- 3156
- 3157
- 3158
- 3159
- 3160
- 3161
- 3162
- 3163
- 3164
- 3165
- 3166
- 3167
- 3168
- 3169
- 3170
- 3171
- 3172
- 3173
- 3174
- 3175
- 3176
- 3177
- 3178
- 3179
- 3180
- 3181
- 3182
- 3183
- 3184
- 3185
- 3186
- 3187
- 3188
- 3189
- 3190
- 3191
- 3192
- 3193
- 3194
- 3195
- 3196
- 3197
- 3198
- 3199
- 3200
- 3201
- 3202
- 3203
- 3204
- 3205
- 3206
- 3207
- 3208
- 3209
- 3210
- 3211
- 3212
- 3213
- 3214
- 3215
- 3216
- 3217
- 3218
- 3219
- 3220
- 3221
- 3222
- 3223
- 3224
- 3225
- 3226
- 3227
- 3228
- 3229
- 3230
- 3231
- 3232
- 3233
- 3234
- 3235
- 3236
- 3237
- 3238
- 3239
- 3240
- 3241
- 3242
- 3243
- 3244
- 3245
- 3246
- 3247
- 3248
- 3249
- 3250
- 3251
- 3252
- 3253
- 3254
- 3255
- 3256
- 3257
- 3258
- 3259
- 3260
- 3261
- 3262
- 3263
- 3264
- 3265
- 3266
- 3267
- 3268
- 3269
- 3270
- 3271
- 3272
- 3273
- 3274
- 3275
- 3276
- 3277
- 3278
- 3279
- 3280
- 3281
- 3282
- 3283
- 3284
- 3285
- 3286
- 3287
- 3288
- 3289
- 3290
- 3291
- 3292
- 3293
- 3294
- 3295
- 3296
- 3297
- 3298
- 3299
- 3300
- 3301
- 3302
- 3303
- 3304
- 3305
- 3306
- 3307
- 3308
- 3309
- 3310
- 3311
- 3312
- 3313
- 3314
- 3315
- 3316
- 3317
- 3318
- 3319
- 3320
- 3321
- 3322
- 3323
- 3324
- 3325
- 3326
- 3327
- 3328
- 3329
- 3330
- 3331
- 3332
- 3333
- 3333
推荐文章