You need to enable JavaScript to run this app.
流式计算 Flink版

流式计算 Flink版

复制全文
LAS 统一元数据
Flink Datastream 对接 LAS 使用手册
复制全文
Flink Datastream 对接 LAS 使用手册

使用火山 Flink Datastream 访问 LAS 元信息,比如:Paimon on LAS、Iceberg on LAS 等,需要在原有开源 Paimon、Iceberg Connector 依赖的基础上,添加 LAS 相关的依赖,并在打包时把 LAS 依赖打包到 uber jar 里。

操作步骤如下:

1. 修改 pom.xml

包含 LAS 依赖的基础 pom.xml 如下,需要在原有 Flink 作业的依赖上,增加如下 pom 配置:

注意

  1. 需要把 hive-metastore 的 scope 修改为 provided,防止冲突。
  2. lf-client-3 的依赖建议放到最前面,防止一些其他依赖有冲突。
<?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>
    
    <!-- 自定义火山 maven 仓库 -->
    <repositories>
        <repository>
            <id>bytedance-custom-repo</id>
            <url>https://artifact.bytedance.com/repository/data_compute_engine_service</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>

    <dependencies>
        <!-- LF client 依赖,需要在 hive-metastore 之前,防止依赖冲突 -->
        <dependency>
            <groupId>org.apache.hive</groupId>
            <artifactId>lf-client-3</artifactId>
            <version>1.5.0-RELEASE</version>
        </dependency>
        <!-- 使用与你的环境匹配的 Hive 版本 -->
        <dependency>
            <groupId>org.apache.hive</groupId>
            <artifactId>hive-metastore</artifactId>
            <version>3.1.2</version> 
            <scope>provided</scope>
        </dependency>
        ...
        其他依赖,例如 hive、iceberg 等
        ...
    </dependencies>
    
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <executions>
                    <execution>
                        <id>shade-flink</id>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <artifactSet>
                                <includes>
                                    <!-- 把 LAS 依赖打包到最终的作业 Jar 里: -->
                                    <include>org.apache.hive:lf-client-3</include>
                                    <include>org.apache.hive:lf-client-common-3</include>
                                    <include>org.apache.hive:lf-common-3</include>
                                    <include>org.apache.thrift:libfb303</include>
                                </includes>
                            </artifactSet>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

</project>

2. 打包作业 Jar

打包命令如下:

mvn clean package -DskipTests

得到作业 Jar 包后,上传到火山 Flink 使用即可。

3. 其他注意事项

  • 本次提供的 LAS 依赖包含多个独立的 maven 库,如果存在某一个 maven 库版本和客户已有的库版本冲突,则可以方便地进行冲突的解决,比如 parquet 依赖可以使用客户自己的版本。
最近更新时间:2025.07.31 13:32:08
这个页面对您有帮助吗?
有用
有用
无用
无用