From 656e5524d60a9995e819e81e14d560f9c0f92f1f Mon Sep 17 00:00:00 2001 From: Jiefan Li Date: Thu, 21 Apr 2022 10:36:17 -0700 Subject: [PATCH 1/2] Move custom hive catalog to hivelink-core --- build.gradle | 6 ++--- .../org/apache/iceberg/hive/HiveCatalogs.java | 17 ------------ .../iceberg/hivelink/core}/DirectoryInfo.java | 2 +- .../hivelink/core}/HiveExpressions.java | 2 +- .../core}/HiveMetadataPreservingCatalog.java | 24 ++++++++++++++++- ...HiveMetadataPreservingTableOperations.java | 4 ++- .../hivelink/core}/HiveTypeToIcebergType.java | 3 ++- .../hivelink/core}/LegacyHiveCatalog.java | 2 +- .../hivelink/core}/LegacyHiveTable.java | 2 +- .../core}/LegacyHiveTableOperations.java | 3 ++- .../hivelink/core}/LegacyHiveTableScan.java | 2 +- .../hivelink/core}/LegacyHiveTableUtils.java | 4 ++- .../schema}/HiveSchemaWithPartnerVisitor.java | 21 ++++++++++++++- .../core/schema}/MergeHiveSchemaWithAvro.java | 25 ++++++++++++++--- .../hivelink/core/utils}/FileSystemUtils.java | 27 ++++++++++++++++--- .../hivelink/core/utils}/HiveTypeUtil.java | 22 ++++++++++++++- .../hivelink/core}/HiveMetastoreTest.java | 2 +- .../iceberg/hivelink/core}/ScriptRunner.java | 2 +- .../hivelink/core}/TestHiveExpressions.java | 4 +-- .../TestHiveMetadataPreservingCatalog.java | 20 +++++++------- .../hivelink/core}/TestHiveMetastore.java | 2 +- .../core}/TestHiveSchemaConversions.java | 3 ++- .../core}/TestLegacyHiveTableScan.java | 3 ++- .../core}/TestMergeHiveSchemaWithAvro.java | 3 ++- .../resources/hive-schema-3.1.0.derby.sql | 0 settings.gradle | 4 +-- .../apache/iceberg/spark/source/Reader.java | 2 +- .../iceberg/spark/source/SparkBatchScan.java | 2 +- 28 files changed, 152 insertions(+), 61 deletions(-) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core}/DirectoryInfo.java (97%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core}/HiveExpressions.java (99%) rename {hive-metastore/src/main/java/org/apache/iceberg/hive => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core}/HiveMetadataPreservingCatalog.java (64%) rename {hive-metastore/src/main/java/org/apache/iceberg/hive => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core}/HiveMetadataPreservingTableOperations.java (98%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core}/HiveTypeToIcebergType.java (97%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core}/LegacyHiveCatalog.java (99%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core}/LegacyHiveTable.java (99%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core}/LegacyHiveTableOperations.java (99%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core}/LegacyHiveTableScan.java (98%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core}/LegacyHiveTableUtils.java (98%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema}/HiveSchemaWithPartnerVisitor.java (87%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema}/MergeHiveSchemaWithAvro.java (91%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils}/FileSystemUtils.java (67%) rename {hivelink/src/main/java/org/apache/iceberg/hivelink => hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils}/HiveTypeUtil.java (79%) rename {hivelink/src/test/java/org/apache/iceberg/hivelink => hivelink-core/src/test/java/org/apache/iceberg/hivelink/core}/HiveMetastoreTest.java (98%) rename {hivelink/src/test/java/org/apache/iceberg/hivelink => hivelink-core/src/test/java/org/apache/iceberg/hivelink/core}/ScriptRunner.java (99%) rename {hivelink/src/test/java/org/apache/iceberg/hivelink => hivelink-core/src/test/java/org/apache/iceberg/hivelink/core}/TestHiveExpressions.java (97%) rename {hive-metastore/src/test/java/org/apache/iceberg/hive => hivelink-core/src/test/java/org/apache/iceberg/hivelink/core}/TestHiveMetadataPreservingCatalog.java (86%) rename {hivelink/src/test/java/org/apache/iceberg/hivelink => hivelink-core/src/test/java/org/apache/iceberg/hivelink/core}/TestHiveMetastore.java (99%) rename {hivelink/src/test/java/org/apache/iceberg/hivelink => hivelink-core/src/test/java/org/apache/iceberg/hivelink/core}/TestHiveSchemaConversions.java (97%) rename {hivelink/src/test/java/org/apache/iceberg/hivelink => hivelink-core/src/test/java/org/apache/iceberg/hivelink/core}/TestLegacyHiveTableScan.java (99%) rename {hivelink/src/test/java/org/apache/iceberg/hivelink => hivelink-core/src/test/java/org/apache/iceberg/hivelink/core}/TestMergeHiveSchemaWithAvro.java (99%) rename {hivelink => hivelink-core}/src/test/resources/hive-schema-3.1.0.derby.sql (100%) diff --git a/build.gradle b/build.gradle index f29199298a..511631d854 100644 --- a/build.gradle +++ b/build.gradle @@ -495,7 +495,7 @@ project(':iceberg-hive-metastore') { } } -project(':iceberg-hivelink') { +project(':iceberg-hivelink-core') { dependencies { compile project(':iceberg-hive-metastore') @@ -872,7 +872,7 @@ if (jdkVersion == '8') { compile project(':iceberg-arrow') compile project(':iceberg-hive-metastore') compile project(':iceberg-spark') - compile project(':iceberg-hivelink') + compile project(':iceberg-hivelink-core') compileOnly "org.apache.avro:avro" compileOnly("org.apache.spark:spark-hive_2.11") { @@ -982,7 +982,7 @@ project(':iceberg-spark3') { compile project(':iceberg-arrow') compile project(':iceberg-hive-metastore') compile project(':iceberg-spark') - compile project(':iceberg-hivelink') + compile project(':iceberg-hivelink-core') compileOnly "org.apache.avro:avro" compileOnly("org.apache.spark:spark-hive_2.12") { diff --git a/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalogs.java b/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalogs.java index 1aadecd835..fbe934ec3d 100644 --- a/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalogs.java +++ b/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveCatalogs.java @@ -31,26 +31,9 @@ public final class HiveCatalogs { private HiveCatalogs() { } - private static final Cache HIVE_METADATA_PRESERVING_CATALOG_CACHE = - Caffeine.newBuilder().build(); - public static HiveCatalog loadCatalog(Configuration conf) { // metastore URI can be null in local mode String metastoreUri = conf.get(HiveConf.ConfVars.METASTOREURIS.varname, ""); return CATALOG_CACHE.get(metastoreUri, uri -> new HiveCatalog(conf)); } - - /** - * @deprecated Use {@link #loadHiveMetadataPreservingCatalog(Configuration)} instead - */ - @Deprecated - public static HiveCatalog loadCustomCatalog(Configuration conf) { - return loadHiveMetadataPreservingCatalog(conf); - } - - public static HiveCatalog loadHiveMetadataPreservingCatalog(Configuration conf) { - // metastore URI can be null in local mode - String metastoreUri = conf.get(HiveConf.ConfVars.METASTOREURIS.varname, ""); - return HIVE_METADATA_PRESERVING_CATALOG_CACHE.get(metastoreUri, uri -> new HiveMetadataPreservingCatalog(conf)); - } } diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/DirectoryInfo.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/DirectoryInfo.java similarity index 97% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/DirectoryInfo.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/DirectoryInfo.java index aea050f1ed..8cf51d998e 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/DirectoryInfo.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/DirectoryInfo.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import org.apache.iceberg.FileFormat; import org.apache.iceberg.StructLike; diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/HiveExpressions.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveExpressions.java similarity index 99% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/HiveExpressions.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveExpressions.java index a90c55cd7b..b5a0748ad4 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/HiveExpressions.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveExpressions.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import java.time.Instant; import java.time.OffsetDateTime; diff --git a/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveMetadataPreservingCatalog.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveMetadataPreservingCatalog.java similarity index 64% rename from hive-metastore/src/main/java/org/apache/iceberg/hive/HiveMetadataPreservingCatalog.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveMetadataPreservingCatalog.java index 9c6f3fc85b..e85c04af3a 100644 --- a/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveMetadataPreservingCatalog.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveMetadataPreservingCatalog.java @@ -17,12 +17,16 @@ * under the License. */ -package org.apache.iceberg.hive; +package org.apache.iceberg.hivelink.core; +import com.github.benmanes.caffeine.cache.Cache; +import com.github.benmanes.caffeine.cache.Caffeine; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.conf.HiveConf; import org.apache.iceberg.TableOperations; import org.apache.iceberg.catalog.TableIdentifier; import org.apache.iceberg.hadoop.HadoopFileIO; +import org.apache.iceberg.hive.HiveCatalog; /** @@ -37,6 +41,9 @@ public HiveMetadataPreservingCatalog(Configuration conf) { super(conf); } + private static final Cache HIVE_METADATA_PRESERVING_CATALOG_CACHE = + Caffeine.newBuilder().build(); + @Override public TableOperations newTableOps(TableIdentifier tableIdentifier) { String dbName = tableIdentifier.namespace().level(0); @@ -44,4 +51,19 @@ public TableOperations newTableOps(TableIdentifier tableIdentifier) { return new HiveMetadataPreservingTableOperations(conf(), clientPool(), new HadoopFileIO(conf()), name(), dbName, tableName); } + + + /** + * @deprecated Use {@link #loadHiveMetadataPreservingCatalog(Configuration)} instead + */ + @Deprecated + public static HiveCatalog loadCustomCatalog(Configuration conf) { + return loadHiveMetadataPreservingCatalog(conf); + } + + public static HiveCatalog loadHiveMetadataPreservingCatalog(Configuration conf) { + // metastore URI can be null in local mode + String metastoreUri = conf.get(HiveConf.ConfVars.METASTOREURIS.varname, ""); + return HIVE_METADATA_PRESERVING_CATALOG_CACHE.get(metastoreUri, uri -> new HiveMetadataPreservingCatalog(conf)); + } } diff --git a/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveMetadataPreservingTableOperations.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveMetadataPreservingTableOperations.java similarity index 98% rename from hive-metastore/src/main/java/org/apache/iceberg/hive/HiveMetadataPreservingTableOperations.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveMetadataPreservingTableOperations.java index 1596b1f858..aa557b847e 100644 --- a/hive-metastore/src/main/java/org/apache/iceberg/hive/HiveMetadataPreservingTableOperations.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveMetadataPreservingTableOperations.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hive; +package org.apache.iceberg.hivelink.core; import java.net.UnknownHostException; import java.util.Collections; @@ -37,6 +37,8 @@ import org.apache.iceberg.exceptions.CommitFailedException; import org.apache.iceberg.exceptions.CommitStateUnknownException; import org.apache.iceberg.exceptions.NoSuchTableException; +import org.apache.iceberg.hive.HiveClientPool; +import org.apache.iceberg.hive.HiveTableOperations; import org.apache.iceberg.io.FileIO; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet; diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/HiveTypeToIcebergType.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveTypeToIcebergType.java similarity index 97% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/HiveTypeToIcebergType.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveTypeToIcebergType.java index 686221a496..0ed64d154d 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/HiveTypeToIcebergType.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/HiveTypeToIcebergType.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import java.util.List; import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo; @@ -26,6 +26,7 @@ import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.StructTypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.UnionTypeInfo; +import org.apache.iceberg.hivelink.core.utils.HiveTypeUtil; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.types.Type; import org.apache.iceberg.types.Types; diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveCatalog.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveCatalog.java similarity index 99% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveCatalog.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveCatalog.java index 2206f9d543..57a3b44324 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveCatalog.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveCatalog.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import com.github.benmanes.caffeine.cache.Cache; import com.github.benmanes.caffeine.cache.Caffeine; diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTable.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTable.java similarity index 99% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTable.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTable.java index a6550535ee..6016f18eb1 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTable.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTable.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import java.util.List; import java.util.Map; diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTableOperations.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTableOperations.java similarity index 99% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTableOperations.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTableOperations.java index 952108ea3d..d90af8bdb7 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTableOperations.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTableOperations.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import java.time.LocalDate; import java.time.LocalDateTime; @@ -50,6 +50,7 @@ import org.apache.iceberg.expressions.Expressions; import org.apache.iceberg.hadoop.HadoopFileIO; import org.apache.iceberg.hive.HiveClientPool; +import org.apache.iceberg.hivelink.core.utils.FileSystemUtils; import org.apache.iceberg.io.FileIO; import org.apache.iceberg.io.LocationProvider; import org.apache.iceberg.mapping.MappingUtil; diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTableScan.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTableScan.java similarity index 98% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTableScan.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTableScan.java index 826af746e3..1f027aabeb 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTableScan.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTableScan.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import org.apache.iceberg.BaseFileScanTask; import org.apache.iceberg.DataTableScan; diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTableUtils.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTableUtils.java similarity index 98% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTableUtils.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTableUtils.java index 474852d501..9a83758c51 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/LegacyHiveTableUtils.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/LegacyHiveTableUtils.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import java.util.HashMap; import java.util.List; @@ -37,6 +37,8 @@ import org.apache.iceberg.StructLike; import org.apache.iceberg.avro.AvroSchemaUtil; import org.apache.iceberg.avro.AvroSchemaVisitor; +import org.apache.iceberg.hivelink.core.schema.MergeHiveSchemaWithAvro; +import org.apache.iceberg.hivelink.core.utils.HiveTypeUtil; import org.apache.iceberg.relocated.com.google.common.base.Preconditions; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.types.Conversions; diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/HiveSchemaWithPartnerVisitor.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/HiveSchemaWithPartnerVisitor.java similarity index 87% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/HiveSchemaWithPartnerVisitor.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/HiveSchemaWithPartnerVisitor.java index 8317ebc0c3..54e58d5782 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/HiveSchemaWithPartnerVisitor.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/HiveSchemaWithPartnerVisitor.java @@ -17,7 +17,26 @@ * under the License. */ -package org.apache.iceberg.hivelink; +/* + * 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. + */ + +package org.apache.iceberg.hivelink.core.schema; import java.util.List; import org.apache.hadoop.hive.serde2.typeinfo.ListTypeInfo; diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/MergeHiveSchemaWithAvro.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/MergeHiveSchemaWithAvro.java similarity index 91% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/MergeHiveSchemaWithAvro.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/MergeHiveSchemaWithAvro.java index ace4f6d8ed..1881385f39 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/MergeHiveSchemaWithAvro.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/MergeHiveSchemaWithAvro.java @@ -17,7 +17,26 @@ * under the License. */ -package org.apache.iceberg.hivelink; +/* + * 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. + */ + +package org.apache.iceberg.hivelink.core.schema; import java.util.ArrayList; import java.util.List; @@ -49,9 +68,9 @@ * 5. Fields found only in Hive schema are represented as optional fields in the resultant Avro schema * 6. For fields found only in Hive schema, field names are sanitized to make them compatible with Avro identifier spec */ -class MergeHiveSchemaWithAvro extends HiveSchemaWithPartnerVisitor { +public class MergeHiveSchemaWithAvro extends HiveSchemaWithPartnerVisitor { - static Schema visit(StructTypeInfo typeInfo, Schema schema) { + public static Schema visit(StructTypeInfo typeInfo, Schema schema) { return visit(typeInfo, schema, new MergeHiveSchemaWithAvro(), AvroPartnerAccessor.INSTANCE); } diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/FileSystemUtils.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/FileSystemUtils.java similarity index 67% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/FileSystemUtils.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/FileSystemUtils.java index 92f8018c3a..fa5c4a8bf6 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/FileSystemUtils.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/FileSystemUtils.java @@ -17,7 +17,26 @@ * under the License. */ -package org.apache.iceberg.hivelink; +/* + * 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. + */ + +package org.apache.iceberg.hivelink.core.utils; import java.io.IOException; import java.io.UncheckedIOException; @@ -30,7 +49,7 @@ import org.apache.hadoop.fs.PathFilter; import org.apache.iceberg.exceptions.RuntimeIOException; -class FileSystemUtils { +public class FileSystemUtils { private FileSystemUtils() { } @@ -38,7 +57,7 @@ private FileSystemUtils() { /** * Lists all non-hidden files for the given directory */ - static List listFiles(String directory, Configuration conf) { + public static List listFiles(String directory, Configuration conf) { final Path directoryPath = new Path(directory); final FileStatus[] files; @@ -51,7 +70,7 @@ static List listFiles(String directory, Configuration conf) { return Arrays.asList(files); } - static boolean exists(String file, Configuration conf) { + public static boolean exists(String file, Configuration conf) { final Path filePath = new Path(file); try { FileSystem fs = filePath.getFileSystem(conf); diff --git a/hivelink/src/main/java/org/apache/iceberg/hivelink/HiveTypeUtil.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/HiveTypeUtil.java similarity index 79% rename from hivelink/src/main/java/org/apache/iceberg/hivelink/HiveTypeUtil.java rename to hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/HiveTypeUtil.java index e2f3770282..48d1878685 100644 --- a/hivelink/src/main/java/org/apache/iceberg/hivelink/HiveTypeUtil.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/HiveTypeUtil.java @@ -17,7 +17,26 @@ * under the License. */ -package org.apache.iceberg.hivelink; +/* + * 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. + */ + +package org.apache.iceberg.hivelink.core.utils; import java.util.List; import org.apache.hadoop.hive.serde2.typeinfo.ListTypeInfo; @@ -26,6 +45,7 @@ import org.apache.hadoop.hive.serde2.typeinfo.StructTypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.UnionTypeInfo; +import org.apache.iceberg.hivelink.core.HiveTypeToIcebergType; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.types.Type; diff --git a/hivelink/src/test/java/org/apache/iceberg/hivelink/HiveMetastoreTest.java b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/HiveMetastoreTest.java similarity index 98% rename from hivelink/src/test/java/org/apache/iceberg/hivelink/HiveMetastoreTest.java rename to hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/HiveMetastoreTest.java index 6d3db19166..c91def2637 100644 --- a/hivelink/src/test/java/org/apache/iceberg/hivelink/HiveMetastoreTest.java +++ b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/HiveMetastoreTest.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import java.util.HashMap; import org.apache.hadoop.hive.conf.HiveConf; diff --git a/hivelink/src/test/java/org/apache/iceberg/hivelink/ScriptRunner.java b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/ScriptRunner.java similarity index 99% rename from hivelink/src/test/java/org/apache/iceberg/hivelink/ScriptRunner.java rename to hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/ScriptRunner.java index 512fbb3b70..b725defeee 100644 --- a/hivelink/src/test/java/org/apache/iceberg/hivelink/ScriptRunner.java +++ b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/ScriptRunner.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import java.io.IOException; import java.io.LineNumberReader; diff --git a/hivelink/src/test/java/org/apache/iceberg/hivelink/TestHiveExpressions.java b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveExpressions.java similarity index 97% rename from hivelink/src/test/java/org/apache/iceberg/hivelink/TestHiveExpressions.java rename to hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveExpressions.java index 4fcacc8472..3dc69cfa00 100644 --- a/hivelink/src/test/java/org/apache/iceberg/hivelink/TestHiveExpressions.java +++ b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveExpressions.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import org.apache.iceberg.expressions.Expression; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableSet; @@ -35,7 +35,7 @@ import static org.apache.iceberg.expressions.Expressions.notIn; import static org.apache.iceberg.expressions.Expressions.notNull; import static org.apache.iceberg.expressions.Expressions.or; -import static org.apache.iceberg.hivelink.HiveExpressions.simplifyPartitionFilter; +import static org.apache.iceberg.hivelink.core.HiveExpressions.simplifyPartitionFilter; public class TestHiveExpressions { diff --git a/hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveMetadataPreservingCatalog.java b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveMetadataPreservingCatalog.java similarity index 86% rename from hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveMetadataPreservingCatalog.java rename to hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveMetadataPreservingCatalog.java index 30860e5277..15055d0505 100644 --- a/hive-metastore/src/test/java/org/apache/iceberg/hive/TestHiveMetadataPreservingCatalog.java +++ b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveMetadataPreservingCatalog.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hive; +package org.apache.iceberg.hivelink.core; import java.io.IOException; import java.util.Collections; @@ -47,7 +47,7 @@ public class TestHiveMetadataPreservingCatalog extends HiveMetastoreTest { private static final String TABLE_NAME = "tbl"; - private static final TableIdentifier TABLE_IDENTIFIER = TableIdentifier.of(DB_NAME, TABLE_NAME); + private static final TableIdentifier TABLE_IDENTIFIER = TableIdentifier.of(HiveMetastoreTest.DB_NAME, TABLE_NAME); private static final Schema SCHEMA = new Schema( required(3, "id", Types.IntegerType.get()), required(4, "data", Types.StringType.get()) @@ -60,7 +60,7 @@ public class TestHiveMetadataPreservingCatalog extends HiveMetastoreTest { @BeforeClass public static void setCustomHiveCatalog() { - catalog = new HiveMetadataPreservingCatalog(hiveConf); + HiveMetastoreTest.catalog = new HiveMetadataPreservingCatalog(HiveMetastoreTest.hiveConf); } @Before @@ -70,36 +70,36 @@ public void createTableLocation() throws IOException { @After public void cleanup() { - catalog.dropTable(TABLE_IDENTIFIER); + HiveMetastoreTest.catalog.dropTable(TABLE_IDENTIFIER); } @Test public void shouldNotThrowErrorIfTableExists() { try { - metastoreClient.createTable(hiveTable()); + HiveMetastoreTest.metastoreClient.createTable(hiveTable()); } catch (Exception e) { throw new RuntimeException(e); } - catalog.createTable(TABLE_IDENTIFIER, SCHEMA); + HiveMetastoreTest.catalog.createTable(TABLE_IDENTIFIER, SCHEMA); } @Test public void shouldNotOverrideExistingHiveMetadata() { try { - metastoreClient.createTable(hiveTable()); + HiveMetastoreTest.metastoreClient.createTable(hiveTable()); } catch (Exception e) { throw new RuntimeException(e); } - org.apache.iceberg.Table table = catalog.createTable(TABLE_IDENTIFIER, SCHEMA); + org.apache.iceberg.Table table = HiveMetastoreTest.catalog.createTable(TABLE_IDENTIFIER, SCHEMA); Transaction txn = table.newTransaction(); txn.updateSchema().addColumn("newCol", Types.IntegerType.get()).commit(); txn.updateProperties().set("testProp", "dummy").commit(); txn.commitTransaction(); try { - Table hiveTable = metastoreClient.getTable(DB_NAME, TABLE_NAME); + Table hiveTable = HiveMetastoreTest.metastoreClient.getTable(HiveMetastoreTest.DB_NAME, TABLE_NAME); Assert.assertEquals(2, hiveTable.getSd().getCols().size()); Assert.assertFalse(hiveTable.getParameters().containsKey("testProp")); Assert.assertEquals("org.apache.hadoop.hive.ql.io.orc.OrcSerde", @@ -123,7 +123,7 @@ private Table hiveTable() { storageDescriptor.setSerdeInfo(serDeInfo); Table tbl = new Table(TABLE_NAME, - DB_NAME, + HiveMetastoreTest.DB_NAME, System.getProperty("user.name"), (int) currentTimeMillis / 1000, (int) currentTimeMillis / 1000, diff --git a/hivelink/src/test/java/org/apache/iceberg/hivelink/TestHiveMetastore.java b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveMetastore.java similarity index 99% rename from hivelink/src/test/java/org/apache/iceberg/hivelink/TestHiveMetastore.java rename to hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveMetastore.java index 3452793e48..be0102bb99 100644 --- a/hivelink/src/test/java/org/apache/iceberg/hivelink/TestHiveMetastore.java +++ b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveMetastore.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import java.io.File; import java.io.IOException; diff --git a/hivelink/src/test/java/org/apache/iceberg/hivelink/TestHiveSchemaConversions.java b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveSchemaConversions.java similarity index 97% rename from hivelink/src/test/java/org/apache/iceberg/hivelink/TestHiveSchemaConversions.java rename to hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveSchemaConversions.java index 60fe895324..d7044dce38 100644 --- a/hivelink/src/test/java/org/apache/iceberg/hivelink/TestHiveSchemaConversions.java +++ b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestHiveSchemaConversions.java @@ -17,12 +17,13 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import java.util.List; import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils; +import org.apache.iceberg.hivelink.core.utils.HiveTypeUtil; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.types.Type; import org.apache.iceberg.types.Types; diff --git a/hivelink/src/test/java/org/apache/iceberg/hivelink/TestLegacyHiveTableScan.java b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestLegacyHiveTableScan.java similarity index 99% rename from hivelink/src/test/java/org/apache/iceberg/hivelink/TestLegacyHiveTableScan.java rename to hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestLegacyHiveTableScan.java index 2f748c8728..9edd0978f3 100644 --- a/hivelink/src/test/java/org/apache/iceberg/hivelink/TestLegacyHiveTableScan.java +++ b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestLegacyHiveTableScan.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import java.io.File; import java.io.IOException; @@ -51,6 +51,7 @@ import org.apache.iceberg.expressions.Expression; import org.apache.iceberg.expressions.Expressions; import org.apache.iceberg.hive.HiveCatalog; +import org.apache.iceberg.hivelink.core.utils.HiveTypeUtil; import org.apache.iceberg.io.CloseableIterable; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; diff --git a/hivelink/src/test/java/org/apache/iceberg/hivelink/TestMergeHiveSchemaWithAvro.java b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestMergeHiveSchemaWithAvro.java similarity index 99% rename from hivelink/src/test/java/org/apache/iceberg/hivelink/TestMergeHiveSchemaWithAvro.java rename to hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestMergeHiveSchemaWithAvro.java index ddfac388cf..9b37d2da0a 100644 --- a/hivelink/src/test/java/org/apache/iceberg/hivelink/TestMergeHiveSchemaWithAvro.java +++ b/hivelink-core/src/test/java/org/apache/iceberg/hivelink/core/TestMergeHiveSchemaWithAvro.java @@ -17,7 +17,7 @@ * under the License. */ -package org.apache.iceberg.hivelink; +package org.apache.iceberg.hivelink.core; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; @@ -31,6 +31,7 @@ import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoUtils; import org.apache.iceberg.avro.AvroSchemaUtil; +import org.apache.iceberg.hivelink.core.schema.MergeHiveSchemaWithAvro; import org.apache.iceberg.relocated.com.google.common.base.Preconditions; import org.apache.iceberg.relocated.com.google.common.collect.ImmutableMap; import org.apache.iceberg.relocated.com.google.common.collect.Lists; diff --git a/hivelink/src/test/resources/hive-schema-3.1.0.derby.sql b/hivelink-core/src/test/resources/hive-schema-3.1.0.derby.sql similarity index 100% rename from hivelink/src/test/resources/hive-schema-3.1.0.derby.sql rename to hivelink-core/src/test/resources/hive-schema-3.1.0.derby.sql diff --git a/settings.gradle b/settings.gradle index d6f0fb9a69..0326ba0801 100644 --- a/settings.gradle +++ b/settings.gradle @@ -37,7 +37,7 @@ include 'spark3-extensions' include 'spark3-runtime' include 'pig' include 'hive-metastore' -include 'hivelink' +include 'hivelink-core' include 'nessie' include 'runtime' @@ -60,7 +60,7 @@ project(':spark3-extensions').name = 'iceberg-spark3-extensions' project(':spark3-runtime').name = 'iceberg-spark3-runtime' project(':pig').name = 'iceberg-pig' project(':hive-metastore').name = 'iceberg-hive-metastore' -project(':hivelink').name = 'iceberg-hivelink' +project(':hivelink-core').name = 'iceberg-hivelink-core' project(':nessie').name = 'iceberg-nessie' project(':runtime').name = 'iceberg-runtime' diff --git a/spark2/src/main/java/org/apache/iceberg/spark/source/Reader.java b/spark2/src/main/java/org/apache/iceberg/spark/source/Reader.java index 2ae355c09f..e04e3d99dc 100644 --- a/spark2/src/main/java/org/apache/iceberg/spark/source/Reader.java +++ b/spark2/src/main/java/org/apache/iceberg/spark/source/Reader.java @@ -44,7 +44,7 @@ import org.apache.iceberg.expressions.Expressions; import org.apache.iceberg.hadoop.HadoopFileIO; import org.apache.iceberg.hadoop.Util; -import org.apache.iceberg.hivelink.LegacyHiveTable; +import org.apache.iceberg.hivelink.core.LegacyHiveTable; import org.apache.iceberg.io.CloseableIterable; import org.apache.iceberg.io.FileIO; import org.apache.iceberg.orc.OrcRowFilterUtils; diff --git a/spark3/src/main/java/org/apache/iceberg/spark/source/SparkBatchScan.java b/spark3/src/main/java/org/apache/iceberg/spark/source/SparkBatchScan.java index 8df6004b9c..8ed47e90f3 100644 --- a/spark3/src/main/java/org/apache/iceberg/spark/source/SparkBatchScan.java +++ b/spark3/src/main/java/org/apache/iceberg/spark/source/SparkBatchScan.java @@ -37,7 +37,7 @@ import org.apache.iceberg.expressions.Expression; import org.apache.iceberg.hadoop.HadoopInputFile; import org.apache.iceberg.hadoop.Util; -import org.apache.iceberg.hivelink.LegacyHiveTable; +import org.apache.iceberg.hivelink.core.LegacyHiveTable; import org.apache.iceberg.io.FileIO; import org.apache.iceberg.orc.OrcRowFilterUtils; import org.apache.iceberg.relocated.com.google.common.base.Preconditions; From bb94901799168f7b1ed3b58b896a5241efb4fed0 Mon Sep 17 00:00:00 2001 From: Jiefan Li Date: Thu, 21 Apr 2022 10:40:00 -0700 Subject: [PATCH 2/2] Remove duplicate license --- .../schema/HiveSchemaWithPartnerVisitor.java | 19 ------------------- .../core/schema/MergeHiveSchemaWithAvro.java | 19 ------------------- .../hivelink/core/utils/FileSystemUtils.java | 19 ------------------- .../hivelink/core/utils/HiveTypeUtil.java | 19 ------------------- 4 files changed, 76 deletions(-) diff --git a/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/HiveSchemaWithPartnerVisitor.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/HiveSchemaWithPartnerVisitor.java index 54e58d5782..c1360fd26f 100644 --- a/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/HiveSchemaWithPartnerVisitor.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/HiveSchemaWithPartnerVisitor.java @@ -17,25 +17,6 @@ * under the License. */ -/* - * 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. - */ - package org.apache.iceberg.hivelink.core.schema; import java.util.List; diff --git a/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/MergeHiveSchemaWithAvro.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/MergeHiveSchemaWithAvro.java index 1881385f39..356a10be19 100644 --- a/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/MergeHiveSchemaWithAvro.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/schema/MergeHiveSchemaWithAvro.java @@ -17,25 +17,6 @@ * under the License. */ -/* - * 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. - */ - package org.apache.iceberg.hivelink.core.schema; import java.util.ArrayList; diff --git a/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/FileSystemUtils.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/FileSystemUtils.java index fa5c4a8bf6..ae0007cbb3 100644 --- a/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/FileSystemUtils.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/FileSystemUtils.java @@ -17,25 +17,6 @@ * under the License. */ -/* - * 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. - */ - package org.apache.iceberg.hivelink.core.utils; import java.io.IOException; diff --git a/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/HiveTypeUtil.java b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/HiveTypeUtil.java index 48d1878685..0ee8e9df4b 100644 --- a/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/HiveTypeUtil.java +++ b/hivelink-core/src/main/java/org/apache/iceberg/hivelink/core/utils/HiveTypeUtil.java @@ -17,25 +17,6 @@ * under the License. */ -/* - * 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. - */ - package org.apache.iceberg.hivelink.core.utils; import java.util.List;