Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](hudi) upgrade hudi to 0.15.0 #44267

Merged
merged 35 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
82f7731
upgrade hudi to 0.15.0
suxiaogang223 Nov 19, 2024
415c6de
copy HoodieLocalEngineContext
suxiaogang223 Nov 19, 2024
06cb47e
fix checkstyle
suxiaogang223 Nov 19, 2024
5dfdd0d
fix
suxiaogang223 Nov 20, 2024
6704722
fix
suxiaogang223 Nov 20, 2024
9c76c4a
fix
suxiaogang223 Nov 20, 2024
a557445
build fe-core success
suxiaogang223 Nov 20, 2024
6991b8b
fix hudi-scanner
suxiaogang223 Nov 20, 2024
4558a77
build hudi-scanner success
suxiaogang223 Nov 20, 2024
7f395c6
new hudi jni scanner using hudi-hadoop-mr
morningman Nov 9, 2024
76eec2b
fix format
suxiaogang223 Nov 21, 2024
40f3fc7
add license
suxiaogang223 Nov 21, 2024
88b131c
test new hudi scanner
suxiaogang223 Nov 22, 2024
667191a
support force_jni_reader and use_old_hudi_jni_reader for hudi
suxiaogang223 Nov 25, 2024
61643f3
support force_jni_scanner for hudi in fe
suxiaogang223 Nov 25, 2024
bb40123
fix force_jni_reader for HudiScanNode
suxiaogang223 Nov 25, 2024
b5343f1
fix hudi jni scanner
suxiaogang223 Nov 25, 2024
dd70da2
disable fall back to native reader for hudi in be
suxiaogang223 Nov 27, 2024
1e0e700
fix
suxiaogang223 Nov 27, 2024
572e9a6
Revert "disable fall back to native reader for hudi in be"
suxiaogang223 Nov 28, 2024
952d2c6
fix
suxiaogang223 Nov 28, 2024
fae66fc
fix p2 case
suxiaogang223 Nov 28, 2024
0710f6f
fix case
suxiaogang223 Nov 28, 2024
eb1b8b6
add SessionVariable hudi_jni_scanner
suxiaogang223 Nov 28, 2024
b1d4669
fix
suxiaogang223 Nov 29, 2024
99d8d5b
move the logic about falling back to native reader from be to fe
suxiaogang223 Dec 1, 2024
838c91a
fix
suxiaogang223 Dec 1, 2024
68a9ea1
fix be
suxiaogang223 Dec 1, 2024
07cb843
fix paimon
suxiaogang223 Dec 2, 2024
19c4c27
fix be ut
suxiaogang223 Dec 2, 2024
5feb98d
fix for compatibility
suxiaogang223 Dec 2, 2024
e4e4340
fix
suxiaogang223 Dec 2, 2024
45b4328
remove be fall back logic
suxiaogang223 Dec 2, 2024
c2e27cb
fix PaimonScanNode and be ut
suxiaogang223 Dec 2, 2024
093f49e
format
suxiaogang223 Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions be/src/vec/exec/format/table/hudi_jni_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "hudi_jni_reader.h"

#include <map>
#include <ostream>

#include "runtime/descriptors.h"
#include "runtime/runtime_state.h"
Expand Down Expand Up @@ -65,16 +64,23 @@ HudiJniReader::HudiJniReader(const TFileScanRangeParams& scan_params,
{"input_format", _hudi_params.input_format}};

// Use compatible hadoop client to read data
for (auto& kv : _scan_params.properties) {
for (const auto& kv : _scan_params.properties) {
if (kv.first.starts_with(HOODIE_CONF_PREFIX)) {
params[kv.first] = kv.second;
} else {
params[HADOOP_CONF_PREFIX + kv.first] = kv.second;
}
}

_jni_connector = std::make_unique<JniConnector>("org/apache/doris/hudi/HudiJniScanner", params,
required_fields);
if (_hudi_params.hudi_jni_scanner == "hadoop") {
_jni_connector = std::make_unique<JniConnector>(
"org/apache/doris/hudi/HadoopHudiJniScanner", params, required_fields);
} else if (_hudi_params.hudi_jni_scanner == "spark") {
_jni_connector = std::make_unique<JniConnector>("org/apache/doris/hudi/HudiJniScanner",
params, required_fields);
} else {
DCHECK(false) << "Unsupported hudi jni scanner: " << _hudi_params.hudi_jni_scanner;
}
}

Status HudiJniReader::get_next_block(Block* block, size_t* read_rows, bool* eof) {
Expand Down
4 changes: 1 addition & 3 deletions be/src/vec/exec/format/table/hudi_jni_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

#pragma once

#include <stddef.h>

#include <memory>
#include <cstddef>
#include <string>
#include <unordered_map>
#include <unordered_set>
Expand Down
17 changes: 6 additions & 11 deletions be/src/vec/exec/scan/vfile_scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,15 @@
#include <gen_cpp/PaloInternalService_types.h>
#include <gen_cpp/PlanNodes_types.h>

#include <algorithm>
#include <boost/iterator/iterator_facade.hpp>
#include <iterator>
#include <map>
#include <ostream>
#include <tuple>
#include <utility>

#include "common/compiler_util.h" // IWYU pragma: keep
#include "common/config.h"
#include "common/logging.h"
#include "common/object_pool.h"
#include "io/cache/block_file_cache_profile.h"
#include "runtime/descriptors.h"
#include "runtime/runtime_state.h"
Expand All @@ -47,7 +44,6 @@
#include "vec/common/string_ref.h"
#include "vec/core/column_with_type_and_name.h"
#include "vec/core/columns_with_type_and_name.h"
#include "vec/core/field.h"
#include "vec/data_types/data_type.h"
#include "vec/data_types/data_type_factory.hpp"
#include "vec/data_types/data_type_nullable.h"
Expand Down Expand Up @@ -754,17 +750,16 @@ Status VFileScanner::_get_next_reader() {

// create reader for specific format
Status init_status;
TFileFormatType::type format_type = _params->format_type;
// for compatibility, if format_type is not set in range, use the format type of params
TFileFormatType::type format_type =
range.__isset.format_type ? range.format_type : _params->format_type;
// JNI reader can only push down column value range
bool push_down_predicates =
!_is_load && _params->format_type != TFileFormatType::FORMAT_JNI;
// for compatibility, this logic is deprecated in 3.1
if (format_type == TFileFormatType::FORMAT_JNI && range.__isset.table_format_params) {
suxiaogang223 marked this conversation as resolved.
Show resolved Hide resolved
if (range.table_format_params.table_format_type == "hudi" &&
range.table_format_params.hudi_params.delta_logs.empty()) {
// fall back to native reader if there is no log file
format_type = TFileFormatType::FORMAT_PARQUET;
} else if (range.table_format_params.table_format_type == "paimon" &&
!range.table_format_params.paimon_params.__isset.paimon_split) {
if (range.table_format_params.table_format_type == "paimon" &&
!range.table_format_params.paimon_params.__isset.paimon_split) {
// use native reader
auto format = range.table_format_params.paimon_params.file_format;
if (format == "orc") {
Expand Down
2 changes: 2 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,7 @@ fi
if [[ "${BUILD_BE_JAVA_EXTENSIONS}" -eq 1 ]]; then
modules+=("fe-common")
modules+=("be-java-extensions/hudi-scanner")
modules+=("be-java-extensions/hadoop-hudi-scanner")
modules+=("be-java-extensions/java-common")
modules+=("be-java-extensions/java-udf")
modules+=("be-java-extensions/jdbc-scanner")
Expand Down Expand Up @@ -825,6 +826,7 @@ EOF
extensions_modules=("java-udf")
extensions_modules+=("jdbc-scanner")
extensions_modules+=("hudi-scanner")
extensions_modules+=("hadoop-hudi-scanner")
extensions_modules+=("paimon-scanner")
extensions_modules+=("trino-connector-scanner")
extensions_modules+=("max-compute-scanner")
Expand Down
2 changes: 1 addition & 1 deletion conf/be.conf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LOG_DIR="${DORIS_HOME}/log/"
JAVA_OPTS="-Dfile.encoding=UTF-8 -Xmx2048m -DlogPath=$LOG_DIR/jni.log -Xloggc:$LOG_DIR/be.gc.log.$CUR_DATE -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=50M -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=true -Dsun.java.command=DorisBE -XX:-CriticalJNINatives"

# For jdk 17, this JAVA_OPTS will be used as default JVM options
JAVA_OPTS_FOR_JDK_17="-Dfile.encoding=UTF-8 -Xmx2048m -DlogPath=$LOG_DIR/jni.log -Xlog:gc*:$LOG_DIR/be.gc.log.$CUR_DATE:time,uptime:filecount=10,filesize=50M -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=true -Dsun.java.command=DorisBE -XX:-CriticalJNINatives -XX:+IgnoreUnrecognizedVMOptions --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.cs=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED"
JAVA_OPTS_FOR_JDK_17="-Dfile.encoding=UTF-8 -Djol.skipHotspotSAAttach=true -Xmx2048m -DlogPath=$LOG_DIR/jni.log -Xlog:gc*:$LOG_DIR/be.gc.log.$CUR_DATE:time,uptime:filecount=10,filesize=50M -Djavax.security.auth.useSubjectCredsOnly=false -Dsun.security.krb5.debug=true -Dsun.java.command=DorisBE -XX:-CriticalJNINatives -XX:+IgnoreUnrecognizedVMOptions --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.cs=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED"

# Set your own JAVA_HOME
# JAVA_HOME=/path/to/jdk/
Expand Down
227 changes: 227 additions & 0 deletions fe/be-java-extensions/hadoop-hudi-scanner/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<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">

<parent>
<artifactId>be-java-extensions</artifactId>
<groupId>org.apache.doris</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>hadoop-hudi-scanner</artifactId>

<properties>
<doris.home>${basedir}/../../</doris.home>
<fe_ut_parallel>1</fe_ut_parallel>
<hudi.version>0.15.0</hudi.version>
<avro.version>1.11.3</avro.version>
<luben.zstd.jni.version>1.5.4-2</luben.zstd.jni.version>
<hive-apache.version>3.1.2-22</hive-apache.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.doris</groupId>
<artifactId>java-common</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-client -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs-client</artifactId>
<version>${hadoop.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.hadoop/hadoop-common -->
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-common</artifactId>
</dependency>

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-aws</artifactId>
</dependency>

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.hudi/hudi-common -->
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-common</artifactId>
<version>${hudi.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-client</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.hbase</groupId>
<artifactId>hbase-server</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
</exclusion>
<exclusion>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.hudi/hudi-io -->
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-io</artifactId>
<version>${hudi.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.hudi/hudi-hadoop-mr -->
<dependency>
<groupId>org.apache.hudi</groupId>
<artifactId>hudi-hadoop-mr</artifactId>
<version>${hudi.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.parquet/parquet-hadoop -->
<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-hadoop-bundle</artifactId>
<version>${parquet.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.parquet/parquet-avro -->
<dependency>
<groupId>org.apache.parquet</groupId>
<artifactId>parquet-avro</artifactId>
<version>${parquet.version}</version>
</dependency>

<!-- https://mvnrepository.com/artifact/org.apache.avro/avro -->
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>${avro.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>io.airlift</groupId>
<artifactId>concurrent</artifactId>
<version>202</version>
</dependency>

<!-- https://mvnrepository.com/artifact/io.airlift/aircompressor -->
<dependency>
<groupId>io.airlift</groupId>
<artifactId>aircompressor</artifactId>
<version>${aircompressor.version}</version>
</dependency>

<dependency>
<groupId>com.github.luben</groupId>
<artifactId>zstd-jni</artifactId>
<version>${luben.zstd.jni.version}</version>
</dependency>

<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo-shaded</artifactId>
<version>4.0.2</version>
</dependency>

<!-- hive -->
<dependency>
<groupId>io.trino.hive</groupId>
<artifactId>hive-apache</artifactId>
<version>${hive-apache.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.parquet</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.avro</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>io.airlift</groupId>
<artifactId>aircompressor</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

<build>
<finalName>hadoop-hudi-scanner</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/resources/package.xml</descriptor>
</descriptors>
<archive>
<manifest>
<mainClass></mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading
Loading