This is an automated email from the ASF dual-hosted git repository.
jinsongzhou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git
The following commit(s) were added to refs/heads/master by this push:
new eef7e5ece [AMORO-1744] Rename the name of classes with the arctic
identifier in the mixed-format-hive module (#2835)
eef7e5ece is described below
commit eef7e5ece566ea1049c34994405403cf40b377c3
Author: ZhouJinsong <[email protected]>
AuthorDate: Wed May 15 11:26:54 2024 +0800
[AMORO-1744] Rename the name of classes with the arctic identifier in the
mixed-format-hive module (#2835)
* Rename the name of classes with the arctic identifier in the
mixed-format-hive module
* Change mixed hive catalog implemention class name
---
.../dashboard/controller/TableController.java | 8 +-
.../table/executor/HiveCommitSyncExecutor.java | 2 +-
.../amoro/server/table/AMSTableTestBase.java | 6 +-
.../java/org/apache/amoro/mixed/CatalogLoader.java | 2 +-
...tPool.java => AuthenticatedHiveClientPool.java} | 9 +-
.../apache/amoro/hive/CachedHiveClientPool.java | 10 +-
...rcticHiveCatalog.java => MixedHiveCatalog.java} | 34 +++---
.../apache/amoro/hive/catalog/MixedHiveTables.java | 5 +-
.../hive/io/reader/AdaptHiveMixedDeleteFilter.java | 2 +-
.../org/apache/amoro/hive/op/UpdateHiveFiles.java | 2 +-
.../optimizing/MixFormatOptimizingDataReader.java | 6 +-
.../apache/amoro/hive/table/KeyedHiveTable.java | 32 +++---
.../org/apache/amoro/hive/table/SupportHive.java | 8 +-
.../apache/amoro/hive/table/UnkeyedHiveTable.java | 45 +++-----
.../org/apache/amoro/hive/utils/CatalogUtil.java | 12 +-
.../amoro/hive/utils/HiveMetaSynchronizer.java | 128 +++++++++++----------
.../apache/amoro/hive/utils/HivePartitionUtil.java | 8 +-
.../org/apache/amoro/hive/utils/HiveTableUtil.java | 6 +-
.../amoro/hive/utils/UpgradeHiveTableUtil.java | 53 ++++-----
.../data/AdaptHiveGenericAppenderFactory.java | 4 +-
.../data/parquet/AdaptHiveBaseParquetReaders.java | 12 +-
.../data/parquet/AdaptHiveBaseParquetWriter.java | 8 +-
.../iceberg/parquet/AdaptHiveColumnWriter.java | 4 +-
.../apache/iceberg/parquet/AdaptHiveParquet.java | 8 +-
.../parquet/AdaptHiveParquetConversions.java | 11 +-
.../AdaptHiveParquetDictionaryRowGroupFilter.java | 4 +-
.../AdaptHiveParquetMetricsRowGroupFilter.java | 4 +-
.../iceberg/parquet/AdaptHiveParquetReader.java | 4 +-
.../parquet/AdaptHiveParquetSchemaUtil.java | 3 +-
.../iceberg/parquet/AdaptHiveParquetUtil.java | 9 +-
.../iceberg/parquet/AdaptHiveParquetWriter.java | 8 +-
.../iceberg/parquet/AdaptHivePrimitiveWriter.java | 4 +-
.../apache/iceberg/parquet/AdaptHiveReadConf.java | 5 +-
.../parquet/AdaptHiveTypeToMessageType.java | 4 +-
.../amoro/hive/catalog/TestHiveCatalogLoader.java | 4 +-
.../amoro/hive/catalog/TestMixedHiveCatalog.java | 6 +-
.../apache/amoro/hive/io/TestImpalaParquet.java | 2 +-
.../amoro/hive/utils/TestHiveMetaSynchronizer.java | 16 +--
.../amoro/hive/utils/TestUpgradeHiveTableUtil.java | 9 +-
.../org/apache/amoro/spark/ArcticSparkCatalog.java | 2 +-
.../org/apache/amoro/spark/ArcticSparkCatalog.java | 2 +-
.../trino/mixed/TestHiveTableBaseForTrino.java | 6 +-
42 files changed, 261 insertions(+), 256 deletions(-)
diff --git
a/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/TableController.java
b/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/TableController.java
index f8e9290fb..e39edd781 100644
---
a/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/TableController.java
+++
b/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/TableController.java
@@ -28,7 +28,7 @@ import org.apache.amoro.api.ServerTableIdentifier;
import org.apache.amoro.api.config.Configurations;
import org.apache.amoro.hive.CachedHiveClientPool;
import org.apache.amoro.hive.HMSClientPool;
-import org.apache.amoro.hive.catalog.ArcticHiveCatalog;
+import org.apache.amoro.hive.catalog.MixedHiveCatalog;
import org.apache.amoro.hive.utils.HiveTableUtil;
import org.apache.amoro.hive.utils.UpgradeHiveTableUtil;
import org.apache.amoro.mixed.CatalogLoader;
@@ -211,8 +211,8 @@ public class TableController {
Map<String, String> catalogProperties = new
HashMap<>(originCatalogProperties);
catalogProperties.put(CatalogMetaProperties.TABLE_FORMATS,
TableFormat.MIXED_HIVE.name());
- ArcticHiveCatalog arcticHiveCatalog =
- (ArcticHiveCatalog)
+ MixedHiveCatalog mixedHiveCatalog =
+ (MixedHiveCatalog)
CatalogLoader.createCatalog(
catalog, catalogMeta.getCatalogType(), catalogProperties,
tableMetaStore);
@@ -222,7 +222,7 @@ public class TableController {
upgradeRunningInfo.put(tableIdentifier, new UpgradeRunningInfo());
try {
UpgradeHiveTableUtil.upgradeHiveTable(
- arcticHiveCatalog,
+ mixedHiveCatalog,
TableIdentifier.of(catalog, db, table),
upgradeHiveMeta.getPkList().stream()
.map(UpgradeHiveMeta.PrimaryKeyField::getFieldName)
diff --git
a/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/table/executor/HiveCommitSyncExecutor.java
b/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/table/executor/HiveCommitSyncExecutor.java
index 6be8940f6..af567824f 100644
---
a/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/table/executor/HiveCommitSyncExecutor.java
+++
b/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/table/executor/HiveCommitSyncExecutor.java
@@ -71,6 +71,6 @@ public class HiveCommitSyncExecutor extends BaseTableExecutor
{
}
public static void syncIcebergToHive(MixedTable mixedTable) {
- HiveMetaSynchronizer.syncArcticDataToHive((SupportHive) mixedTable);
+ HiveMetaSynchronizer.syncMixedTableDataToHive((SupportHive) mixedTable);
}
}
diff --git
a/amoro-ams/amoro-ams-server/src/test/java/org/apache/amoro/server/table/AMSTableTestBase.java
b/amoro-ams/amoro-ams-server/src/test/java/org/apache/amoro/server/table/AMSTableTestBase.java
index e0ae41a5b..87c70dc23 100644
---
a/amoro-ams/amoro-ams-server/src/test/java/org/apache/amoro/server/table/AMSTableTestBase.java
+++
b/amoro-ams/amoro-ams-server/src/test/java/org/apache/amoro/server/table/AMSTableTestBase.java
@@ -28,7 +28,7 @@ import org.apache.amoro.api.TableMeta;
import org.apache.amoro.catalog.CatalogTestHelper;
import org.apache.amoro.catalog.MixedTables;
import org.apache.amoro.hive.TestHMS;
-import org.apache.amoro.hive.catalog.ArcticHiveCatalog;
+import org.apache.amoro.hive.catalog.MixedHiveCatalog;
import org.apache.amoro.mixed.CatalogLoader;
import org.apache.amoro.mixed.MixedFormatCatalog;
import org.apache.amoro.properties.CatalogMetaProperties;
@@ -195,8 +195,8 @@ public class AMSTableTestBase extends TableServiceTestBase {
// only create mixed hive table here !
catalogMeta.putToCatalogProperties(
CatalogMetaProperties.TABLE_FORMATS, TableFormat.MIXED_HIVE.name());
- ArcticHiveCatalog catalog =
- (ArcticHiveCatalog)
+ MixedHiveCatalog catalog =
+ (MixedHiveCatalog)
CatalogLoader.createCatalog(
catalogMeta.getCatalogName(),
catalogMeta.getCatalogType(),
diff --git a/amoro-core/src/main/java/org/apache/amoro/mixed/CatalogLoader.java
b/amoro-core/src/main/java/org/apache/amoro/mixed/CatalogLoader.java
index 7e5225de4..aa24c3630 100644
--- a/amoro-core/src/main/java/org/apache/amoro/mixed/CatalogLoader.java
+++ b/amoro-core/src/main/java/org/apache/amoro/mixed/CatalogLoader.java
@@ -45,7 +45,7 @@ import java.util.stream.Collectors;
public class CatalogLoader {
public static final String INTERNAL_CATALOG_IMPL =
InternalMixedIcebergCatalog.class.getName();
- public static final String HIVE_CATALOG_IMPL =
"org.apache.amoro.hive.catalog.ArcticHiveCatalog";
+ public static final String HIVE_CATALOG_IMPL =
"org.apache.amoro.hive.catalog.MixedHiveCatalog";
public static final String MIXED_ICEBERG_CATALOG_IMP =
BasicMixedIcebergCatalog.class.getName();
/**
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/ArcticHiveClientPool.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/AuthenticatedHiveClientPool.java
similarity index 91%
rename from
amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/ArcticHiveClientPool.java
rename to
amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/AuthenticatedHiveClientPool.java
index c8c012aeb..8b7f7e407 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/ArcticHiveClientPool.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/AuthenticatedHiveClientPool.java
@@ -35,11 +35,11 @@ import org.slf4j.LoggerFactory;
* Extended implementation of {@link ClientPoolImpl} with {@link
TableMetaStore} to support
* authenticated hive cluster.
*/
-public class ArcticHiveClientPool extends ClientPoolImpl<HMSClient,
TException> {
+public class AuthenticatedHiveClientPool extends ClientPoolImpl<HMSClient,
TException> {
private final TableMetaStore metaStore;
private final HiveConf hiveConf;
- private static final Logger LOG =
LoggerFactory.getLogger(ArcticHiveClientPool.class);
+ private static final Logger LOG =
LoggerFactory.getLogger(AuthenticatedHiveClientPool.class);
private static final DynConstructors.Ctor<HiveMetaStoreClient> CLIENT_CTOR =
DynConstructors.builder()
@@ -47,9 +47,10 @@ public class ArcticHiveClientPool extends
ClientPoolImpl<HMSClient, TException>
.impl(HiveMetaStoreClient.class, Configuration.class)
.build();
- public ArcticHiveClientPool(TableMetaStore tableMetaStore, int poolSize) {
+ public AuthenticatedHiveClientPool(TableMetaStore tableMetaStore, int
poolSize) {
super(poolSize, TTransportException.class, true);
- this.hiveConf = new HiveConf(tableMetaStore.getConfiguration(),
ArcticHiveClientPool.class);
+ this.hiveConf =
+ new HiveConf(tableMetaStore.getConfiguration(),
AuthenticatedHiveClientPool.class);
this.hiveConf.addResource(tableMetaStore.getConfiguration());
this.hiveConf.addResource(tableMetaStore.getHiveSiteLocation().orElse(null));
this.metaStore = tableMetaStore;
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/CachedHiveClientPool.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/CachedHiveClientPool.java
index 31b796f3e..7ddc666fa 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/CachedHiveClientPool.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/CachedHiveClientPool.java
@@ -36,10 +36,10 @@ import java.io.Serializable;
import java.util.Map;
import java.util.concurrent.TimeUnit;
-/** Cache {@link ArcticHiveClientPool} with {@link TableMetaStore} key. */
+/** Cache {@link AuthenticatedHiveClientPool} with {@link TableMetaStore} key.
*/
public class CachedHiveClientPool implements HMSClientPool, Serializable {
- private static Cache<TableMetaStore, ArcticHiveClientPool> clientPoolCache;
+ private static Cache<TableMetaStore, AuthenticatedHiveClientPool>
clientPoolCache;
private final TableMetaStore tableMetaStore;
private final int clientPoolSize;
@@ -60,9 +60,9 @@ public class CachedHiveClientPool implements HMSClientPool,
Serializable {
init();
}
- private ArcticHiveClientPool clientPool() {
+ private AuthenticatedHiveClientPool clientPool() {
return clientPoolCache.get(
- tableMetaStore, k -> new ArcticHiveClientPool(tableMetaStore,
clientPoolSize));
+ tableMetaStore, k -> new AuthenticatedHiveClientPool(tableMetaStore,
clientPoolSize));
}
private synchronized void init() {
@@ -70,7 +70,7 @@ public class CachedHiveClientPool implements HMSClientPool,
Serializable {
clientPoolCache =
Caffeine.newBuilder()
.expireAfterAccess(evictionInterval, TimeUnit.MILLISECONDS)
- .removalListener((key, value, cause) -> ((ArcticHiveClientPool)
value).close())
+ .removalListener((key, value, cause) ->
((AuthenticatedHiveClientPool) value).close())
.build();
}
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/catalog/ArcticHiveCatalog.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/catalog/MixedHiveCatalog.java
similarity index 95%
rename from
amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/catalog/ArcticHiveCatalog.java
rename to
amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/catalog/MixedHiveCatalog.java
index a0a3a5360..aea6e3502 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/catalog/ArcticHiveCatalog.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/catalog/MixedHiveCatalog.java
@@ -87,9 +87,9 @@ import java.util.Objects;
import java.util.stream.Collectors;
/** Implementation of {@link MixedFormatCatalog} to support Hive table as base
store. */
-public class ArcticHiveCatalog implements MixedFormatCatalog {
+public class MixedHiveCatalog implements MixedFormatCatalog {
- private static final Logger LOG =
LoggerFactory.getLogger(ArcticHiveCatalog.class);
+ private static final Logger LOG =
LoggerFactory.getLogger(MixedHiveCatalog.class);
protected AmsClient client;
private CachedHiveClientPool hiveClientPool;
@@ -171,7 +171,7 @@ public class ArcticHiveCatalog implements
MixedFormatCatalog {
}
/** HMS is case-insensitive for table name and database */
- protected TableMeta getArcticTableMeta(TableIdentifier identifier) {
+ protected TableMeta getMixedTableMeta(TableIdentifier identifier) {
org.apache.hadoop.hive.metastore.api.Table hiveTable = null;
identifier = identifier.toLowCaseIdentifier();
try {
@@ -185,24 +185,24 @@ public class ArcticHiveCatalog implements
MixedFormatCatalog {
Map<String, String> hiveParameters = hiveTable.getParameters();
- String arcticRootLocation = hiveParameters.get(MIXED_TABLE_ROOT_LOCATION);
- if (arcticRootLocation == null) {
+ String mixedTableRootLocation =
hiveParameters.get(MIXED_TABLE_ROOT_LOCATION);
+ if (mixedTableRootLocation == null) {
// if hive location ends with /hive, then it's a mixed-hive table. we
need to remove /hive to
// get root location.
// if hive location doesn't end with /hive, then it's a pure-hive table.
we can use the
// location as root location.
String hiveRootLocation = hiveTable.getSd().getLocation();
if (hiveRootLocation.endsWith("/hive")) {
- arcticRootLocation = hiveRootLocation.substring(0,
hiveRootLocation.length() - 5);
+ mixedTableRootLocation = hiveRootLocation.substring(0,
hiveRootLocation.length() - 5);
} else {
- arcticRootLocation = hiveRootLocation;
+ mixedTableRootLocation = hiveRootLocation;
}
}
// full path of base, change and root location
- String baseLocation = arcticRootLocation + "/base";
- String changeLocation = arcticRootLocation + "/change";
- // load base table for get arctic table properties
+ String baseLocation = mixedTableRootLocation + "/base";
+ String changeLocation = mixedTableRootLocation + "/change";
+ // load base table for get table properties
Table baseIcebergTable =
getTables().loadHadoopTableByLocation(baseLocation);
if (baseIcebergTable == null) {
throw new NoSuchTableException("load table failed %s, base table not
found.", identifier);
@@ -213,7 +213,7 @@ public class ArcticHiveCatalog implements
MixedFormatCatalog {
tableMeta.setTableIdentifier(identifier.buildTableIdentifier());
Map<String, String> locations = new HashMap<>();
- putNotNullProperties(locations, MetaTableProperties.LOCATION_KEY_TABLE,
arcticRootLocation);
+ putNotNullProperties(locations, MetaTableProperties.LOCATION_KEY_TABLE,
mixedTableRootLocation);
putNotNullProperties(locations, MetaTableProperties.LOCATION_KEY_CHANGE,
changeLocation);
putNotNullProperties(locations, MetaTableProperties.LOCATION_KEY_BASE,
baseLocation);
// set table location
@@ -267,7 +267,7 @@ public class ArcticHiveCatalog implements
MixedFormatCatalog {
@Override
public void renameTable(TableIdentifier from, String newTableName) {
- throw new UnsupportedOperationException("unsupported rename arctic table
for now.");
+ throw new UnsupportedOperationException("unsupported rename mixed-hive
table for now.");
}
public HMSClientPool getHMSClient() {
@@ -279,11 +279,11 @@ public class ArcticHiveCatalog implements
MixedFormatCatalog {
*
* <ul>
* <li>1、call getTableObjectsByName to get all Table objects of database
- * <li>2、filter hive tables whose properties don't have arctic table flag
+ * <li>2、filter hive tables whose properties don't have mixed-hive table
flag
* </ul>
*
* we don't do cache here because we create/drop table through engine (like
spark) connector, they
- * have another ArcticHiveCatalog instance。 we can't find a easy way to
update cache.
+ * have another MixedHiveCatalog instance。 we can't find a easy way to
update cache.
*
* @param database
* @return
@@ -299,7 +299,7 @@ public class ArcticHiveCatalog implements
MixedFormatCatalog {
List<org.apache.hadoop.hive.metastore.api.Table> hiveTables =
client.getTableObjectsByName(database, tableNames);
LOG.info("call getTableObjectsByName cost {} ms",
System.currentTimeMillis() - start);
- // filter hive tables whose properties don't have arctic table flag
+ // filter hive tables whose properties don't have mixed-hive table
flag
if (hiveTables != null && !hiveTables.isEmpty()) {
List<TableIdentifier> loadResult =
hiveTables.stream()
@@ -344,7 +344,7 @@ public class ArcticHiveCatalog implements
MixedFormatCatalog {
@Override
public MixedTable loadTable(TableIdentifier identifier) {
validate(identifier);
- TableMeta meta = getArcticTableMeta(identifier);
+ TableMeta meta = getMixedTableMeta(identifier);
if (meta.getLocations() == null) {
throw new IllegalStateException("load table failed, lack locations
info");
}
@@ -356,7 +356,7 @@ public class ArcticHiveCatalog implements
MixedFormatCatalog {
validate(identifier);
TableMeta meta;
try {
- meta = getArcticTableMeta(identifier);
+ meta = getMixedTableMeta(identifier);
} catch (NoSuchTableException e) {
return false;
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/catalog/MixedHiveTables.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/catalog/MixedHiveTables.java
index 0c96530ea..acb46da57 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/catalog/MixedHiveTables.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/catalog/MixedHiveTables.java
@@ -442,7 +442,7 @@ public class MixedHiveTables {
return;
}
// Drop hive table operation will only delete hive table metadata
- // Delete data files operation will use BasicArcticCatalog
+ // Delete data files operation will use MixedHiveCatalog
if (purge) {
try {
hiveClientPool.run(
@@ -458,7 +458,8 @@ public class MixedHiveTables {
throw new RuntimeException("Failed to drop table:" +
tableMeta.getTableIdentifier(), e);
}
} else {
- // If purge is not true, we will not drop the hive table and need to
remove the arctic table
+ // If purge is not true, we will not drop the hive table and need to
remove the mixed-hive
+ // table
// flag
try {
hiveClientPool.run(
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/io/reader/AdaptHiveMixedDeleteFilter.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/io/reader/AdaptHiveMixedDeleteFilter.java
index b1db0c4fd..48a96714b 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/io/reader/AdaptHiveMixedDeleteFilter.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/io/reader/AdaptHiveMixedDeleteFilter.java
@@ -34,7 +34,7 @@ import java.util.Map;
import java.util.Set;
/**
- * Abstract implementation of ArcticDeleteFilter to adapt hive when open
equality delete files.
+ * Abstract implementation of MixedDeleteFilter to adapt hive when open
equality delete files.
*
* @param <T> to indicate the record data type.
*/
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/op/UpdateHiveFiles.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/op/UpdateHiveFiles.java
index 3f3d43732..b01544492 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/op/UpdateHiveFiles.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/op/UpdateHiveFiles.java
@@ -144,7 +144,7 @@ public abstract class UpdateHiveFiles<T extends
SnapshotUpdate<T>> implements Sn
commitTimestamp = (int) (System.currentTimeMillis() / 1000);
applyDeleteExpr();
if (syncDataToHive) {
- HiveMetaSynchronizer.syncArcticDataToHive(table);
+ HiveMetaSynchronizer.syncMixedTableDataToHive(table);
}
List<DataFile> committedDataFiles =
HiveCommitUtil.commitConsistentWriteFiles(this.addFiles, table.io(),
table.spec());
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/optimizing/MixFormatOptimizingDataReader.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/optimizing/MixFormatOptimizingDataReader.java
index 8a6dabfc3..533d31748 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/optimizing/MixFormatOptimizingDataReader.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/optimizing/MixFormatOptimizingDataReader.java
@@ -65,7 +65,7 @@ public class MixFormatOptimizingDataReader implements
OptimizingDataReader {
@Override
public CloseableIterable<Record> readData() {
- AdaptHiveGenericKeyedDataReader reader = arcticDataReader(table.schema());
+ AdaptHiveGenericKeyedDataReader reader =
mixedTableDataReader(table.schema());
// Change returned value by readData from Iterator to Iterable in future
CloseableIterator<Record> closeableIterator =
@@ -80,7 +80,7 @@ public class MixFormatOptimizingDataReader implements
OptimizingDataReader {
MetadataColumns.FILE_PATH,
MetadataColumns.ROW_POSITION,
org.apache.amoro.table.MetadataColumns.TREE_NODE_FIELD);
- AdaptHiveGenericKeyedDataReader reader = arcticDataReader(schema);
+ AdaptHiveGenericKeyedDataReader reader = mixedTableDataReader(schema);
return wrapIterator2Iterable(
reader.readDeletedData(nodeFileScanTask(input.rePosDeletedDataFilesForMixed())));
}
@@ -88,7 +88,7 @@ public class MixFormatOptimizingDataReader implements
OptimizingDataReader {
@Override
public void close() {}
- private AdaptHiveGenericKeyedDataReader arcticDataReader(Schema
requiredSchema) {
+ private AdaptHiveGenericKeyedDataReader mixedTableDataReader(Schema
requiredSchema) {
PrimaryKeySpec primaryKeySpec = PrimaryKeySpec.noPrimaryKey();
if (table.isKeyedTable()) {
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/KeyedHiveTable.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/KeyedHiveTable.java
index f9c9c4e8b..0bec06773 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/KeyedHiveTable.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/KeyedHiveTable.java
@@ -55,11 +55,11 @@ public class KeyedHiveTable extends BasicKeyedTable
implements SupportHive {
ChangeTable changeTable) {
super(tableLocation, primaryKeySpec, baseTable, changeTable);
this.hiveClient = hiveClient;
- if (enableSyncHiveSchemaToArctic()) {
- syncHiveSchemaToArctic();
+ if (enableSyncHiveSchemaToMixedTable()) {
+ syncHiveSchemaToMixedTable();
}
- if (enableSyncHiveDataToArctic()) {
- syncHiveDataToArctic(false);
+ if (enableSyncHiveDataToMixedTable()) {
+ syncHiveDataToMixedTable(false);
}
}
@@ -76,11 +76,11 @@ public class KeyedHiveTable extends BasicKeyedTable
implements SupportHive {
@Override
public void refresh() {
super.refresh();
- if (enableSyncHiveSchemaToArctic()) {
- syncHiveSchemaToArctic();
+ if (enableSyncHiveSchemaToMixedTable()) {
+ syncHiveSchemaToMixedTable();
}
- if (enableSyncHiveDataToArctic()) {
- syncHiveDataToArctic(false);
+ if (enableSyncHiveDataToMixedTable()) {
+ syncHiveDataToMixedTable(false);
}
}
@@ -90,7 +90,7 @@ public class KeyedHiveTable extends BasicKeyedTable
implements SupportHive {
}
@Override
- public boolean enableSyncHiveSchemaToArctic() {
+ public boolean enableSyncHiveSchemaToMixedTable() {
return PropertyUtil.propertyAsBoolean(
properties(),
HiveTableProperties.AUTO_SYNC_HIVE_SCHEMA_CHANGE,
@@ -98,12 +98,12 @@ public class KeyedHiveTable extends BasicKeyedTable
implements SupportHive {
}
@Override
- public void syncHiveSchemaToArctic() {
- HiveMetaSynchronizer.syncHiveSchemaToArctic(this, hiveClient);
+ public void syncHiveSchemaToMixedTable() {
+ HiveMetaSynchronizer.syncHiveSchemaToMixedTable(this, hiveClient);
}
@Override
- public boolean enableSyncHiveDataToArctic() {
+ public boolean enableSyncHiveDataToMixedTable() {
return PropertyUtil.propertyAsBoolean(
properties(),
HiveTableProperties.AUTO_SYNC_HIVE_DATA_WRITE,
@@ -111,8 +111,8 @@ public class KeyedHiveTable extends BasicKeyedTable
implements SupportHive {
}
@Override
- public void syncHiveDataToArctic(boolean force) {
- HiveMetaSynchronizer.syncHiveDataToArctic(this, hiveClient, force);
+ public void syncHiveDataToMixedTable(boolean force) {
+ HiveMetaSynchronizer.syncHiveDataToMixedTable(this, hiveClient, force);
}
@Override
@@ -151,7 +151,7 @@ public class KeyedHiveTable extends BasicKeyedTable
implements SupportHive {
public HiveBaseInternalTable(
TableIdentifier tableIdentifier,
Table icebergTable,
- AuthenticatedHadoopFileIO arcticFileIO,
+ AuthenticatedHadoopFileIO fileIO,
String tableLocation,
HMSClientPool hiveClient,
Map<String, String> catalogProperties,
@@ -159,7 +159,7 @@ public class KeyedHiveTable extends BasicKeyedTable
implements SupportHive {
super(
tableIdentifier,
icebergTable,
- arcticFileIO,
+ fileIO,
tableLocation,
hiveClient,
catalogProperties,
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/SupportHive.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/SupportHive.java
index fefd355b1..afbbb68fa 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/SupportHive.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/SupportHive.java
@@ -41,11 +41,11 @@ public interface SupportHive extends MixedTable {
*/
HMSClientPool getHMSClient();
- boolean enableSyncHiveDataToArctic();
+ boolean enableSyncHiveDataToMixedTable();
- boolean enableSyncHiveSchemaToArctic();
+ boolean enableSyncHiveSchemaToMixedTable();
- void syncHiveDataToArctic(boolean force);
+ void syncHiveDataToMixedTable(boolean force);
- void syncHiveSchemaToArctic();
+ void syncHiveSchemaToMixedTable();
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/UnkeyedHiveTable.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/UnkeyedHiveTable.java
index e80324b09..7534007c1 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/UnkeyedHiveTable.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/table/UnkeyedHiveTable.java
@@ -56,38 +56,31 @@ public class UnkeyedHiveTable extends BasicUnkeyedTable
implements BaseTable, Su
public UnkeyedHiveTable(
TableIdentifier tableIdentifier,
Table icebergTable,
- AuthenticatedHadoopFileIO arcticFileIO,
+ AuthenticatedHadoopFileIO fileIO,
String tableLocation,
HMSClientPool hiveClient,
Map<String, String> catalogProperties) {
- this(
- tableIdentifier,
- icebergTable,
- arcticFileIO,
- tableLocation,
- hiveClient,
- catalogProperties,
- true);
+ this(tableIdentifier, icebergTable, fileIO, tableLocation, hiveClient,
catalogProperties, true);
}
public UnkeyedHiveTable(
TableIdentifier tableIdentifier,
Table icebergTable,
- AuthenticatedHadoopFileIO arcticFileIO,
+ AuthenticatedHadoopFileIO fileIO,
String tableLocation,
HMSClientPool hiveClient,
Map<String, String> catalogProperties,
boolean syncHiveChange) {
- super(tableIdentifier, icebergTable, arcticFileIO, catalogProperties);
- this.fileIO = arcticFileIO;
+ super(tableIdentifier, icebergTable, fileIO, catalogProperties);
+ this.fileIO = fileIO;
this.hiveClient = hiveClient;
this.tableLocation = tableLocation;
this.syncHiveChange = syncHiveChange;
- if (enableSyncHiveSchemaToArctic()) {
- syncHiveSchemaToArctic();
+ if (enableSyncHiveSchemaToMixedTable()) {
+ syncHiveSchemaToMixedTable();
}
- if (enableSyncHiveDataToArctic()) {
- syncHiveDataToArctic(false);
+ if (enableSyncHiveDataToMixedTable()) {
+ syncHiveDataToMixedTable(false);
}
}
@@ -104,11 +97,11 @@ public class UnkeyedHiveTable extends BasicUnkeyedTable
implements BaseTable, Su
@Override
public void refresh() {
super.refresh();
- if (enableSyncHiveSchemaToArctic()) {
- syncHiveSchemaToArctic();
+ if (enableSyncHiveSchemaToMixedTable()) {
+ syncHiveSchemaToMixedTable();
}
- if (enableSyncHiveDataToArctic()) {
- syncHiveDataToArctic(false);
+ if (enableSyncHiveDataToMixedTable()) {
+ syncHiveDataToMixedTable(false);
}
}
@@ -161,7 +154,7 @@ public class UnkeyedHiveTable extends BasicUnkeyedTable
implements BaseTable, Su
}
@Override
- public boolean enableSyncHiveSchemaToArctic() {
+ public boolean enableSyncHiveSchemaToMixedTable() {
return syncHiveChange
&& PropertyUtil.propertyAsBoolean(
properties(),
@@ -170,12 +163,12 @@ public class UnkeyedHiveTable extends BasicUnkeyedTable
implements BaseTable, Su
}
@Override
- public void syncHiveSchemaToArctic() {
- HiveMetaSynchronizer.syncHiveSchemaToArctic(this, hiveClient);
+ public void syncHiveSchemaToMixedTable() {
+ HiveMetaSynchronizer.syncHiveSchemaToMixedTable(this, hiveClient);
}
@Override
- public boolean enableSyncHiveDataToArctic() {
+ public boolean enableSyncHiveDataToMixedTable() {
return syncHiveChange
&& PropertyUtil.propertyAsBoolean(
properties(),
@@ -184,7 +177,7 @@ public class UnkeyedHiveTable extends BasicUnkeyedTable
implements BaseTable, Su
}
@Override
- public void syncHiveDataToArctic(boolean force) {
- HiveMetaSynchronizer.syncHiveDataToArctic(this, hiveClient, force);
+ public void syncHiveDataToMixedTable(boolean force) {
+ HiveMetaSynchronizer.syncHiveDataToMixedTable(this, hiveClient, force);
}
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/CatalogUtil.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/CatalogUtil.java
index 1069fd0e7..09eea13c5 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/CatalogUtil.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/CatalogUtil.java
@@ -18,7 +18,7 @@
package org.apache.amoro.hive.utils;
-import org.apache.amoro.hive.catalog.ArcticHiveCatalog;
+import org.apache.amoro.hive.catalog.MixedHiveCatalog;
import org.apache.amoro.mixed.MixedFormatCatalog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -27,12 +27,12 @@ public class CatalogUtil {
private static final Logger LOG = LoggerFactory.getLogger(CatalogUtil.class);
/**
- * check arctic catalog is hive catalog
+ * check if the catalog is mixed-hive catalog
*
- * @param arcticCatalog target arctic catalog
- * @return Whether hive catalog. true is hive catalog, false isn't hive
catalog.
+ * @param mixedCatalog target mixed catalog
+ * @return Whether mixed-hive catalog.
*/
- public static boolean isHiveCatalog(MixedFormatCatalog arcticCatalog) {
- return arcticCatalog instanceof ArcticHiveCatalog;
+ public static boolean isMixedHiveCatalog(MixedFormatCatalog mixedCatalog) {
+ return mixedCatalog instanceof MixedHiveCatalog;
}
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HiveMetaSynchronizer.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HiveMetaSynchronizer.java
index 752ea923c..a37871dc7 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HiveMetaSynchronizer.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HiveMetaSynchronizer.java
@@ -67,18 +67,18 @@ import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
-/** Utils for syncing the metadata between the hive table and the arctic
table. */
+/** Utils for syncing the metadata between the hive table and the mixed-hive
table. */
public class HiveMetaSynchronizer {
private static final Logger LOG =
LoggerFactory.getLogger(HiveMetaSynchronizer.class);
/**
- * Synchronize the schema change of the hive table to arctic table
+ * Synchronize the schema change of the hive table to mixed-hive table
*
- * @param table arctic table to accept the schema change
+ * @param table mixed-hive table to accept the schema change
* @param hiveClient hive client
*/
- public static void syncHiveSchemaToArctic(MixedTable table, HMSClientPool
hiveClient) {
+ public static void syncHiveSchemaToMixedTable(MixedTable table,
HMSClientPool hiveClient) {
try {
if (!HiveTableUtil.checkExist(hiveClient, table.id())) {
LOG.warn("Hive table {} does not exist, try to skip sync schema to
amoro", table.id());
@@ -121,7 +121,10 @@ public class HiveMetaSynchronizer {
if (fields.isEmpty()) {
updateSchema.addColumn(parentName, hiveField.name(), hiveField.type(),
hiveField.doc());
update = true;
- LOG.info("Table {} sync new hive column {} to arctic",
tableIdentifier, hiveField);
+ LOG.info(
+ "Table {} sync new hive column {} to thet mixed-hive table",
+ tableIdentifier,
+ hiveField);
} else if (fields.size() == 1) {
Types.NestedField icebergField = fields.get(0);
if (!icebergField.type().equals(hiveField.type())
@@ -134,10 +137,13 @@ public class HiveMetaSynchronizer {
updateSchema.updateColumn(
columnName, hiveField.type().asPrimitiveType(),
hiveField.doc());
update = true;
- LOG.info("Table {} sync hive column {} to arctic",
tableIdentifier, hiveField);
+ LOG.info(
+ "Table {} sync hive column {} to the mixed-hive table",
+ tableIdentifier,
+ hiveField);
} else {
LOG.warn(
- "Table {} sync hive column {} to arctic failed, because of
type mismatch",
+ "Table {} sync hive column {} to the mixed-hive table
failed, because of type mismatch",
tableIdentifier,
hiveField);
}
@@ -154,7 +160,7 @@ public class HiveMetaSynchronizer {
hiveField.type().asStructType());
} else {
LOG.warn(
- "Table {} sync hive column {} to arctic failed, because of
type mismatch",
+ "Table {} sync hive column {} to the mixed-hive table failed,
because of type mismatch",
tableIdentifier,
hiveField);
}
@@ -166,17 +172,17 @@ public class HiveMetaSynchronizer {
return update;
}
- public static void syncHiveDataToArctic(SupportHive table, HMSClientPool
hiveClient) {
- syncHiveDataToArctic(table, hiveClient, false);
+ public static void syncHiveDataToMixedTable(SupportHive table, HMSClientPool
hiveClient) {
+ syncHiveDataToMixedTable(table, hiveClient, false);
}
/**
- * Synchronize the data change of the hive table to arctic table
+ * Synchronize the data change of the hive table to the mixed-hive table
*
- * @param table arctic table to accept the data change
+ * @param table mixed-hive table to accept the data change
* @param hiveClient hive client
*/
- public static void syncHiveDataToArctic(
+ public static void syncHiveDataToMixedTable(
SupportHive table, HMSClientPool hiveClient, boolean force) {
if (!HiveTableUtil.checkExist(hiveClient, table.id())) {
LOG.warn("Hive table {} does not exist, try to skip sync data to amoro",
table.id());
@@ -211,7 +217,7 @@ public class HiveMetaSynchronizer {
client ->
client.listPartitions(
table.id().getDatabase(), table.id().getTableName(),
Short.MAX_VALUE));
- // group arctic files by partition.
+ // group mixed-hive table files by partition.
StructLikeMap<Collection<DataFile>> filesGroupedByPartition =
StructLikeMap.create(table.spec().partitionType());
TableScan tableScan = baseStore.newScan();
@@ -240,7 +246,7 @@ public class HiveMetaSynchronizer {
if (filesGroupedByPartition.get(partitionData) != null) {
filesToDelete.addAll(filesGroupedByPartition.get(partitionData));
filesToAdd.addAll(hiveDataFiles);
- // make sure new partition is not created by arctic
+ // make sure new partition is not created by mixed-hive table
} else if (!CompatibleHivePropertyUtil.propertyAsBoolean(
hivePartition.getParameters(),
HiveTableProperties.MIXED_TABLE_FLAG, false)) {
filesToAdd.addAll(hiveDataFiles);
@@ -266,11 +272,11 @@ public class HiveMetaSynchronizer {
}
/**
- * Synchronize the data change of the arctic table to hive table
+ * Synchronize the data change of the mixed-hive table to hive table
*
* @param table support hive table
*/
- public static void syncArcticDataToHive(SupportHive table) {
+ public static void syncMixedTableDataToHive(SupportHive table) {
UnkeyedTable baseStore;
if (table.isKeyedTable()) {
baseStore = table.asKeyedTable().baseTable();
@@ -286,13 +292,13 @@ public class HiveMetaSynchronizer {
syncPartitionTable(table, partitionProperty);
}
} catch (Exception e) {
- throw new RuntimeException("Failed to sync arctic data to hive:" +
table.id(), e);
+ throw new RuntimeException("Failed to sync mixed-hive table data to
hive:" + table.id(), e);
}
}
/**
- * once get location from iceberg property, should update hive table
location, because only arctic
- * update hive table location for unPartitioned table.
+ * once get location from iceberg property, should update hive table
location, because only
+ * mixed-hive table update hive table location for unPartitioned table.
*/
private static void syncNoPartitionTable(
SupportHive table, StructLikeMap<Map<String, String>> partitionProperty)
{
@@ -442,10 +448,10 @@ public class HiveMetaSynchronizer {
inHiveNotInIceberg.forEach(
partition -> {
Partition hivePartition = hivePartitionMap.get(partition);
- boolean isArctic =
+ boolean isMixedTable =
CompatibleHivePropertyUtil.propertyAsBoolean(
hivePartition.getParameters(),
HiveTableProperties.MIXED_TABLE_FLAG, false);
- if (isArctic) {
+ if (isMixedTable) {
HivePartitionUtil.dropPartition(
((SupportHive) mixedTable).getHMSClient(), mixedTable,
hivePartition);
}
@@ -522,91 +528,93 @@ public class HiveMetaSynchronizer {
@VisibleForTesting
static boolean partitionHasModified(
- UnkeyedTable arcticTable, Partition hivePartition, StructLike
partitionData) {
+ UnkeyedTable baseStore, Partition hivePartition, StructLike
partitionData) {
String hiveTransientTime =
hivePartition.getParameters().get("transient_lastDdlTime");
- String arcticTransientTime =
- arcticTable.partitionProperty().containsKey(partitionData)
- ? arcticTable
+ String mixedTransientTime =
+ baseStore.partitionProperty().containsKey(partitionData)
+ ? baseStore
.partitionProperty()
.get(partitionData)
.get(HiveTableProperties.PARTITION_PROPERTIES_KEY_TRANSIENT_TIME)
: null;
String hiveLocation = hivePartition.getSd().getLocation();
- String arcticPartitionLocation =
- arcticTable.partitionProperty().containsKey(partitionData)
- ? arcticTable
+ String mixedPartitionLocation =
+ baseStore.partitionProperty().containsKey(partitionData)
+ ? baseStore
.partitionProperty()
.get(partitionData)
.get(HiveTableProperties.PARTITION_PROPERTIES_KEY_HIVE_LOCATION)
: null;
- // hive partition location is modified only in arctic full optimize, So if
the hive partition
- // location is
- // different from the arctic partition location, it is not necessary to
trigger synchronization
- // from the hive
- // side to the arctic
- if (arcticPartitionLocation != null &&
!arcticPartitionLocation.equals(hiveLocation)) {
+ // hive partition location is modified only in mixed-hive table full
optimizing, So if the hive
+ // partition
+ // location is different from the mixed-hive table partition location, it
is not necessary to
+ // trigger
+ // synchronization from the hive side to the mixed-hive table
+ if (mixedPartitionLocation != null &&
!mixedPartitionLocation.equals(hiveLocation)) {
return false;
}
- // compare hive partition parameter transient_lastDdlTime with arctic
partition properties to
+ // compare hive partition parameter transient_lastDdlTime with mixed-hive
table partition
+ // properties to
// find out if the partition is changed.
- return arcticTransientTime == null ||
!arcticTransientTime.equals(hiveTransientTime);
+ return mixedTransientTime == null ||
!mixedTransientTime.equals(hiveTransientTime);
}
@VisibleForTesting
- static boolean tableHasModified(UnkeyedTable arcticTable, Table table) {
+ static boolean tableHasModified(UnkeyedTable baseStore, Table table) {
String hiveTransientTime =
table.getParameters().get("transient_lastDdlTime");
- StructLikeMap<Map<String, String>> structLikeMap =
arcticTable.partitionProperty();
- String arcticTransientTime = null;
+ StructLikeMap<Map<String, String>> structLikeMap =
baseStore.partitionProperty();
+ String mixedTransientTime = null;
if (structLikeMap.get(TablePropertyUtil.EMPTY_STRUCT) != null) {
- arcticTransientTime =
+ mixedTransientTime =
structLikeMap
.get(TablePropertyUtil.EMPTY_STRUCT)
.get(HiveTableProperties.PARTITION_PROPERTIES_KEY_TRANSIENT_TIME);
}
String hiveLocation = table.getSd().getLocation();
- String arcticPartitionLocation =
-
arcticTable.partitionProperty().containsKey(TablePropertyUtil.EMPTY_STRUCT)
- ? arcticTable
+ String mixedPartitionLocation =
+
baseStore.partitionProperty().containsKey(TablePropertyUtil.EMPTY_STRUCT)
+ ? baseStore
.partitionProperty()
.get(TablePropertyUtil.EMPTY_STRUCT)
.get(HiveTableProperties.PARTITION_PROPERTIES_KEY_HIVE_LOCATION)
: null;
- // hive partition location is modified only in arctic full optimize, So if
the hive partition
- // location is
- // different from the arctic partition location, it is not necessary to
trigger synchronization
- // from the hive
- // side to the arctic
- if (arcticPartitionLocation != null &&
!arcticPartitionLocation.equals(hiveLocation)) {
+ // hive partition location is modified only in mixed-hive table full
optimizing, So if the hive
+ // partition
+ // location is different from the mixed-hive table partition location, it
is not necessary to
+ // trigger
+ // synchronization from the hive side to the mixed-hive table
+ if (mixedPartitionLocation != null &&
!mixedPartitionLocation.equals(hiveLocation)) {
return false;
}
- // compare hive partition parameter transient_lastDdlTime with arctic
partition properties to
+ // compare hive partition parameter transient_lastDdlTime with mixed-hive
table partition
+ // properties to
// find out if the partition is changed.
- return arcticTransientTime == null ||
!arcticTransientTime.equals(hiveTransientTime);
+ return mixedTransientTime == null ||
!mixedTransientTime.equals(hiveTransientTime);
}
private static List<DataFile> listHivePartitionFiles(
- SupportHive arcticTable, Map<String, String> partitionValueMap, String
partitionLocation) {
- return arcticTable
+ SupportHive mixedTable, Map<String, String> partitionValueMap, String
partitionLocation) {
+ return mixedTable
.io()
.doAs(
() ->
TableMigrationUtil.listPartition(
partitionValueMap,
partitionLocation,
- arcticTable
+ mixedTable
.properties()
.getOrDefault(
TableProperties.DEFAULT_FILE_FORMAT,
TableProperties.DEFAULT_FILE_FORMAT_DEFAULT),
- arcticTable.spec(),
- arcticTable.io().getConf(),
- MetricsConfig.fromProperties(arcticTable.properties()),
+ mixedTable.spec(),
+ mixedTable.io().getConf(),
+ MetricsConfig.fromProperties(mixedTable.properties()),
NameMappingParser.fromJson(
- arcticTable
+ mixedTable
.properties()
.get(org.apache.iceberg.TableProperties.DEFAULT_NAME_MAPPING))));
}
@@ -624,7 +632,7 @@ public class HiveMetaSynchronizer {
MixedTable table, List<DataFile> filesToDelete, List<DataFile>
filesToAdd) {
if (filesToDelete.size() > 0 || filesToAdd.size() > 0) {
LOG.info(
- "Table {} sync hive data change to arctic, delete files: {}, add
files {}",
+ "Table {} sync hive data change to the mixed-hive table, delete
files: {}, add files {}",
table.id(),
filesToDelete.stream().map(DataFile::path).collect(Collectors.toList()),
filesToAdd.stream().map(DataFile::path).collect(Collectors.toList()));
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HivePartitionUtil.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HivePartitionUtil.java
index 4214f92fe..df3875d6b 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HivePartitionUtil.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HivePartitionUtil.java
@@ -131,7 +131,7 @@ public class HivePartitionUtil {
/**
* Gets all partitions object of the Hive table.
*
- * @param hiveClient Hive client from ArcticHiveCatalog
+ * @param hiveClient Hive client from MixedHiveCatalog
* @param tableIdentifier A table identifier
* @return A List of Hive partition objects
*/
@@ -156,7 +156,7 @@ public class HivePartitionUtil {
/**
* Gets all partition names of the Hive table.
*
- * @param hiveClient Hive client from ArcticHiveCatalog
+ * @param hiveClient Hive client from MixedHiveCatalog
* @param tableIdentifier A table identifier
* @return A List of Hive partition names
*/
@@ -186,7 +186,7 @@ public class HivePartitionUtil {
/**
* Gets all partitions location of the Hive table.
*
- * @param hiveClient Hive client from ArcticHiveCatalog
+ * @param hiveClient Hive client from MixedHiveCatalog
* @param tableIdentifier A table identifier
* @return A List of Hive partition locations
*/
@@ -217,7 +217,7 @@ public class HivePartitionUtil {
/**
* Change the Hive partition location.
*
- * @param hiveClient Hive client from ArcticHiveCatalog
+ * @param hiveClient Hive client from MixedHiveCatalog
* @param tableIdentifier A table identifier
* @param partition A Hive partition name
* @param newPath Target partition location
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HiveTableUtil.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HiveTableUtil.java
index 1f99c4988..3923595e8 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HiveTableUtil.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/HiveTableUtil.java
@@ -140,7 +140,7 @@ public class HiveTableUtil {
/**
* Check whether the table is in Hive.
*
- * @param hiveClient Hive client from ArcticHiveCatalog
+ * @param hiveClient Hive client from MixedHiveCatalog
* @param tableIdentifier A table identifier
* @return If table is existed in hive
*/
@@ -163,7 +163,7 @@ public class HiveTableUtil {
/**
* Gets all the tables in a database.
*
- * @param hiveClient Hive client from ArcticHiveCatalog
+ * @param hiveClient Hive client from MixedHiveCatalog
* @param database Hive database
* @return A List of table-names from hive database
*/
@@ -181,7 +181,7 @@ public class HiveTableUtil {
/**
* Change the location of the Hive table.
*
- * @param hiveClient Hive client from ArcticHiveCatalog
+ * @param hiveClient Hive client from MixedHiveCatalog
* @param tableIdentifier A table identifier
*/
public static void alterTableLocation(
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/UpgradeHiveTableUtil.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/UpgradeHiveTableUtil.java
index 2982ccc03..c3190a8b7 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/UpgradeHiveTableUtil.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/amoro/hive/utils/UpgradeHiveTableUtil.java
@@ -25,7 +25,7 @@ import static
org.apache.amoro.table.TableProperties.FILE_FORMAT_ORC;
import static org.apache.amoro.table.TableProperties.FILE_FORMAT_PARQUET;
import org.apache.amoro.hive.HMSClientPool;
-import org.apache.amoro.hive.catalog.ArcticHiveCatalog;
+import org.apache.amoro.hive.catalog.MixedHiveCatalog;
import org.apache.amoro.hive.table.SupportHive;
import org.apache.amoro.hive.table.UnkeyedHiveTable;
import org.apache.amoro.io.AuthenticatedHadoopFileIO;
@@ -60,26 +60,26 @@ public class UpgradeHiveTableUtil {
private static final long DEFAULT_TXID = 0L;
/**
- * Upgrade a hive table to an Arctic table.
+ * Upgrade a hive table to an mixed-hive table.
*
- * @param arcticHiveCatalog A arctic catalog adapt hive
+ * @param mixedHiveCatalog A mixed-hive catalog
* @param tableIdentifier A table identifier
* @param pkList The name of the columns that needs to be set as the primary
key
* @param properties Properties to be added to the target table
*/
public static void upgradeHiveTable(
- ArcticHiveCatalog arcticHiveCatalog,
+ MixedHiveCatalog mixedHiveCatalog,
TableIdentifier tableIdentifier,
List<String> pkList,
Map<String, String> properties)
throws Exception {
- if (!formatCheck(arcticHiveCatalog.getHMSClient(), tableIdentifier,
properties)) {
+ if (!formatCheck(mixedHiveCatalog.getHMSClient(), tableIdentifier,
properties)) {
throw new IllegalArgumentException("The storage format is not support");
}
boolean upgradeHive = false;
try {
Table hiveTable =
- HiveTableUtil.loadHmsTable(arcticHiveCatalog.getHMSClient(),
tableIdentifier);
+ HiveTableUtil.loadHmsTable(mixedHiveCatalog.getHMSClient(),
tableIdentifier);
Schema schema =
HiveSchemaUtil.convertHiveSchemaToIcebergSchema(hiveTable, pkList);
@@ -92,7 +92,7 @@ public class UpgradeHiveTableUtil {
pkList.stream().forEach(p -> primaryKeyBuilder.addColumn(p));
MixedTable mixedTable =
- arcticHiveCatalog
+ mixedHiveCatalog
.newTableBuilder(tableIdentifier, schema)
.withProperties(properties)
.withPartitionSpec(partitionBuilder.build())
@@ -101,21 +101,23 @@ public class UpgradeHiveTableUtil {
.create();
upgradeHive = true;
UpgradeHiveTableUtil.hiveDataMigration(
- (SupportHive) mixedTable, arcticHiveCatalog, tableIdentifier);
+ (SupportHive) mixedTable, mixedHiveCatalog, tableIdentifier);
} catch (Throwable t) {
if (upgradeHive) {
- arcticHiveCatalog.dropTable(tableIdentifier, false);
+ mixedHiveCatalog.dropTable(tableIdentifier, false);
}
throw t;
}
}
private static void hiveDataMigration(
- SupportHive arcticTable, ArcticHiveCatalog arcticHiveCatalog,
TableIdentifier tableIdentifier)
+ SupportHive mixedHiveTable,
+ MixedHiveCatalog mixedHiveCatalog,
+ TableIdentifier tableIdentifier)
throws Exception {
- Table hiveTable =
HiveTableUtil.loadHmsTable(arcticHiveCatalog.getHMSClient(), tableIdentifier);
+ Table hiveTable =
HiveTableUtil.loadHmsTable(mixedHiveCatalog.getHMSClient(), tableIdentifier);
String hiveDataLocation =
HiveTableUtil.hiveRootLocation(hiveTable.getSd().getLocation());
- AuthenticatedHadoopFileIO io = arcticTable.io();
+ AuthenticatedHadoopFileIO io = mixedHiveTable.io();
io.makeDirectories(hiveDataLocation);
String newPath;
if (hiveTable.getPartitionKeys().isEmpty()) {
@@ -131,19 +133,18 @@ public class UpgradeHiveTableUtil {
try {
HiveTableUtil.alterTableLocation(
- arcticHiveCatalog.getHMSClient(), arcticTable.id(), newPath);
- LOG.info("Table {} alter hive table location {}", arcticTable.name(),
hiveDataLocation);
+ mixedHiveCatalog.getHMSClient(), mixedHiveTable.id(), newPath);
+ LOG.info("Table {} alter hive table location {}",
mixedHiveTable.name(), hiveDataLocation);
} catch (IOException e) {
- LOG.warn("Table {} alter hive table location failed",
arcticTable.name(), e);
+ LOG.warn("Table {} alter hive table location failed",
mixedHiveTable.name(), e);
throw new RuntimeException(e);
}
} else {
List<String> partitions =
- HivePartitionUtil.getHivePartitionNames(
- arcticHiveCatalog.getHMSClient(), tableIdentifier);
+
HivePartitionUtil.getHivePartitionNames(mixedHiveCatalog.getHMSClient(),
tableIdentifier);
List<String> partitionLocations =
HivePartitionUtil.getHivePartitionLocations(
- arcticHiveCatalog.getHMSClient(), tableIdentifier);
+ mixedHiveCatalog.getHMSClient(), tableIdentifier);
for (int i = 0; i < partitionLocations.size(); i++) {
String partition = partitions.get(i);
String oldLocation = partitionLocations.get(i);
@@ -163,18 +164,18 @@ public class UpgradeHiveTableUtil {
}
});
HivePartitionUtil.alterPartition(
- arcticHiveCatalog.getHMSClient(), tableIdentifier, partition,
newLocation);
+ mixedHiveCatalog.getHMSClient(), tableIdentifier, partition,
newLocation);
}
}
- HiveMetaSynchronizer.syncHiveDataToArctic(arcticTable,
arcticHiveCatalog.getHMSClient());
- hiveTable = HiveTableUtil.loadHmsTable(arcticHiveCatalog.getHMSClient(),
tableIdentifier);
- fillPartitionProperties(arcticTable, arcticHiveCatalog, hiveTable);
+ HiveMetaSynchronizer.syncHiveDataToMixedTable(mixedHiveTable,
mixedHiveCatalog.getHMSClient());
+ hiveTable = HiveTableUtil.loadHmsTable(mixedHiveCatalog.getHMSClient(),
tableIdentifier);
+ fillPartitionProperties(mixedHiveTable, mixedHiveCatalog, hiveTable);
}
/**
- * Check whether Arctic supports the hive table storage formats.
+ * Check whether the storage format is supported.
*
- * @param hiveClient Hive client from ArcticHiveCatalog
+ * @param hiveClient Hive client from MixedHiveClient
* @param tableIdentifier A table identifier
* @return Support or not
*/
@@ -235,7 +236,7 @@ public class UpgradeHiveTableUtil {
@VisibleForTesting
static void fillPartitionProperties(
- MixedTable table, ArcticHiveCatalog arcticHiveCatalog, Table hiveTable) {
+ MixedTable table, MixedHiveCatalog mixedHiveCatalog, Table hiveTable) {
UnkeyedHiveTable baseTable;
if (table.isKeyedTable()) {
baseTable = (UnkeyedHiveTable) table.asKeyedTable().baseTable();
@@ -257,7 +258,7 @@ public class UpgradeHiveTableUtil {
hiveTable.getParameters().get("transient_lastDdlTime"));
} else {
List<Partition> partitions =
-
HivePartitionUtil.getHiveAllPartitions(arcticHiveCatalog.getHMSClient(),
table.id());
+
HivePartitionUtil.getHiveAllPartitions(mixedHiveCatalog.getHMSClient(),
table.id());
partitions.forEach(
partition -> {
StructLike partitionData =
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/AdaptHiveGenericAppenderFactory.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/AdaptHiveGenericAppenderFactory.java
index 1e4384b79..3775bb618 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/AdaptHiveGenericAppenderFactory.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/AdaptHiveGenericAppenderFactory.java
@@ -96,7 +96,7 @@ public class AdaptHiveGenericAppenderFactory implements
FileAppenderFactory<Reco
.setAll(config)
.overwrite()
.build();
- // Change For Arctic ⬇
+ // Change for mixed-hive table ⬇
case PARQUET:
return AdaptHiveParquet.write(outputFile)
.schema(schema)
@@ -105,7 +105,7 @@ public class AdaptHiveGenericAppenderFactory implements
FileAppenderFactory<Reco
.metricsConfig(metricsConfig)
.overwrite()
.build();
- // Change For Arctic ⬆
+ // Change for mixed-hive table ⬆
case ORC:
return ORC.write(outputFile)
.schema(schema)
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/parquet/AdaptHiveBaseParquetReaders.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/parquet/AdaptHiveBaseParquetReaders.java
index daf53e77e..83a2521a7 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/parquet/AdaptHiveBaseParquetReaders.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/parquet/AdaptHiveBaseParquetReaders.java
@@ -295,13 +295,13 @@ public abstract class AdaptHiveBaseParquetReaders<T> {
case FIXED_LEN_BYTE_ARRAY:
return new FixedReader(desc);
case BINARY:
- // Change For Arctic ⬇
+ // Change for mixed-hive table ⬇
if (expected == Types.StringType.get()) {
return new ParquetValueReaders.StringReader(desc);
} else {
return new ParquetValueReaders.BytesReader(desc);
}
- // Change For Arctic ⬆
+ // Change for mixed-hive table ⬆
case INT32:
if (expected.typeId() == org.apache.iceberg.types.Type.TypeID.LONG) {
return new ParquetValueReaders.IntAsLongReader(desc);
@@ -318,7 +318,7 @@ public abstract class AdaptHiveBaseParquetReaders<T> {
case INT64:
case DOUBLE:
return new ParquetValueReaders.UnboxedReader<>(desc);
- // Change For Arctic ⬇
+ // Change for mixed-hive table ⬇
case INT96:
// Impala & Spark used to write timestamps as INT96 without a
logical type. For backwards
// compatibility we try to read INT96 as timestamps.
@@ -328,7 +328,7 @@ public abstract class AdaptHiveBaseParquetReaders<T> {
} else {
return new TimestampIntWithOutTZ96Reader(desc);
}
- // Change For Arctic ⬆
+ // Change for mixed-hive table ⬆
default:
throw new UnsupportedOperationException("Unsupported type: " +
primitive);
}
@@ -376,7 +376,7 @@ public abstract class AdaptHiveBaseParquetReaders<T> {
}
}
- // Change For Arctic ⬇
+ // Change for mixed-hive table ⬇
private static class TimestampIntWithOutTZ96Reader
extends ParquetValueReaders.PrimitiveReader<LocalDateTime> {
private static final long UNIX_EPOCH_JULIAN = 2_440_588L;
@@ -419,7 +419,7 @@ public abstract class AdaptHiveBaseParquetReaders<T> {
.atOffset(ZoneOffset.UTC);
}
}
- // Change For Arctic ⬆
+ // Change for mixed-hive table ⬆
private static class TimestamptzReader
extends ParquetValueReaders.PrimitiveReader<OffsetDateTime> {
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/parquet/AdaptHiveBaseParquetWriter.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/parquet/AdaptHiveBaseParquetWriter.java
index 990bd9eea..518e2c2ff 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/parquet/AdaptHiveBaseParquetWriter.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/data/parquet/AdaptHiveBaseParquetWriter.java
@@ -150,10 +150,10 @@ public abstract class AdaptHiveBaseParquetWriter<T> {
return ParquetValueWriters.floats(desc);
case DOUBLE:
return ParquetValueWriters.doubles(desc);
- // Change For Arctic ⬇
+ // Change for mixed-hive table ⬇
case INT96:
return new TimestampInt96Writer(desc);
- // Change For Arctic ⬆
+ // Change for mixed-hive table ⬆
default:
throw new UnsupportedOperationException("Unsupported type: " +
primitive);
}
@@ -314,7 +314,7 @@ public abstract class AdaptHiveBaseParquetWriter<T> {
}
}
- // Change For Arctic ⬇
+ // Change for mixed-hive table ⬇
private static class TimestampInt96Writer<T> extends
AdaptHivePrimitiveWriter<T> {
private static final long JULIAN_DAY_OF_EPOCH = 2440588L;
@@ -380,5 +380,5 @@ public abstract class AdaptHiveBaseParquetWriter<T> {
}
}
}
- // Change For Arctic ⬆
+ // Change for mixed-hive table ⬆
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveColumnWriter.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveColumnWriter.java
index 06e5d4634..773520b01 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveColumnWriter.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveColumnWriter.java
@@ -50,7 +50,7 @@ public abstract class AdaptHiveColumnWriter<T> implements
TripleWriter<T> {
writeLong(rl, value);
}
};
- // Change For Arctic
+ // Change for mixed-hive table ⬇
case INT96:
return (AdaptHiveColumnWriter<T>)
new AdaptHiveColumnWriter<Binary>(desc) {
@@ -59,7 +59,7 @@ public abstract class AdaptHiveColumnWriter<T> implements
TripleWriter<T> {
writeBinary(rl, value);
}
};
- // Change For Arctic
+ // Change for mixed-hive table ⬆
case FLOAT:
return (AdaptHiveColumnWriter<T>)
new AdaptHiveColumnWriter<Float>(desc) {
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquet.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquet.java
index ef3be00d6..b36bd8375 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquet.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquet.java
@@ -270,7 +270,7 @@ public class AdaptHiveParquet {
.withDictionaryPageSize(dictionaryPageSize)
.build();
- // Change For Arctic
+ // Change for mixed-hive table ⬇
return new org.apache.iceberg.parquet.AdaptHiveParquetWriter<>(
conf,
file,
@@ -282,7 +282,7 @@ public class AdaptHiveParquet {
parquetProperties,
metricsConfig,
writeMode);
- // Change For Arctic
+ // Change for mixed-hive table ⬆
} else {
return new ParquetWriteAdapter<>(
new ParquetWriteBuilder<D>(ParquetIO.file(file))
@@ -878,7 +878,7 @@ public class AdaptHiveParquet {
caseSensitive,
maxRecordsPerBatch);
} else {
- // Change For Arctic
+ // Change for mixed-hive table ⬇
return new AdaptHiveParquetReader<>(
file,
schema,
@@ -888,7 +888,7 @@ public class AdaptHiveParquet {
filter,
reuseContainers,
caseSensitive);
- // Change For Arctic
+ // Change for mixed-hive table ⬆
}
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetConversions.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetConversions.java
index aee96a020..bf6b9d711 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetConversions.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetConversions.java
@@ -57,10 +57,11 @@ class AdaptHiveParquetConversions {
case LONG:
case TIME:
case TIMESTAMP:
- // Change For Arctic: Add metrics for int96 type
+ // Change for mixed-hive table ⬇
+ // Add metrics for int96 type
Function<Object, Object> timeConversion =
converterFromParquet(parquetType, type);
return (Literal<T>) Literal.of((Long) timeConversion.apply(value));
- // Change For Arctic
+ // Change for mixed-hive table ⬇
case FLOAT:
return (Literal<T>) Literal.of((Float) value);
case DOUBLE:
@@ -86,8 +87,8 @@ class AdaptHiveParquetConversions {
static Function<Object, Object> converterFromParquet(
PrimitiveType parquetType, Type icebergType) {
- // Change For Arctic:Adapt int 96 and bytes string
- // int96
+ // Change for mixed-hive table ⬇
+ // Adapt int 96 and bytes string
if (parquetType.getPrimitiveTypeName() ==
PrimitiveType.PrimitiveTypeName.INT96) {
return binary -> {
final ByteBuffer byteBuffer =
@@ -114,7 +115,7 @@ class AdaptHiveParquetConversions {
&& parquetType.getPrimitiveTypeName() ==
PrimitiveType.PrimitiveTypeName.BINARY) {
return binary -> StandardCharsets.UTF_8.decode(((Binary)
binary).toByteBuffer());
}
- // Change For Arctic
+ // Change for mixed-hive table ⬆
Function<Object, Object> fromParquet = converterFromParquet(parquetType);
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetDictionaryRowGroupFilter.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetDictionaryRowGroupFilter.java
index f21a27d0f..51efa3a05 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetDictionaryRowGroupFilter.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetDictionaryRowGroupFilter.java
@@ -108,10 +108,10 @@ public class AdaptHiveParquetDictionaryRowGroupFilter {
int id = colType.getId().intValue();
Type icebergType = schema.findType(id);
cols.put(id, desc);
- // Change For Arctic
+ // Change for mixed-hive table ⬇
conversions.put(
id, AdaptHiveParquetConversions.converterFromParquet(colType,
icebergType));
- // Change For Arctic:
+ // Change for mixed-hive table ⬆
}
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetMetricsRowGroupFilter.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetMetricsRowGroupFilter.java
index 1922bcc43..21a7ba726 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetMetricsRowGroupFilter.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetMetricsRowGroupFilter.java
@@ -101,10 +101,10 @@ public class AdaptHiveParquetMetricsRowGroupFilter {
Type icebergType = schema.findType(id);
stats.put(id, col.getStatistics());
valueCounts.put(id, col.getValueCount());
- // Change For Arctic
+ // Change for mixed-hive table ⬇
conversions.put(
id, AdaptHiveParquetConversions.converterFromParquet(colType,
icebergType));
- // Change For Arctic
+ // Change for mixed-hive table ⬆
}
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetReader.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetReader.java
index 6b233e8b0..f1dd2da9d 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetReader.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetReader.java
@@ -73,7 +73,7 @@ public class AdaptHiveParquetReader<T> extends CloseableGroup
implements Closeab
private AdaptHiveReadConf<T> init() {
if (conf == null) {
- // Change For Arctic
+ // Change for mixed-hive table ⬇
AdaptHiveReadConf<T> adaptHiveReadConf =
new AdaptHiveReadConf<>(
input,
@@ -86,7 +86,7 @@ public class AdaptHiveParquetReader<T> extends CloseableGroup
implements Closeab
reuseContainers,
caseSensitive,
null);
- // Change For Arctic
+ // Change for mixed-hive table ⬆
this.conf = adaptHiveReadConf.copy();
return adaptHiveReadConf;
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetSchemaUtil.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetSchemaUtil.java
index f8f6681f0..99ac1f5e0 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetSchemaUtil.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetSchemaUtil.java
@@ -37,8 +37,9 @@ public class AdaptHiveParquetSchemaUtil {
private AdaptHiveParquetSchemaUtil() {}
public static MessageType convert(Schema schema, String name) {
- // Change For Arctic
+ // Change for mixed-hive table ⬇
return new AdaptHiveTypeToMessageType().convert(schema, name);
+ // Change for mixed-hive table ⬆
}
/**
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetUtil.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetUtil.java
index bdcf40276..c9142351f 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetUtil.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetUtil.java
@@ -121,7 +121,8 @@ public class AdaptHiveParquetUtil {
if (metricsMode != MetricsModes.Counts.get() &&
!fieldMetricsMap.containsKey(fieldId)) {
Types.NestedField field = fileSchema.findField(fieldId);
if (field != null && stats.hasNonNullValue() &&
shouldStoreBounds(column, fileSchema)) {
- // Change For Arctic: Add metrics for int96 type
+ // Change for mixed-hive table ⬇
+ // Add metrics for int96 type
Literal<?> min =
AdaptHiveParquetConversions.fromParquetPrimitive(
field.type(), column.getPrimitiveType(),
stats.genericGetMin());
@@ -130,7 +131,7 @@ public class AdaptHiveParquetUtil {
AdaptHiveParquetConversions.fromParquetPrimitive(
field.type(), column.getPrimitiveType(),
stats.genericGetMax());
updateMax(upperBounds, fieldId, field.type(), max, metricsMode);
- // Change For Arctic
+ // Change for mixed-hive table ⬆
}
}
}
@@ -227,9 +228,7 @@ public class AdaptHiveParquetUtil {
// we allow struct nesting, but not maps or arrays
private static boolean shouldStoreBounds(ColumnChunkMetaData column, Schema
schema) {
- // Change For Arctic: Add metrics for int96 type
- // Delete int96 don't need metric logic.
- // Change For Arctic
+ // Add metrics for int96 type
ColumnPath columnPath = column.getPath();
Iterator<String> pathIterator = columnPath.iterator();
Type currentType = schema.asStruct();
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetWriter.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetWriter.java
index 54f1dd0a5..8fbc116f3 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetWriter.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveParquetWriter.java
@@ -100,10 +100,10 @@ class AdaptHiveParquetWriter<T> implements
FileAppender<T>, Closeable {
this.props = properties;
this.metadata = ImmutableMap.copyOf(metadata);
this.compressor = new CodecFactory(conf,
props.getPageSizeThreshold()).getCompressor(codec);
- // Change For Arctic
+ // Change for mixed-hive table ⬇
this.parquetSchema = AdaptHiveParquetSchemaUtil.convert(schema, "table");
this.schema = schema;
- // Change For Arctic
+ // Change for mixed-hive table ⬆
this.model = (ParquetValueWriter<T>) createWriterFunc.apply(parquetSchema);
this.metricsConfig = metricsConfig;
this.columnIndexTruncateLength =
@@ -136,9 +136,11 @@ class AdaptHiveParquetWriter<T> implements
FileAppender<T>, Closeable {
@Override
public Metrics metrics() {
- // Change For Arctic: Add metrics for int96 type
+ // Change for mixed-hive table ⬇
+ // Add metrics for int96 type
return AdaptHiveParquetUtil.footerMetrics(
writer.getFooter(), model.metrics(), metricsConfig, schema);
+ // Change for mixed-hive table ⬆
}
/**
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHivePrimitiveWriter.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHivePrimitiveWriter.java
index adf5ea990..3d6402a68 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHivePrimitiveWriter.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHivePrimitiveWriter.java
@@ -31,9 +31,9 @@ public class AdaptHivePrimitiveWriter<T> implements
ParquetValueWriter<T> {
private final List<TripleWriter<?>> children;
protected AdaptHivePrimitiveWriter(ColumnDescriptor desc) {
- // Change For Arctic
+ // Change for mixed-hive table ⬇
this.column = AdaptHiveColumnWriter.newWriter(desc);
- // Change For Arctic
+ // Change for mixed-hive table ⬆
this.children = ImmutableList.of(column);
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveReadConf.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveReadConf.java
index 0e71a2d26..f90db915a 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveReadConf.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveReadConf.java
@@ -101,7 +101,8 @@ class AdaptHiveReadConf<T> {
// Fetch all row groups starting positions to compute the row offsets of
the filtered row groups
Map<Long, Long> offsetToStartPos =
generateOffsetToStartPos(expectedSchema);
- // Change For Arctic: use arctic filter
+ // Change for mixed-hive table ⬇
+ // Use mixed-hive format filter
AdaptHiveParquetMetricsRowGroupFilter statsFilter = null;
AdaptHiveParquetDictionaryRowGroupFilter dictFilter = null;
if (filter != null) {
@@ -110,7 +111,7 @@ class AdaptHiveReadConf<T> {
dictFilter =
new AdaptHiveParquetDictionaryRowGroupFilter(expectedSchema, filter,
caseSensitive);
}
- // Change For Arctic
+ // Change for mixed-hive table ⬆
long computedTotalValues = 0L;
for (int i = 0; i < shouldSkip.length; i += 1) {
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveTypeToMessageType.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveTypeToMessageType.java
index 0de6fa481..161a738c5 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveTypeToMessageType.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/main/java/org/apache/iceberg/parquet/AdaptHiveTypeToMessageType.java
@@ -138,10 +138,10 @@ public class AdaptHiveTypeToMessageType {
return Types.primitive(INT32, repetition).as(DATE).id(id).named(name);
case TIME:
return Types.primitive(INT64,
repetition).as(TIME_MICROS).id(id).named(name);
- // Change For Arctic
+ // Change for mixed-hive table ⬇
case TIMESTAMP:
return Types.primitive(INT96, repetition).id(id).named(name);
- // Change For Arctic
+ // Change for mixed-hive table ⬆
case STRING:
return Types.primitive(BINARY,
repetition).as(STRING).id(id).named(name);
case BINARY:
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/catalog/TestHiveCatalogLoader.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/catalog/TestHiveCatalogLoader.java
index 47723cc53..a43749973 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/catalog/TestHiveCatalogLoader.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/catalog/TestHiveCatalogLoader.java
@@ -50,7 +50,7 @@ public class TestHiveCatalogLoader {
TEST_AMS.getAmsHandler().createCatalog(catalogMeta);
MixedFormatCatalog loadCatalog =
CatalogLoader.load(getCatalogUrl(TEST_CATALOG_NAME));
Assert.assertEquals(TEST_CATALOG_NAME, loadCatalog.name());
- Assert.assertTrue(loadCatalog instanceof ArcticHiveCatalog);
+ Assert.assertTrue(loadCatalog instanceof MixedHiveCatalog);
TEST_AMS.getAmsHandler().dropCatalog(TEST_CATALOG_NAME);
}
@@ -63,7 +63,7 @@ public class TestHiveCatalogLoader {
TEST_AMS.getAmsHandler().createCatalog(catalogMeta);
MixedFormatCatalog loadCatalog =
CatalogLoader.load(getCatalogUrl(TEST_CATALOG_NAME));
Assert.assertEquals(TEST_CATALOG_NAME, loadCatalog.name());
- Assert.assertTrue(loadCatalog instanceof ArcticHiveCatalog);
+ Assert.assertTrue(loadCatalog instanceof MixedHiveCatalog);
TEST_AMS.getAmsHandler().dropCatalog(TEST_CATALOG_NAME);
}
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/catalog/TestMixedHiveCatalog.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/catalog/TestMixedHiveCatalog.java
index 2734dcb89..25213485a 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/catalog/TestMixedHiveCatalog.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/catalog/TestMixedHiveCatalog.java
@@ -51,7 +51,7 @@ public class TestMixedHiveCatalog extends TestMixedCatalog {
@Override
protected String expectCatalogImpl() {
- return ArcticHiveCatalog.class.getName();
+ return MixedHiveCatalog.class.getName();
}
@Override
@@ -59,7 +59,7 @@ public class TestMixedHiveCatalog extends TestMixedCatalog {
return IDENTIFY_SPEC;
}
- private void validateTableArcticProperties(TableIdentifier tableIdentifier)
throws TException {
+ private void validateMixedHiveTableProperties(TableIdentifier
tableIdentifier) throws TException {
String dbName = tableIdentifier.getDatabase();
String tbl = tableIdentifier.getTableName();
Map<String, String> tableParameter =
@@ -73,7 +73,7 @@ public class TestMixedHiveCatalog extends TestMixedCatalog {
@Override
protected void validateCreatedTable(MixedTable table, boolean withKey)
throws TException {
super.validateCreatedTable(table, withKey);
- validateTableArcticProperties(table.id());
+ validateMixedHiveTableProperties(table.id());
}
@Override
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/io/TestImpalaParquet.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/io/TestImpalaParquet.java
index ea32a01ce..d0997b827 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/io/TestImpalaParquet.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/io/TestImpalaParquet.java
@@ -37,7 +37,7 @@ import java.util.HashMap;
/**
* Impala may write string type column with binary value in parquet file,
which is okay for Hive
- * readers, Arctic need to support it too for mixed-hive format tables.
+ * readers, We need to support it too for mixed-hive format tables.
*/
public class TestImpalaParquet {
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/utils/TestHiveMetaSynchronizer.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/utils/TestHiveMetaSynchronizer.java
index 8ab88e9a1..1df8ce857 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/utils/TestHiveMetaSynchronizer.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/utils/TestHiveMetaSynchronizer.java
@@ -106,7 +106,7 @@ public class TestHiveMetaSynchronizer extends TableTestBase
{
});
Assert.assertNotEquals(newLocation, hiveLocation);
- HiveMetaSynchronizer.syncArcticDataToHive(getMixedTable());
+ HiveMetaSynchronizer.syncMixedTableDataToHive(getMixedTable());
hiveLocation =
(getMixedTable())
.getHMSClient()
@@ -141,7 +141,7 @@ public class TestHiveMetaSynchronizer extends TableTestBase
{
return hiveTable.getSd().getLocation();
});
- HiveMetaSynchronizer.syncArcticDataToHive(getMixedTable());
+ HiveMetaSynchronizer.syncMixedTableDataToHive(getMixedTable());
String newHiveLocation =
getMixedTable()
.getHMSClient()
@@ -189,7 +189,7 @@ public class TestHiveMetaSynchronizer extends TableTestBase
{
getMixedTable().id().getTableName(),
partitionValues)));
- HiveMetaSynchronizer.syncArcticDataToHive(getMixedTable());
+ HiveMetaSynchronizer.syncMixedTableDataToHive(getMixedTable());
Partition hivePartition =
getMixedTable()
.getHMSClient()
@@ -203,7 +203,7 @@ public class TestHiveMetaSynchronizer extends TableTestBase
{
}
@Test
- public void testSyncOnlyInHiveCreateByArctic() throws Exception {
+ public void testSyncOnlyInHiveCreateByMixedHiveTable() throws Exception {
Assume.assumeTrue(isPartitionedTable());
UnkeyedTable baseTable =
isKeyedTable()
@@ -262,7 +262,7 @@ public class TestHiveMetaSynchronizer extends TableTestBase
{
partitionValues));
Assert.assertEquals(partitionLocation,
hivePartition.getSd().getLocation());
- HiveMetaSynchronizer.syncArcticDataToHive(getMixedTable());
+ HiveMetaSynchronizer.syncMixedTableDataToHive(getMixedTable());
Assert.assertThrows(
NoSuchObjectException.class,
@@ -278,7 +278,7 @@ public class TestHiveMetaSynchronizer extends TableTestBase
{
}
@Test
- public void testSyncOnlyInHiveCreateNotByArctic() throws Exception {
+ public void testSyncOnlyInHiveCreateNotByMixedHiveTable() throws Exception {
Assume.assumeTrue(isPartitionedTable());
UnkeyedTable baseTable =
isKeyedTable()
@@ -336,7 +336,7 @@ public class TestHiveMetaSynchronizer extends TableTestBase
{
partitionValues));
Assert.assertEquals(partitionLocation,
hivePartition.getSd().getLocation());
- HiveMetaSynchronizer.syncArcticDataToHive(getMixedTable());
+ HiveMetaSynchronizer.syncMixedTableDataToHive(getMixedTable());
hivePartition =
getMixedTable()
@@ -420,7 +420,7 @@ public class TestHiveMetaSynchronizer extends TableTestBase
{
.commit();
Assert.assertNotEquals(newPartitionLocation,
hivePartition.getSd().getLocation());
- HiveMetaSynchronizer.syncArcticDataToHive(getMixedTable());
+ HiveMetaSynchronizer.syncMixedTableDataToHive(getMixedTable());
hivePartition =
getMixedTable()
diff --git
a/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/utils/TestUpgradeHiveTableUtil.java
b/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/utils/TestUpgradeHiveTableUtil.java
index 83ab02737..cb222c0c6 100644
---
a/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/utils/TestUpgradeHiveTableUtil.java
+++
b/amoro-mixed-format/amoro-mixed-format-hive/src/test/java/org/apache/amoro/hive/utils/TestUpgradeHiveTableUtil.java
@@ -22,9 +22,9 @@ import org.apache.amoro.TableFormat;
import org.apache.amoro.catalog.CatalogTestBase;
import org.apache.amoro.catalog.CatalogTestHelper;
import org.apache.amoro.hive.TestHMS;
-import org.apache.amoro.hive.catalog.ArcticHiveCatalog;
import org.apache.amoro.hive.catalog.HiveCatalogTestHelper;
import org.apache.amoro.hive.catalog.HiveTableTestHelper;
+import org.apache.amoro.hive.catalog.MixedHiveCatalog;
import org.apache.amoro.hive.table.UnkeyedHiveTable;
import org.apache.amoro.properties.HiveTableProperties;
import org.apache.amoro.table.MixedTable;
@@ -135,10 +135,7 @@ public class TestUpgradeHiveTableUtil extends
CatalogTestBase {
@Test
public void upgradeHiveTable() throws Exception {
UpgradeHiveTableUtil.upgradeHiveTable(
- (ArcticHiveCatalog) getMixedFormatCatalog(),
- identifier,
- new ArrayList<>(),
- new HashMap<>());
+ (MixedHiveCatalog) getMixedFormatCatalog(), identifier, new
ArrayList<>(), new HashMap<>());
MixedTable table = getMixedFormatCatalog().loadTable(identifier);
UnkeyedHiveTable baseTable =
table.isKeyedTable()
@@ -147,7 +144,7 @@ public class TestUpgradeHiveTableUtil extends
CatalogTestBase {
if (table.spec().isPartitioned()) {
List<Partition> partitions =
HivePartitionUtil.getHiveAllPartitions(
- ((ArcticHiveCatalog) getMixedFormatCatalog()).getHMSClient(),
table.id());
+ ((MixedHiveCatalog) getMixedFormatCatalog()).getHMSClient(),
table.id());
for (Partition partition : partitions) {
StructLike partitionData =
HivePartitionUtil.buildPartitionData(partition.getValues(),
table.spec());
diff --git
a/amoro-mixed-format/amoro-mixed-format-spark/v3.2/amoro-mixed-format-spark-3.2/src/main/java/org/apache/amoro/spark/ArcticSparkCatalog.java
b/amoro-mixed-format/amoro-mixed-format-spark/v3.2/amoro-mixed-format-spark-3.2/src/main/java/org/apache/amoro/spark/ArcticSparkCatalog.java
index fe564ebed..f7c3965db 100644
---
a/amoro-mixed-format/amoro-mixed-format-spark/v3.2/amoro-mixed-format-spark-3.2/src/main/java/org/apache/amoro/spark/ArcticSparkCatalog.java
+++
b/amoro-mixed-format/amoro-mixed-format-spark/v3.2/amoro-mixed-format-spark-3.2/src/main/java/org/apache/amoro/spark/ArcticSparkCatalog.java
@@ -137,7 +137,7 @@ public class ArcticSparkCatalog extends
MixedSparkCatalogBase {
Schema convertSchema;
boolean useTimestampWithoutZoneInNewTables;
SparkSession sparkSession = SparkSession.active();
- if (CatalogUtil.isHiveCatalog(catalog)) {
+ if (CatalogUtil.isMixedHiveCatalog(catalog)) {
useTimestampWithoutZoneInNewTables = true;
} else {
useTimestampWithoutZoneInNewTables =
diff --git
a/amoro-mixed-format/amoro-mixed-format-spark/v3.3/amoro-mixed-format-spark-3.3/src/main/java/org/apache/amoro/spark/ArcticSparkCatalog.java
b/amoro-mixed-format/amoro-mixed-format-spark/v3.3/amoro-mixed-format-spark-3.3/src/main/java/org/apache/amoro/spark/ArcticSparkCatalog.java
index 8b8ee714a..2655e5e97 100644
---
a/amoro-mixed-format/amoro-mixed-format-spark/v3.3/amoro-mixed-format-spark-3.3/src/main/java/org/apache/amoro/spark/ArcticSparkCatalog.java
+++
b/amoro-mixed-format/amoro-mixed-format-spark/v3.3/amoro-mixed-format-spark-3.3/src/main/java/org/apache/amoro/spark/ArcticSparkCatalog.java
@@ -139,7 +139,7 @@ public class ArcticSparkCatalog extends
MixedSparkCatalogBase {
Schema convertSchema;
boolean useTimestampWithoutZoneInNewTables;
SparkSession sparkSession = SparkSession.active();
- if (CatalogUtil.isHiveCatalog(catalog)) {
+ if (CatalogUtil.isMixedHiveCatalog(catalog)) {
useTimestampWithoutZoneInNewTables = true;
} else {
useTimestampWithoutZoneInNewTables =
diff --git
a/amoro-mixed-format/amoro-mixed-format-trino/src/test/java/org/apache/amoro/trino/mixed/TestHiveTableBaseForTrino.java
b/amoro-mixed-format/amoro-mixed-format-trino/src/test/java/org/apache/amoro/trino/mixed/TestHiveTableBaseForTrino.java
index 40eb16637..da8d855b5 100644
---
a/amoro-mixed-format/amoro-mixed-format-trino/src/test/java/org/apache/amoro/trino/mixed/TestHiveTableBaseForTrino.java
+++
b/amoro-mixed-format/amoro-mixed-format-trino/src/test/java/org/apache/amoro/trino/mixed/TestHiveTableBaseForTrino.java
@@ -27,7 +27,7 @@ import org.apache.amoro.table.TableIdentifier;
import org.apache.amoro.table.TableProperties;
import io.trino.testng.services.ManageTestResources;
import org.apache.amoro.hive.HMSMockServer;
-import org.apache.amoro.hive.catalog.ArcticHiveCatalog;
+import org.apache.amoro.hive.catalog.MixedHiveCatalog;
import org.apache.amoro.hive.catalog.HiveCatalogTestHelper;
import org.apache.amoro.hive.table.KeyedHiveTable;
import org.apache.amoro.hive.table.UnkeyedHiveTable;
@@ -109,7 +109,7 @@ public abstract class TestHiveTableBaseForTrino extends
TableTestBaseForTrino {
protected static final PartitionSpec HIVE_SPEC =
PartitionSpec.builderFor(HIVE_TABLE_SCHEMA).identity(COLUMN_NAME_NAME).build();
- protected ArcticHiveCatalog hiveCatalog;
+ protected MixedHiveCatalog hiveCatalog;
protected UnkeyedHiveTable testHiveTable;
protected KeyedHiveTable testKeyedHiveTable;
@@ -141,7 +141,7 @@ public abstract class TestHiveTableBaseForTrino extends
TableTestBaseForTrino {
}
protected void setupTables() throws Exception {
- hiveCatalog = (ArcticHiveCatalog)
CatalogLoader.load(AMS.getUrl(TEST_CATALOG_NAME));
+ hiveCatalog = (MixedHiveCatalog)
CatalogLoader.load(AMS.getUrl(TEST_CATALOG_NAME));
testHiveTable =
(UnkeyedHiveTable)