• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

Flink Hudi 测试

武飞扬头像
訾零
帮助1

组件版本

组件

版本

Java

1.8.251

Scala

1.12.14

Flink

1.12.2

hudi

0.9.0

Hadoop

2.9.2

Hive

2.3.6

hdfs-site.xml,core-site.xml,hive-site.xml放入resources下

测试代码

  1.  
    object TestFlinkSQLOptHudi {
  2.  
    private var logger: org.slf4j.Logger = _
  3.  
     
  4.  
    def main(args: Array[String]): Unit = {
  5.  
    logger = LoggerFactory.getLogger(this.getClass.getSimpleName)
  6.  
    Logger.getLogger("org.apache").setLevel(Level.WARN)
  7.  
    Logger.getLogger("hive.metastore").setLevel(Level.WARN)
  8.  
    Logger.getLogger("akka").setLevel(Level.INFO)
  9.  
     
  10.  
    val tableEnv = FlinkUtils.initStreamTableEnvironment()
  11.  
     
  12.  
    // datagen source 随机生成数据
  13.  
    // val sourceDDL =
  14.  
    // """
  15.  
    // |create table datagen_source (
  16.  
    // | id int,
  17.  
    // | data string,
  18.  
    // | ts as localtimestamp,
  19.  
    // | watermark for ts as ts
  20.  
    // |) with (
  21.  
    // | 'connector' = 'datagen',
  22.  
    // | 'rows-per-second'='10',
  23.  
    // | 'fields.id.kind'='sequence',
  24.  
    // | 'fields.id.start'='1',
  25.  
    // | 'fields.id.end'='100000',
  26.  
    // | 'fields.data.length'='5'
  27.  
    // |)
  28.  
    // |""".stripMargin
  29.  
    // tableEnv.executeSql(sourceDDL)
  30.  
     
  31.  
    // kafka sink
  32.  
    // val sinkDDL =
  33.  
    // """
  34.  
    // |create table kafka_sink (
  35.  
    // | id int,
  36.  
    // | data string,
  37.  
    // | ts timestamp
  38.  
    // |) with (
  39.  
    // | 'connector' = 'kafka',
  40.  
    // | 'topic' = 'kafka_sink',
  41.  
    // | 'properties.bootstrap.servers' = 'test-lakehouse:9092',
  42.  
    // | 'properties.group.id' = 'lakehouse',
  43.  
    // | 'scan.startup.mode' = 'earliest-offset',
  44.  
    // | 'format' = 'json',
  45.  
    // | 'json.fail-on-missing-field' = 'false',
  46.  
    // | 'json.ignore-parse-errors' = 'true'
  47.  
    // |)
  48.  
    // |""".stripMargin
  49.  
    // tableEnv.executeSql(sinkDDL)
  50.  
     
  51.  
    // insert to kafka
  52.  
    // val insertDML =
  53.  
    // """
  54.  
    // |insert into kafka_sink
  55.  
    // |select * from datagen_soure
  56.  
    // |""".stripMargin
  57.  
    // tableEnv.executeSql(insertDML)
  58.  
     
  59.  
    // 1. 建表,写表
  60.  
    // val writeTableDDL =
  61.  
    // """
  62.  
    // |create table if not exists hudi_test_table (
  63.  
    // | id int,
  64.  
    // | data string,
  65.  
    // | ts timestamp(3),
  66.  
    // | `time` string,
  67.  
    // | `date` string
  68.  
    // |) partitioned by (`date`)
  69.  
    // | with (
  70.  
    // | 'connector' = 'hudi',
  71.  
    // | 'table.type' = 'MERGE_ON_READ',
  72.  
    // | 'path' = 'hdfs://test-lakehouse:9000/lakehouse/hudi_test_table',
  73.  
    // // | 'path'='file:///F:\workspace\lakehouse-hudi\test\src\main\resources\hudi_test_table',
  74.  
    // | 'write.tasks' = '1',
  75.  
    // | 'hoodie.datasource.write.recordkey.field' = 'id',
  76.  
    // | 'write.precombine.field' = 'ts',
  77.  
    // | 'compaction.tasks' = '1',
  78.  
    // | 'compaction.trigger.strategy' = 'num_or_time',
  79.  
    // | 'compaction.delta_commits' = '2',
  80.  
    // | 'compaction.delta_seconds' = '300'
  81.  
    // |)
  82.  
    // |""".stripMargin
  83.  
    // tableEnv.executeSql(writeTableDDL)
  84.  
     
  85.  
    // 2. 直接写入数据
  86.  
    // val insertDML =
  87.  
    // """
  88.  
    // |insert into hudi_test_table values
  89.  
    // |(1, 'a', timestamp '2021-09-26 00:00:01', '2021-09-26 00:00:01', '2021-09-26'),
  90.  
    // |(2, 'b', timestamp '2021-09-26 00:00:02', '2021-09-26 00:00:02', '2021-09-26'),
  91.  
    // |(3, 'c', timestamp '2021-09-26 00:00:03', '2021-09-26 00:00:03', '2021-09-26'),
  92.  
    // |(4, 'd', timestamp '2021-09-27 00:00:04', '2021-09-27 00:00:04', '2021-09-27'),
  93.  
    // |(5, 'e', timestamp '2021-09-27 00:00:05', '2021-09-27 00:00:05', '2021-09-27'),
  94.  
    // |(6, 'f', timestamp '2021-09-27 00:00:06', '2021-09-27 00:00:06', '2021-09-27')
  95.  
    // |""".stripMargin
  96.  
    // tableEnv.executeSql(insertDML)
  97.  
    // 查询结果
  98.  
    // ---- --- ------- --------------------- --------------------- ------------
  99.  
    //| op | d | a | ts | time | date |
  100.  
    // ---- --- - -- --------------------- --------------------- ------------
  101.  
    //| I | 1 | a | 2021-09-26T00:00:01 | 2021-09-26 00:00:01 | 2021-09-26 |
  102.  
    //| I | 2 | b | 2021-09-26T00:00:02 | 2021-09-26 00:00:02 | 2021-09-26 |
  103.  
    //| I | 3 | c | 2021-09-26T00:00:03 | 2021-09-26 00:00:03 | 2021-09-26 |
  104.  
    //| I | 4 | d | 2021-09-27T00:00:04 | 2021-09-27 00:00:04 | 2021-09-27 |
  105.  
    //| I | 5 | e | 2021-09-27T00:00:05 | 2021-09-27 00:00:05 | 2021-09-27 |
  106.  
    //| I | 6 | f | 2021-09-27T00:00:06 | 2021-09-27 00:00:06 | 2021-09-27 |
  107.  
     
  108.  
    // update 数据
  109.  
    // val updateDML =
  110.  
    // """
  111.  
    // |insert into t1 values
  112.  
    // |('1','update',timestamp '2021-09-26 12:12:12', date '2021-09-26')
  113.  
    // |""".stripMargin
  114.  
    // tableEnv.executeSql(updateDML)
  115.  
    // 查询结果
  116.  
    // ---- --- --------- --------------------- --------------------- ------------
  117.  
    //| op | d | a | ts | time | date |
  118.  
    // ---- --- -------- --------------------- --------------------- ------------
  119.  
    //| I | 1 | update | 2021-09-26T12:12:12 | 2021-09-26 12:12:12 | 2021-09-26 |
  120.  
    //| I | 2 | b | 2021-09-26T00:00:02 | 2021-09-26 00:00:02 | 2021-09-26 |
  121.  
    //| I | 3 | c | 2021-09-26T00:00:03 | 2021-09-26 00:00:03 | 2021-09-26 |
  122.  
    //| I | 4 | d | 2021-09-27T00:00:04 | 2021-09-27 00:00:04 | 2021-09-27 |
  123.  
    //| I | 5 | e | 2021-09-27T00:00:05 | 2021-09-27 00:00:05 | 2021-09-27 |
  124.  
    //| I | 6 | f | 2021-09-27T00:00:06 | 2021-09-27 00:00:06 | 2021-09-27 |
  125.  
     
  126.  
    // 3. source 数据写入 hudi
  127.  
    // val insertDML =
  128.  
    // """
  129.  
    // |insert into hudi_test_table
  130.  
    // |select
  131.  
    // | id,
  132.  
    // | data,
  133.  
    // | ts,
  134.  
    // | date_format(ts, 'yyyy-MM-dd HH:mm:ss') as `time`,
  135.  
    // | date_format(ts, 'yyyy-MM-dd') as `date`
  136.  
    // |from datagen_source
  137.  
    // |""".stripMargin
  138.  
    // tableEnv.executeSql(insertDML)
  139.  
     
  140.  
    // 4. 流表查询
  141.  
    tableEnv.executeSql("drop table if exists hudi_test_table")
  142.  
    val readTableDDL =
  143.  
    """
  144.  
    |create table if not exists hudi_test_table (
  145.  
    | id int,
  146.  
    | data string,
  147.  
    | ts timestamp(3),
  148.  
    | `time` string,
  149.  
    | `date` string
  150.  
    |) partitioned by (`date`)
  151.  
    | with (
  152.  
    | 'connector' = 'hudi',
  153.  
    | 'table.type' = 'MERGE_ON_READ',
  154.  
    | 'path' = 'hdfs://test-lakehouse:9000/lakehouse/hudi_test_table',
  155.  
    | 'hoodie.datasource.write.recordkey.field' = 'id',
  156.  
    // | 'hoodie.datasource.query.type' = 'snapshot',
  157.  
    | 'read.tasks' = '1',
  158.  
    | 'read.streaming.enabled' = 'true',
  159.  
    | 'read.streaming.check-interval' = '5',
  160.  
    | 'read.streaming.start-commit' = '000',
  161.  
    | 'read.utc-timezone' = 'false'
  162.  
    |)
  163.  
    |""".stripMargin
  164.  
    tableEnv.executeSql(readTableDDL)
  165.  
     
  166.  
    val queryDML =
  167.  
    """
  168.  
    |select count(distinct id) from hudi_test_table where `date` = '2021-09-30'
  169.  
    |""".stripMargin
  170.  
    tableEnv.executeSql(queryDML).print()
  171.  
     
  172.  
    // 或者 print sink
  173.  
    val sinkDDL =
  174.  
    // val sinkDDL =
  175.  
    // """
  176.  
    // |create table print_sink (
  177.  
    // | id int,
  178.  
    // | data string,
  179.  
    // | ts timestamp(3),
  180.  
    // | `time` string,
  181.  
    // | `date` string
  182.  
    // |) with (
  183.  
    // | 'connector' = 'print'
  184.  
    // |)
  185.  
    // |""".stripMargin
  186.  
    // tableEnv.executeSql(sinkDDL)
  187.  
    //
  188.  
    // val queryDML =
  189.  
    // """
  190.  
    // |insert into print_sink
  191.  
    // |select * from hudi_test_table
  192.  
    // |""".stripMargin
  193.  
    // tableEnv.executeSql(queryDML)
  194.  
    }
  195.  
    }
学新通

sql-client 测试

本地测试模式

将 hudi-flink-bundle_2.11-0.9.0.jar 放入 $FLINK_HOME/lib 下,启动sql-client既可。

sql-client embedded

yarn-cluster模式

选择一台服务器创建 session

./bin/yarn-session.sh -d -nm dwd_test -yjm 3g -ytm 10g -ys 2

 检查session是否正常

yarn application -list | grep application_1632050203454_167491

查看 applictionId

在该服务器上每次创建 session,applictionId 都会改变。

  1.  
    # cat /tmp/.yarn-properties-user,比如 hdfs用户启动的session
  2.  
     
  3.  
    cat /tmp/.yarn-properties-hdfs
  4.  
     
  5.  
    #Generated YARN properties file
  6.  
    #Wed Sep 29 17:00:09 CST 2021
  7.  
    dynamicPropertiesString=
  8.  
    applicationID=application_1632050203454_167491

切换 hdfs 用户启动 sql-client 进行测试,如果 /tmp/.yarn-properties-hdfs 中 applicationId 发生改变,该会话将不可用,所以测试时只创建一次 session,可启动多个 sql-client 多个 Job 往该session提交即可。

  1.  
    bin/sql-client.sh embedded -s application_1632050203454_167491
  2.  
     
  3.  
    # 检查会话是否可用
  4.  
    select now();

部分参数设置

  1.  
    set execution.checkpointing.interval = 10sec;
  2.  
     
  3.  
    set execution.result-mode = tableau;
  4.  
     
  5.  
    set execution.restart-strategy.type = fixed-delay;
  6.  
    set execution.restart-strategy.attempts = 10;
  7.  
    set execution.restart-strategy.delay = 10000;

建表

  1.  
    create table if not exists datagen_source (
  2.  
    id int,
  3.  
    data string,
  4.  
    ts as localtimestamp,
  5.  
    watermark for ts as ts
  6.  
    ) with (
  7.  
    'connector' = 'datagen',
  8.  
    --'number-of-rows' = '10000',
  9.  
    'rows-per-second'='10',
  10.  
    'fields.id.kind'='sequence',
  11.  
    'fields.id.start'='1',
  12.  
    'fields.id.end'='100000',
  13.  
    'fields.data.length'='5'
  14.  
    );
  15.  
     
  16.  
    create table if not exists hudi_test_table(
  17.  
    id int,
  18.  
    data string,
  19.  
    ts timestamp(3),
  20.  
    `time` string,
  21.  
    `date` string
  22.  
    ) comment 'flink hudi ods table : 用户维系记录表'
  23.  
    partitioned by (`date`)
  24.  
    with (
  25.  
    'connector' = 'hudi',
  26.  
    'table.type' = 'MERGE_ON_READ',
  27.  
    'path' = 'hdfs:///user/hive/datalake/hudi_test_db/hudi_test_table',
  28.  
    'read.tasks' = '1',
  29.  
    'read.streaming.enabled' = 'true',
  30.  
    'read.streaming.check-interval' = '10',
  31.  
    'read.streaming.start-commit' = '000',
  32.  
    'read.utc-timezone' = 'false',
  33.  
    'write.tasks' = '1',
  34.  
    'write.rate.limit' = '2000',
  35.  
    'write.bucket_assign.tasks' = '3',
  36.  
    'write.precombine.field' = 'ts',
  37.  
    'write.index_bootstrap.tasks' = '3'
  38.  
    'index.global.enabled' = 'true'
  39.  
    'index.bootstrap.enabled' = 'true'
  40.  
    'index.state.ttl' = '15'
  41.  
    'clean.retain_commits' = '60',
  42.  
    'hoodie.datasource.write.recordkey.field' = 'id',
  43.  
    'hoodie.datasource.write.partitionpath.field' = 'date',
  44.  
    'hoodie.datasource.query.type' = 'snapshot',
  45.  
    'hoodie.datasource.merge.type' = 'payload_combine',
  46.  
    'compaction.tasks' = '1',
  47.  
    'compaction.trigger.strategy' = 'num_or_time',
  48.  
    'compaction.delta_commits' = '5',
  49.  
    'compaction.delta_seconds' = '300',
  50.  
    'compaction.max_memory' = '1024'
  51.  
    'hive_sync.enable' = 'true',
  52.  
    'hive_sync.metastore.uris' = 'thrift://ip:9083',
  53.  
    'hive_sync.jdbc_url' = 'jdbc:hive2://ip:10000',
  54.  
    'hive_sync.use_jdbc' = 'true',
  55.  
    'hive_sync.db' = 'hudi_test_db',
  56.  
    'hive_sync.table' = 'hudi_test_table',
  57.  
    'hive_sync.partition_fields' = 'date',
  58.  
    --'hive_sync.partition_extractor_class' = 'org.apache.hudi.hive.NonPartitionedExtractor',
  59.  
    'hive_sync.partition_extractor_class' = 'org.apache.hudi.hive.MultiPartKeysValueExtractor',
  60.  
    'hive_sync.file_format' = 'PARQUET',
  61.  
    'hive_sync.support_timestamp' = 'true',
  62.  
    'hive_sync.username' = 'hive',
  63.  
    'hive_sync.password' = '123456'
  64.  
    );
学新通

写入

  1.  
    -- 直接写入
  2.  
    insert into hudi_test_table values
  3.  
    (1, 'a', timestamp '2021-09-26 00:00:01', '2021-09-26 00:00:01', '2021-09-26'),
  4.  
    (2, 'b', timestamp '2021-09-26 00:00:02', '2021-09-26 00:00:02', '2021-09-26'),
  5.  
    (3, 'c', timestamp '2021-09-26 00:00:03', '2021-09-26 00:00:03', '2021-09-26'),
  6.  
    (4, 'd', timestamp '2021-09-27 00:00:04', '2021-09-27 00:00:04', '2021-09-27'),
  7.  
    (5, 'e', timestamp '2021-09-27 00:00:05', '2021-09-27 00:00:05', '2021-09-27'),
  8.  
    (6, 'f', timestamp '2021-09-27 00:00:06', '2021-09-27 00:00:06', '2021-09-27');
  9.  
     
  10.  
    -- 单条 upsert
  11.  
    insert into hudi_test_table values
  12.  
    (1, 'update', timestamp '2021-09-26 12:12:12', '2021-09-26 12:12:12', '2021-09-26');
  13.  
     
  14.  
    -- 从 source 写入
  15.  
    insert into hudi_test_table
  16.  
    select
  17.  
    id,
  18.  
    data,
  19.  
    ts,
  20.  
    date_format(ts, 'yyyy-MM-dd HH:mm:ss') as `time`,
  21.  
    date_format(ts, 'yyyy-MM-dd') as `date`
  22.  
    from datagen_source;
学新通

流读

  1.  
    set table.dynamic-table-options.enabled = true;
  2.  
    select count(0) from
  3.  
    /* OPTIONS('read.tasks' = '10', 'read.streaming.enabled' = 'true') */;

pom文件

  1.  
    <properties>
  2.  
    <!-- project compiler -->
  3.  
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  4.  
    <maven.compiler.source>1.8</maven.compiler.source>
  5.  
    <maven.compiler.target>1.8</maven.compiler.target>
  6.  
    <!-- maven compiler-->
  7.  
    <scala.maven.plugin.version>3.2.2</scala.maven.plugin.version>
  8.  
    <maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
  9.  
    <maven.assembly.plugin.version>3.1.1</maven.assembly.plugin.version>
  10.  
    <!-- sdk -->
  11.  
    <java.version>1.8</java.version>
  12.  
    <scala.version>2.12.13</scala.version>
  13.  
    <scala.binary.version>2.12</scala.binary.version>
  14.  
    <!-- engine-->
  15.  
    <hadoop.version>2.9.2</hadoop.version>
  16.  
    <flink.version>1.12.2</flink.version>
  17.  
    <hoodie.version>0.9.0</hoodie.version>
  18.  
    <hive.version>2.3.9</hive.version>
  19.  
     
  20.  
    <!-- <scope.type>provided</scope.type>-->
  21.  
    <scope.type>compile</scope.type>
  22.  
    </properties>
  23.  
     
  24.  
    <dependencies>
  25.  
    <!-- scala -->
  26.  
    <dependency>
  27.  
    <groupId>org.scala-lang</groupId>
  28.  
    <artifactId>scala-library</artifactId>
  29.  
    <version>${scala.version}</version>
  30.  
    <scope>${scope.type}</scope>
  31.  
    </dependency>
  32.  
     
  33.  
    <!-- flink Dependency -->
  34.  
    <dependency>
  35.  
    <groupId>org.apache.flink</groupId>
  36.  
    <artifactId>flink-runtime-web_${scala.binary.version}</artifactId>
  37.  
    <version>${flink.version}</version>
  38.  
    <scope>${scope.type}</scope>
  39.  
    </dependency>
  40.  
    <dependency>
  41.  
    <groupId>org.apache.flink</groupId>
  42.  
    <artifactId>flink-core</artifactId>
  43.  
    <version>${flink.version}</version>
  44.  
    <scope>${scope.type}</scope>
  45.  
    </dependency>
  46.  
    <dependency>
  47.  
    <groupId>org.apache.flink</groupId>
  48.  
    <artifactId>flink-scala_${scala.binary.version}</artifactId>
  49.  
    <version>${flink.version}</version>
  50.  
    <scope>${scope.type}</scope>
  51.  
    </dependency>
  52.  
    <dependency>
  53.  
    <groupId>org.apache.flink</groupId>
  54.  
    <artifactId>flink-table-common</artifactId>
  55.  
    <version>${flink.version}</version>
  56.  
    <scope>${scope.type}</scope>
  57.  
    </dependency>
  58.  
    <dependency>
  59.  
    <groupId>org.apache.flink</groupId>
  60.  
    <artifactId>flink-table-api-scala-bridge_${scala.binary.version}</artifactId>
  61.  
    <version>${flink.version}</version>
  62.  
    <scope>${scope.type}</scope>
  63.  
    </dependency>
  64.  
    <dependency>
  65.  
    <groupId>org.apache.flink</groupId>
  66.  
    <artifactId>flink-streaming-scala_${scala.binary.version}</artifactId>
  67.  
    <version>${flink.version}</version>
  68.  
    <scope>${scope.type}</scope>
  69.  
    </dependency>
  70.  
    <dependency>
  71.  
    <groupId>org.apache.flink</groupId>
  72.  
    <artifactId>flink-table-planner-blink_${scala.binary.version}</artifactId>
  73.  
    <version>${flink.version}</version>
  74.  
    <scope>${scope.type}</scope>
  75.  
    </dependency>
  76.  
    <dependency>
  77.  
    <groupId>org.apache.flink</groupId>
  78.  
    <artifactId>flink-clients_${scala.binary.version}</artifactId>
  79.  
    <version>${flink.version}</version>
  80.  
    <scope>${scope.type}</scope>
  81.  
    </dependency>
  82.  
    <dependency>
  83.  
    <groupId>org.apache.flink</groupId>
  84.  
    <artifactId>flink-csv</artifactId>
  85.  
    <version>${flink.version}</version>
  86.  
    <scope>${scope.type}</scope>
  87.  
    </dependency>
  88.  
    <dependency>
  89.  
    <groupId>org.apache.flink</groupId>
  90.  
    <artifactId>flink-json</artifactId>
  91.  
    <version>${flink.version}</version>
  92.  
    <scope>${scope.type}</scope>
  93.  
    </dependency>
  94.  
    <dependency>
  95.  
    <groupId>org.apache.flink</groupId>
  96.  
    <artifactId>flink-orc_${scala.binary.version}</artifactId>
  97.  
    <version>${flink.version}</version>
  98.  
    <scope>${scope.type}</scope>
  99.  
    </dependency>
  100.  
    <dependency>
  101.  
    <groupId>org.apache.flink</groupId>
  102.  
    <artifactId>flink-statebackend-rocksdb_2.11</artifactId>
  103.  
    <version>${flink.version}</version>
  104.  
    <scope>${scope.type}</scope>
  105.  
    </dependency>
  106.  
    <dependency>
  107.  
    <groupId>org.apache.flink</groupId>
  108.  
    <artifactId>flink-sql-connector-kafka_${scala.binary.version}</artifactId>
  109.  
    <version>${flink.version}</version>
  110.  
    <scope>${scope.type}</scope>
  111.  
    </dependency>
  112.  
    <dependency>
  113.  
    <groupId>org.apache.flink</groupId>
  114.  
    <artifactId>flink-statebackend-rocksdb_2.11</artifactId>
  115.  
    <version>${flink.version}</version>
  116.  
    <scope>${scope.type}</scope>
  117.  
    </dependency>
  118.  
    <dependency>
  119.  
    <groupId>org.apache.flink</groupId>
  120.  
    <artifactId>flink-connector-hive_${scala.binary.version}</artifactId>
  121.  
    <version>${flink.version}</version>
  122.  
    <scope>${scope.type}</scope>
  123.  
    </dependency>
  124.  
    <dependency>
  125.  
    <groupId>com.alibaba.ververica</groupId>
  126.  
    <artifactId>flink-sql-connector-mysql-cdc</artifactId>
  127.  
    <version>1.2.0</version>
  128.  
    <scope>${scope.type}</scope>
  129.  
    </dependency>
  130.  
     
  131.  
    <!-- hudi Dependency -->
  132.  
    <dependency>
  133.  
    <groupId>org.apache.hudi</groupId>
  134.  
    <artifactId>hudi-flink-bundle_${scala.binary.version}</artifactId>
  135.  
    <version>${hoodie.version}</version>
  136.  
    <scope>${scope.type}</scope>
  137.  
    </dependency>
  138.  
    <dependency>
  139.  
    <groupId>org.apache.hudi</groupId>
  140.  
    <artifactId>hudi-flink-client</artifactId>
  141.  
    <version>${hoodie.version}</version>
  142.  
    <scope>${scope.type}</scope>
  143.  
    </dependency>
  144.  
     
  145.  
    <!-- hadoop Dependency-->
  146.  
    <dependency>
  147.  
    <groupId>org.apache.hadoop</groupId>
  148.  
    <artifactId>hadoop-common</artifactId>
  149.  
    <version>${hadoop.version}</version>
  150.  
    <scope>${scope.type}</scope>
  151.  
    </dependency>
  152.  
    <dependency>
  153.  
    <groupId>org.apache.hadoop</groupId>
  154.  
    <artifactId>hadoop-hdfs</artifactId>
  155.  
    <version>${hadoop.version}</version>
  156.  
    <scope>${scope.type}</scope>
  157.  
    </dependency>
  158.  
    <dependency>
  159.  
    <groupId>org.apache.hadoop</groupId>
  160.  
    <artifactId>hadoop-client</artifactId>
  161.  
    <version>${hadoop.version}</version>
  162.  
    <scope>${scope.type}</scope>
  163.  
    </dependency>
  164.  
     
  165.  
    <!-- hive Dependency-->
  166.  
    <dependency>
  167.  
    <groupId>org.apache.hive</groupId>
  168.  
    <artifactId>hive-exec</artifactId>
  169.  
    <version>${hive.version}</version>
  170.  
    <scope>${scope.type}</scope>
  171.  
    <exclusions>
  172.  
    <exclusion>
  173.  
    <groupId>org.apache.logging.log4j</groupId>
  174.  
    <artifactId>log4j-slf4j-impl</artifactId>
  175.  
    </exclusion>
  176.  
    <exclusion>
  177.  
    <groupId>org.apache.hive</groupId>
  178.  
    <artifactId>hive-llap-tez</artifactId>
  179.  
    </exclusion>
  180.  
    </exclusions>
  181.  
    </dependency>
  182.  
    </dependencies>
  183.  
     
  184.  
    <build>
  185.  
    <plugins>
  186.  
    <plugin>
  187.  
    <groupId>net.alchim31.maven</groupId>
  188.  
    <artifactId>scala-maven-plugin</artifactId>
  189.  
    <version>${scala.maven.plugin.version}</version>
  190.  
    <executions>
  191.  
    <execution>
  192.  
    <goals>
  193.  
    <goal>compile</goal>
  194.  
    </goals>
  195.  
    </execution>
  196.  
    </executions>
  197.  
    </plugin>
  198.  
    <plugin>
  199.  
    <groupId>org.apache.maven.plugins</groupId>
  200.  
    <artifactId>maven-assembly-plugin</artifactId>
  201.  
    <version>${maven.assembly.plugin.version}</version>
  202.  
    <configuration>
  203.  
    <descriptorRefs>
  204.  
    <descriptorRef>jar-with-dependencies</descriptorRef>
  205.  
    </descriptorRefs>
  206.  
    </configuration>
  207.  
    <executions>
  208.  
    <execution>
  209.  
    <id>make-assembly</id>
  210.  
    <phase>package</phase>
  211.  
    <goals>
  212.  
    <goal>single</goal>
  213.  
    </goals>
  214.  
    </execution>
  215.  
    </executions>
  216.  
    </plugin>
  217.  
    </plugins>
  218.  
    </build>
学新通

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgkhgfi
系列文章
更多 icon
同类精品
更多 icon
继续加载