Kudu DDL

  1. CREATE TABLE customer
  2. (
  3. c_custkey INT,
  4. c_name STRING,
  5. c_address STRING,
  6. c_city STRING,
  7. c_nation STRING,
  8. c_region STRING,
  9. c_phone STRING,
  10. c_mktsegment STRING,
  11. primary key(c_custkey)
  12. )
  13. PARTITION BY HASH PARTITIONS 16
  14. STORED AS KUDU;
  15. CREATE TABLE dates
  16. (
  17. d_datekey INT,
  18. d_date STRING,
  19. d_dayofweek STRING,
  20. d_month STRING,
  21. d_year INT,
  22. d_yearmonthnum INT,
  23. d_yearmonth STRING,
  24. d_daynuminweek INT,
  25. d_daynuminmonth INT,
  26. d_daynuminyear INT,
  27. d_monthnuminyear INT,
  28. d_weeknuminyear INT,
  29. d_sellingseason STRING,
  30. d_lastdayinweekfl INT,
  31. d_lastdayinmonthfl INT,
  32. d_holidayfl INT,
  33. d_weekdayfl INT,
  34. primary key(d_datekey)
  35. )
  36. PARTITION BY HASH PARTITIONS 16
  37. STORED AS KUDU;
  38. CREATE TABLE lineorder
  39. (
  40. `lo_orderkey` bigint,
  41. `lo_linenumber` bigint,
  42. `lo_custkey` int,
  43. `lo_partkey` int,
  44. `lo_suppkey` int,
  45. `lo_orderdate` int,
  46. `lo_orderpriotity` string,
  47. `lo_shippriotity` int,
  48. `lo_quantity` bigint,
  49. `lo_extendedprice` bigint,
  50. `lo_ordtotalprice` bigint,
  51. `lo_discount` bigint,
  52. `lo_revenue` bigint,
  53. `lo_supplycost` bigint,
  54. `lo_tax` bigint,
  55. `lo_commitdate` int,
  56. `lo_shipmode` string,
  57. PRIMARY KEY(lo_orderkey, lo_linenumber)
  58. )
  59. PARTITION BY HASH PARTITIONS 16
  60. STORED AS KUDU;
  61. CREATE TABLE part
  62. (
  63. p_partkey INT,
  64. p_name STRING,
  65. p_mfgr STRING,
  66. p_category STRING,
  67. p_brand STRING,
  68. p_color STRING,
  69. p_type STRING,
  70. p_size INT,
  71. p_container STRING,
  72. primary key(p_partkey)
  73. )
  74. PARTITION BY HASH PARTITIONS 16
  75. STORED AS KUDU;
  76. CREATE TABLE supplier
  77. (
  78. s_suppkey INT,
  79. s_name STRING,
  80. s_address STRING,
  81. s_city STRING,
  82. s_nation STRING,
  83. s_region STRING,
  84. s_phone STRING,
  85. primary key(s_suppkey)
  86. )
  87. PARTITION BY HASH PARTITIONS 16
  88. STORED AS KUDU;
  89. CREATE VIEW `p_lineorder` AS SELECT `lineorder`.`lo_orderkey`,
  90. `lineorder`.`lo_linenumber`,
  91. `lineorder`.`lo_custkey`,
  92. `lineorder`.`lo_partkey`,
  93. `lineorder`.`lo_suppkey`,
  94. `lineorder`.`lo_orderdate`,
  95. `lineorder`.`lo_orderpriotity`,
  96. `lineorder`.`lo_shippriotity`,
  97. `lineorder`.`lo_quantity`,
  98. `lineorder`.`lo_extendedprice`,
  99. `lineorder`.`lo_ordtotalprice`,
  100. `lineorder`.`lo_discount`,
  101. `lineorder`.`lo_revenue`,
  102. `lineorder`.`lo_supplycost`,
  103. `lineorder`.`lo_tax`,
  104. `lineorder`.`lo_commitdate`,
  105. `lineorder`.`lo_shipmode`,
  106. `lineorder`.`lo_extendedprice`*`lineorder`.`lo_discount` AS `V_REVENUE`
  107. FROM `LINEORDER`;

Flink DDL

  1. CREATE TABLE default_catalog.default_database.customer
  2. (
  3. c_custkey INT,
  4. c_name STRING,
  5. c_address STRING,
  6. c_city STRING,
  7. c_nation STRING,
  8. c_region STRING,
  9. c_phone STRING,
  10. c_mktsegment STRING
  11. ) with (
  12. 'connector.master' = 'hz-hadoop-test-199-141-27:7051',
  13. 'connector.table' = 'impala::yjuny_kudu.customer',
  14. 'connector.property-version' = '1',
  15. 'connector.type' = 'kudu-retract',
  16. 'connector.primary-key.0' = 'c_custkey'
  17. )
  18. CREATE TABLE default_catalog.default_database.dates
  19. (
  20. d_datekey INT,
  21. d_date STRING,
  22. d_dayofweek STRING,
  23. d_month STRING,
  24. d_year INT,
  25. d_yearmonthnum INT,
  26. d_yearmonth STRING,
  27. d_daynuminweek INT,
  28. d_daynuminmonth INT,
  29. d_daynuminyear INT,
  30. d_monthnuminyear INT,
  31. d_weeknuminyear INT,
  32. d_sellingseason STRING,
  33. d_lastdayinweekfl INT,
  34. d_lastdayinmonthfl INT,
  35. d_holidayfl INT,
  36. d_weekdayfl INT
  37. ) with (
  38. 'connector.master' = 'hz-hadoop-test-199-141-27:7051',
  39. 'connector.table' = 'impala::yjuny_kudu.dates',
  40. 'connector.property-version' = '1',
  41. 'connector.type' = 'kudu-retract',
  42. 'connector.primary-key.0' = 'd_datekey'
  43. )
  44. CREATE TABLE default_catalog.default_database.lineorder
  45. (
  46. `lo_orderkey` bigint,
  47. `lo_linenumber` bigint,
  48. `lo_custkey` int,
  49. `lo_partkey` int,
  50. `lo_suppkey` int,
  51. `lo_orderdate` int,
  52. `lo_orderpriotity` string,
  53. `lo_shippriotity` int,
  54. `lo_quantity` bigint,
  55. `lo_extendedprice` bigint,
  56. `lo_ordtotalprice` bigint,
  57. `lo_discount` bigint,
  58. `lo_revenue` bigint,
  59. `lo_supplycost` bigint,
  60. `lo_tax` bigint,
  61. `lo_commitdate` int,
  62. `lo_shipmode` string
  63. ) with (
  64. 'connector.master' = 'hz-hadoop-test-199-141-27:7051',
  65. 'connector.table' = 'impala::yjuny_kudu.lineorder',
  66. 'connector.property-version' = '1',
  67. 'connector.type' = 'kudu-retract',
  68. 'connector.primary-key.0' = 'lo_orderkey',
  69. 'connector.primary-key.1' = 'lo_linenumber'
  70. )
  71. CREATE TABLE default_catalog.default_database.part
  72. (
  73. p_partkey INT,
  74. p_name STRING,
  75. p_mfgr STRING,
  76. p_category STRING,
  77. p_brand STRING,
  78. p_color STRING,
  79. p_type STRING,
  80. p_size INT,
  81. p_container STRING
  82. ) with (
  83. 'connector.master' = 'hz-hadoop-test-199-141-27:7051',
  84. 'connector.table' = 'impala::yjuny_kudu.part',
  85. 'connector.property-version' = '1',
  86. 'connector.type' = 'kudu-retract',
  87. 'connector.primary-key.0' = 'p_partkey'
  88. )
  89. CREATE TABLE default_catalog.default_database.supplier
  90. (
  91. s_suppkey INT,
  92. s_name STRING,
  93. s_address STRING,
  94. s_city STRING,
  95. s_nation STRING,
  96. s_region STRING,
  97. s_phone STRING
  98. ) with (
  99. 'connector.master' = 'hz-hadoop-test-199-141-27:7051',
  100. 'connector.table' = 'impala::yjuny_kudu.supplier',
  101. 'connector.property-version' = '1',
  102. 'connector.type' = 'kudu-retract',
  103. 'connector.primary-key.0' = 's_suppkey'
  104. )

作业配置

  1. INSERT INTO job (job_id, name, description, tenant_id, project_id) VALUES (1, 'ssb_etl', null, 1, 1);
  2. INSERT INTO job_exec_env (job_id, mode, parallelism) VALUES (1, 'BATCH', 1);
  3. INSERT INTO job_script_sql (job_id, name, position, script, description, sql_type, dialect) VALUES (1, 'customer_insert', 1, 'insert into customer select * from flink_hive.ssb.customer', null, 'INSERT', 'FLINK');
  4. INSERT INTO job_script_sql (job_id, name, position, script, description, sql_type, dialect) VALUES (1, 'dates_insert', 1, 'insert into dates select * from flink_hive.ssb.dates', null, 'INSERT', 'FLINK');
  5. INSERT INTO job_script_sql (job_id, name, position, script, description, sql_type, dialect) VALUES (1, 'supplier_insert', 1, 'insert into lineorder select * from flink_hive.ssb.lineorder', null, 'INSERT', 'FLINK');
  6. INSERT INTO job_script_sql (job_id, name, position, script, description, sql_type, dialect) VALUES (1, 'part_insert', 1, 'insert into part select * from flink_hive.ssb.part', null, 'INSERT', 'FLINK');
  7. INSERT INTO job_script_sql (job_id, name, position, script, description, sql_type, dialect) VALUES (1, 'supplier_insert', 1, 'insert into supplier select * from flink_hive.ssb.supplier', null, 'INSERT', 'FLINK');
  8. INSERT INTO cluster (cluster_id, cluster_name, type, deploy_type, status, description, cluster_master_host, cluster_master_port) VALUES (1, 'flink1.10-yjuny', 'FLINK', 'YARN-SESSION', 'RUNNING', null, 'hz-hadoop-test-199-141-30', 43420);
  9. INSERT INTO cluster_yarn (cluster_id, application_id, user, queue) VALUES (1, 'application_1581335885532_12895', 'flink', 'root.flink');
  10. INSERT INTO cluster_config (cluster_id, key, value) VALUES (1, '__cmd.start', './bin/yarn-session.sh -tm 8192 -d -s 2 -jm 4096 -nm flink1.10-yjuny ');