Flink sql 实现 -connection-clickhouse的 source和 sink

1. 场景

Flink sql 实现 -connection-clickhouse的 source和 sink_第1张图片

2. 版本

mysql flink clickhouse
5.7.20-log flink-1.13.1 20.11.4.13
5.7.20-log flink-1.13.2 20.11.4.13
5.7.20-log flink-1.13.5 20.11.4.13

flink 连接clickhouse 的包

3. 代码的自定义结构图

Flink sql 实现 -connection-clickhouse的 source和 sink_第2张图片

4. 代码的pom 文件

4.1 pom 文件

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.glab</groupId>
  <artifactId>flink-connector-clickhouse</artifactId>
  <version>13.1</version>

  <name>flink-connector-clickhouse</name>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <flink.version>1.13.1</flink.version>
    <scala.binary.version>2.11</scala.binary.version>
    <clickhouse-jdbc-version>0.3.0</clickhouse-jdbc-version>
  </properties>

  <packaging>jar</packaging>

  <dependencies>
    <dependency>
      <groupId>ru.yandex.clickhouse</groupId>
      <artifactId>clickhouse-jdbc</artifactId>
      <version>${clickhouse-jdbc-version}</version>
      <scope>provided</scope>
      <exclusions>
        <exclusion>
          <groupId>com.google.guava</groupId>
          <artifactId>guava</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <!-- https://mvnrepository.com/artifact/com.google.guava/guava -->
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>30.1.1-jre</version>
    </dependency>


    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpmime</artifactId>
      <version>4.5.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
      <version>4.4.4</version>
    </dependency>
    <dependency>
      <groupId>commons-logging</groupId>
      <artifactId>commons-logging</artifactId>
      <version>1.2</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-core</artifactId>
      <version>1.2.3</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.2.3</version>
      <scope>provided</scope>
    </dependency>

    <!--kafak connector 测试用-->

    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-sql-connector-kafka_${scala.binary.version}</artifactId>
      <version>${flink.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-csv</artifactId>
      <version>${flink.version}</version>
      <scope>test</scope>
    </dependency>

    <!-- Table ecosystem -->
    <!-- Projects depending on this project won't depend on flink-table-*. -->
    
      org.apache.flink
      flink-clients_${scala.binary.version}
      ${flink.version}
      provided
    

    
      org.apache.flink
      flink-table-api-java-bridge_${scala.binary.version}
      ${flink.version}
      provided
      
    

    
      org.apache.flink
      flink-streaming-java_${scala.binary.version}
      ${flink.version}
      provided
    


    
    
      junit
      junit
      4.11
      test
    

    
      org.apache.flink
      flink-table-common
      ${flink.version}
      
      provided
    

    
                    

你可能感兴趣的:(Flink,flink,sql,clickhouse)