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

Hive: Add Hive 4 support and remove Hive runtime #11750

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 0 additions & 3 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ ORC:
HIVE:
- changed-files:
- any-glob-to-any-file: [
'hive3/**/*',
'hive-metastore/**/*',
'hive-runtime/**/*',
'hive3-orc-bundle/**/*'
]

DATA:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/delta-conversion-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ on:
- '.asf.yml'
- 'dev/**'
- 'mr/**'
- 'hive3/**'
- 'hive3-orc-bundle/**'
- 'hive-runtime/**'
- 'flink/**'
- 'kafka-connect/**'
- 'docs/**'
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/flink-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ on:
- '.asf.yml'
- 'dev/**'
- 'mr/**'
- 'hive3/**'
- 'hive3-orc-bundle/**'
- 'hive-runtime/**'
- 'kafka-connect/**'
- 'spark/**'
- 'docs/**'
Expand Down
33 changes: 2 additions & 31 deletions .github/workflows/hive-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,39 +87,10 @@ jobs:
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- run: ./gradlew -DsparkVersions= -DhiveVersions=2 -DflinkVersions= -DkafkaVersions= -Pquick=true :iceberg-mr:check :iceberg-hive-runtime:check -x javadoc
- run: ./gradlew -DsparkVersions= -DhiveVersions=2 -DflinkVersions= -DkafkaVersions= -Pquick=true :iceberg-mr:check -x javadoc
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test logs
path: |
**/build/testlogs

hive3-tests:
runs-on: ubuntu-22.04
strategy:
matrix:
jvm: [11, 17, 21]
env:
SPARK_LOCAL_IP: localhost
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: zulu
java-version: ${{ matrix.jvm }}
- uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle-
- run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- run: ./gradlew -DsparkVersions= -DhiveVersions=3 -DflinkVersions= -DkafkaVersions= -Pquick=true :iceberg-hive3-orc-bundle:check :iceberg-hive3:check :iceberg-hive-runtime:check -x javadoc
- uses: actions/upload-artifact@v4
if: failure()
with:
name: test logs
path: |
**/build/testlogs
**/build/testlogs
3 changes: 0 additions & 3 deletions .github/workflows/kafka-connect-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ on:
- 'dev/**'
- 'mr/**'
- 'flink/**'
- 'hive3/**'
- 'hive3-orc-bundle/**'
- 'hive-runtime/**'
- 'spark/**'
- 'docs/**'
- 'site/**'
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/spark-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ on:
- 'dev/**'
- 'site/**'
- 'mr/**'
- 'hive3/**'
- 'hive3-orc-bundle/**'
- 'hive-runtime/**'
- 'flink/**'
- 'kafka-connect/**'
- 'docs/**'
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ License: https://www.apache.org/licenses/LICENSE-2.0

This product includes code from Apache Hive.

* Hive metastore derby schema in hive-schema-3.1.0.derby.sql
* Hive metastore derby schema in hive-schema-4.0.0.derby.sql

Copyright: 2011-2018 The Apache Software Foundation
Home page: https://hive.apache.org/
Expand Down
13 changes: 9 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,8 @@ project(':iceberg-delta-lake') {
}
integrationImplementation project(path: ':iceberg-hive-metastore')
integrationImplementation project(path: ':iceberg-hive-metastore', configuration: 'testArtifacts')
integrationImplementation(libs.hive4.metastore)
integrationImplementation(libs.hive4.standalone.metastore.server)
integrationImplementation("org.apache.spark:spark-hive_${scalaVersion}:${libs.versions.spark.hive35.get()}") {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.apache.arrow'
Expand All @@ -601,6 +603,7 @@ project(':iceberg-delta-lake') {
exclude group: 'io.netty', module: 'netty-buffer'
exclude group: 'io.netty', module: 'netty-common'
exclude group: 'org.roaringbitmap'
exclude group: 'org.apache.hive'
}
}
}
Expand Down Expand Up @@ -675,7 +678,7 @@ project(':iceberg-hive-metastore') {

compileOnly libs.avro.avro

compileOnly(libs.hive2.metastore) {
compileOnly(libs.hive4.metastore) {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -695,7 +698,7 @@ project(':iceberg-hive-metastore') {
// that's really old. We use the core classifier to be able to override our guava
// version. Luckily, hive-exec seems to work okay so far with this version of guava
// See: https://github.com/apache/hive/blob/master/ql/pom.xml#L911 for more context.
testImplementation("${libs.hive2.exec.get().module}:${libs.hive2.exec.get().getVersion()}:core") {
testImplementation("${libs.hive4.exec.get().module}:${libs.hive4.exec.get().getVersion()}:core") {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -707,7 +710,7 @@ project(':iceberg-hive-metastore') {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
}

testImplementation(libs.hive2.metastore) {
testImplementation(libs.hive4.metastore) {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -723,7 +726,9 @@ project(':iceberg-hive-metastore') {
exclude group: 'com.zaxxer', module: 'HikariCP'
}

compileOnly(libs.hadoop2.client) {
testImplementation(libs.hive4.standalone.metastore.server)

compileOnly(libs.hadoop3.client) {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public static void startMetastoreAndSpark() {
.master("local[2]")
.config(SQLConf.PARTITION_OVERWRITE_MODE().key(), "dynamic")
.config(
"spark.hadoop." + HiveConf.ConfVars.METASTOREURIS.varname,
hiveConf.get(HiveConf.ConfVars.METASTOREURIS.varname))
"spark.hadoop." + HiveConf.ConfVars.METASTORE_URIS.varname,
hiveConf.get(HiveConf.ConfVars.METASTORE_URIS.varname))
.config("spark.sql.legacy.respectNullabilityInTextDatasetConversion", "true")
.config("spark.databricks.delta.retentionDurationCheck.enabled", "false")
.config("spark.sql.extensions", "io.delta.sql.DeltaSparkSessionExtension")
Expand Down
9 changes: 5 additions & 4 deletions flink/v1.18/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ project(":iceberg-flink:iceberg-flink-${flinkMajorVersion}") {
// that's really old. We use the core classifier to be able to override our guava
// version. Luckily, hive-exec seems to work okay so far with this version of guava
// See: https://github.com/apache/hive/blob/master/ql/pom.xml#L911 for more context.
testImplementation("${libs.hive2.exec.get().module}:${libs.hive2.exec.get().getVersion()}:core") {
testImplementation("${libs.hive4.exec.get().module}:${libs.hive4.exec.get().getVersion()}:core") {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -100,7 +100,7 @@ project(":iceberg-flink:iceberg-flink-${flinkMajorVersion}") {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
}

testImplementation(libs.hive2.metastore) {
testImplementation(libs.hive4.metastore) {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand Down Expand Up @@ -192,7 +192,7 @@ project(":iceberg-flink:iceberg-flink-runtime-${flinkMajorVersion}") {
exclude group: 'org.apache.avro', module: 'avro'
}

integrationImplementation(libs.hive2.metastore) {
integrationImplementation(libs.hive4.metastore) {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -208,8 +208,9 @@ project(":iceberg-flink:iceberg-flink-runtime-${flinkMajorVersion}") {
exclude group: 'com.zaxxer', module: 'HikariCP'
exclude group: 'org.slf4j'
}
integrationImplementation(libs.hive4.standalone.metastore.server)

integrationImplementation("${libs.hive2.exec.get().module}:${libs.hive2.exec.get().getVersion()}:core") {
integrationImplementation("${libs.hive4.exec.get().module}:${libs.hive4.exec.get().getVersion()}:core") {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ protected String getFullQualifiedTableName(String tableName) {
}

static String getURI(HiveConf conf) {
return conf.get(HiveConf.ConfVars.METASTOREURIS.varname);
return conf.get(HiveConf.ConfVars.METASTORE_URIS.varname);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public void testCreateCatalogWithHiveConfDir() throws IOException {
Configuration newConf = new Configuration(hiveConf);
// Set another new directory which is different with the hive metastore's warehouse path.
newConf.set(
HiveConf.ConfVars.METASTOREWAREHOUSE.varname, "file://" + warehouseDir.getAbsolutePath());
HiveConf.ConfVars.METASTORE_WAREHOUSE.varname,
"file://" + warehouseDir.getAbsolutePath());
newConf.writeXml(fos);
}
assertThat(hiveSiteXML.toPath()).exists();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ protected StructLikeSet rowSet(String tableName, Table testTable, String... colu
Map<String, String> properties = Maps.newHashMap();
properties.put(
CatalogProperties.WAREHOUSE_LOCATION,
hiveConf.get(HiveConf.ConfVars.METASTOREWAREHOUSE.varname));
properties.put(CatalogProperties.URI, hiveConf.get(HiveConf.ConfVars.METASTOREURIS.varname));
hiveConf.get(HiveConf.ConfVars.METASTORE_WAREHOUSE.varname));
properties.put(CatalogProperties.URI, hiveConf.get(HiveConf.ConfVars.METASTORE_URIS.varname));
properties.put(
CatalogProperties.CLIENT_POOL_SIZE,
Integer.toString(hiveConf.getInt("iceberg.hive.client-pool-size", 5)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ protected StructLikeSet rowSet(String tableName, Table testTable, String... colu
Map<String, String> properties = Maps.newHashMap();
properties.put(
CatalogProperties.WAREHOUSE_LOCATION,
hiveConf.get(HiveConf.ConfVars.METASTOREWAREHOUSE.varname));
properties.put(CatalogProperties.URI, hiveConf.get(HiveConf.ConfVars.METASTOREURIS.varname));
hiveConf.get(HiveConf.ConfVars.METASTORE_WAREHOUSE.varname));
properties.put(CatalogProperties.URI, hiveConf.get(HiveConf.ConfVars.METASTORE_URIS.varname));
properties.put(
CatalogProperties.CLIENT_POOL_SIZE,
Integer.toString(hiveConf.getInt("iceberg.hive.client-pool-size", 5)));
Expand Down
9 changes: 5 additions & 4 deletions flink/v1.19/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ project(":iceberg-flink:iceberg-flink-${flinkMajorVersion}") {
// that's really old. We use the core classifier to be able to override our guava
// version. Luckily, hive-exec seems to work okay so far with this version of guava
// See: https://github.com/apache/hive/blob/master/ql/pom.xml#L911 for more context.
testImplementation("${libs.hive2.exec.get().module}:${libs.hive2.exec.get().getVersion()}:core") {
testImplementation("${libs.hive4.exec.get().module}:${libs.hive4.exec.get().getVersion()}:core") {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -100,7 +100,7 @@ project(":iceberg-flink:iceberg-flink-${flinkMajorVersion}") {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
}

testImplementation(libs.hive2.metastore) {
testImplementation(libs.hive4.metastore) {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -116,6 +116,7 @@ project(":iceberg-flink:iceberg-flink-${flinkMajorVersion}") {
exclude group: 'com.zaxxer', module: 'HikariCP'
exclude group: 'org.slf4j'
}
testImplementation(libs.hive4.standalone.metastore.server)

testImplementation libs.awaitility
testImplementation libs.assertj.core
Expand Down Expand Up @@ -193,7 +194,7 @@ project(":iceberg-flink:iceberg-flink-runtime-${flinkMajorVersion}") {
exclude group: 'org.apache.avro', module: 'avro'
}

integrationImplementation(libs.hive2.metastore) {
integrationImplementation(libs.hive4.metastore) {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -210,7 +211,7 @@ project(":iceberg-flink:iceberg-flink-runtime-${flinkMajorVersion}") {
exclude group: 'org.slf4j'
}

integrationImplementation("${libs.hive2.exec.get().module}:${libs.hive2.exec.get().getVersion()}:core") {
integrationImplementation("${libs.hive4.exec.get().module}:${libs.hive4.exec.get().getVersion()}:core") {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ protected String getFullQualifiedTableName(String tableName) {
}

static String getURI(HiveConf conf) {
return conf.get(HiveConf.ConfVars.METASTOREURIS.varname);
return conf.get(HiveConf.ConfVars.METASTORE_URIS.varname);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public void testCreateCatalogWithHiveConfDir() throws IOException {
Configuration newConf = new Configuration(hiveConf);
// Set another new directory which is different with the hive metastore's warehouse path.
newConf.set(
HiveConf.ConfVars.METASTOREWAREHOUSE.varname, "file://" + warehouseDir.getAbsolutePath());
HiveConf.ConfVars.METASTORE_WAREHOUSE.varname,
"file://" + warehouseDir.getAbsolutePath());
newConf.writeXml(fos);
}
assertThat(hiveSiteXML.toPath()).exists();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ protected StructLikeSet rowSet(String tableName, Table testTable, String... colu
Map<String, String> properties = Maps.newHashMap();
properties.put(
CatalogProperties.WAREHOUSE_LOCATION,
hiveConf.get(HiveConf.ConfVars.METASTOREWAREHOUSE.varname));
properties.put(CatalogProperties.URI, hiveConf.get(HiveConf.ConfVars.METASTOREURIS.varname));
hiveConf.get(HiveConf.ConfVars.METASTORE_WAREHOUSE.varname));
properties.put(CatalogProperties.URI, hiveConf.get(HiveConf.ConfVars.METASTORE_URIS.varname));
properties.put(
CatalogProperties.CLIENT_POOL_SIZE,
Integer.toString(hiveConf.getInt("iceberg.hive.client-pool-size", 5)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ protected StructLikeSet rowSet(String tableName, Table testTable, String... colu
Map<String, String> properties = Maps.newHashMap();
properties.put(
CatalogProperties.WAREHOUSE_LOCATION,
hiveConf.get(HiveConf.ConfVars.METASTOREWAREHOUSE.varname));
properties.put(CatalogProperties.URI, hiveConf.get(HiveConf.ConfVars.METASTOREURIS.varname));
hiveConf.get(HiveConf.ConfVars.METASTORE_WAREHOUSE.varname));
properties.put(CatalogProperties.URI, hiveConf.get(HiveConf.ConfVars.METASTORE_URIS.varname));
properties.put(
CatalogProperties.CLIENT_POOL_SIZE,
Integer.toString(hiveConf.getInt("iceberg.hive.client-pool-size", 5)));
Expand Down
9 changes: 5 additions & 4 deletions flink/v1.20/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ project(":iceberg-flink:iceberg-flink-${flinkMajorVersion}") {
// that's really old. We use the core classifier to be able to override our guava
// version. Luckily, hive-exec seems to work okay so far with this version of guava
// See: https://github.com/apache/hive/blob/master/ql/pom.xml#L911 for more context.
testImplementation("${libs.hive2.exec.get().module}:${libs.hive2.exec.get().getVersion()}:core") {
testImplementation("${libs.hive4.exec.get().module}:${libs.hive4.exec.get().getVersion()}:core") {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -100,7 +100,7 @@ project(":iceberg-flink:iceberg-flink-${flinkMajorVersion}") {
exclude group: 'com.google.code.findbugs', module: 'jsr305'
}

testImplementation(libs.hive2.metastore) {
testImplementation(libs.hive4.metastore) {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -116,6 +116,7 @@ project(":iceberg-flink:iceberg-flink-${flinkMajorVersion}") {
exclude group: 'com.zaxxer', module: 'HikariCP'
exclude group: 'org.slf4j'
}
testImplementation(libs.hive4.standalone.metastore.server)

testImplementation libs.awaitility
testImplementation libs.assertj.core
Expand Down Expand Up @@ -193,7 +194,7 @@ project(":iceberg-flink:iceberg-flink-runtime-${flinkMajorVersion}") {
exclude group: 'org.apache.avro', module: 'avro'
}

integrationImplementation(libs.hive2.metastore) {
integrationImplementation(libs.hive4.metastore) {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand All @@ -210,7 +211,7 @@ project(":iceberg-flink:iceberg-flink-runtime-${flinkMajorVersion}") {
exclude group: 'org.slf4j'
}

integrationImplementation("${libs.hive2.exec.get().module}:${libs.hive2.exec.get().getVersion()}:core") {
integrationImplementation("${libs.hive4.exec.get().module}:${libs.hive4.exec.get().getVersion()}:core") {
exclude group: 'org.apache.avro', module: 'avro'
exclude group: 'org.slf4j', module: 'slf4j-log4j12'
exclude group: 'org.pentaho' // missing dependency
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,6 @@ protected String getFullQualifiedTableName(String tableName) {
}

static String getURI(HiveConf conf) {
return conf.get(HiveConf.ConfVars.METASTOREURIS.varname);
return conf.get(HiveConf.ConfVars.METASTORE_URIS.varname);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ public void testCreateCatalogWithHiveConfDir() throws IOException {
Configuration newConf = new Configuration(hiveConf);
// Set another new directory which is different with the hive metastore's warehouse path.
newConf.set(
HiveConf.ConfVars.METASTOREWAREHOUSE.varname, "file://" + warehouseDir.getAbsolutePath());
HiveConf.ConfVars.METASTORE_WAREHOUSE.varname,
"file://" + warehouseDir.getAbsolutePath());
newConf.writeXml(fos);
}
assertThat(hiveSiteXML.toPath()).exists();
Expand Down
Loading
Loading