You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by st...@apache.org on 2020/11/23 02:52:43 UTC

[impala] 02/03: IMPALA-10152: Add support for Iceberg HiveCatalog

This is an automated email from the ASF dual-hosted git repository.

stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 4448b8755b9b55dae08dbe74a9b8dd6fdebc47c4
Author: Zoltan Borok-Nagy <bo...@cloudera.com>
AuthorDate: Thu Oct 22 17:01:03 2020 +0200

    IMPALA-10152: Add support for Iceberg HiveCatalog
    
    HiveCatalog is one of Iceberg's catalog implementations. It uses
    the Hive metastore and it is the recommended catalog implementation
    when the table data is stored in object stores like S3.
    
    This commit updates the Iceberg version to a newer one, and it also
    retrieves Iceberg from the CDP distribution because that version of
    Iceberg is built against Hive 3 (Impala is only compatible with
    Hive 3).
    
    This commit makes HiveCatalog the default Iceberg catalog in Impala
    because it can be used in more environments (e.g. cloud stores),
    and it is more featureful. Also, other engines that store their
    table metadata in HMS will probably use HiveCatalog as well.
    
    Tables stored in HiveCatalog are similar to Kudu tables with HMS
    integration, i.e. modifying an Iceberg table via the Iceberg APIs
    also modifies the HMS table. So in CatalogOpExecutor we handle
    such Iceberg tables similarly to integrated Kudu tables.
    
    Testing:
     * Added e2e tests for creating, writing, and altering Iceberg
       tables
     * Added SHOW CREATE TABLE tests
    
    Change-Id: Ie574589a1751aaa9ccbd34a89c6819714d103197
    Reviewed-on: http://gerrit.cloudera.org:8080/16721
    Reviewed-by: wangsheng <sk...@163.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 bin/impala-config.sh                               |  25 ++--
 common/thrift/CatalogObjects.thrift                |   1 +
 fe/pom.xml                                         |   2 +-
 .../analysis/AlterTableSetTblProperties.java       |   1 +
 .../apache/impala/analysis/CreateTableStmt.java    |  75 +++++++++---
 .../org/apache/impala/analysis/ToSqlUtils.java     |   3 +
 .../org/apache/impala/catalog/IcebergTable.java    |   4 +
 .../impala/catalog/iceberg/IcebergHiveCatalog.java | 101 ++++++++++++++++
 .../apache/impala/service/CatalogOpExecutor.java   | 121 +++++++++++++-------
 .../impala/service/IcebergCatalogOpExecutor.java   |   3 +-
 .../java/org/apache/impala/util/IcebergUtil.java   |  15 ++-
 .../queries/QueryTest/iceberg-alter.test           |  17 +++
 .../queries/QueryTest/iceberg-create.test          |  47 +++++++-
 .../queries/QueryTest/iceberg-insert.test          | 127 ++++++++++++++++++++-
 .../queries/QueryTest/iceberg-negative.test        |  67 ++++++++++-
 .../queries/QueryTest/show-create-table.test       |  50 ++++++++
 16 files changed, 572 insertions(+), 87 deletions(-)

diff --git a/bin/impala-config.sh b/bin/impala-config.sh
index e7adfdc..d727982 100755
--- a/bin/impala-config.sh
+++ b/bin/impala-config.sh
@@ -176,25 +176,25 @@ export IMPALA_TOOLCHAIN_HOST
 # and adjust existing tests that mentions them:
 # * HIVE-23995
 # * HIVE-24175
-export CDP_BUILD_NUMBER=6912987
+export CDP_BUILD_NUMBER=7049391
 export CDP_MAVEN_REPOSITORY=\
 "https://${IMPALA_TOOLCHAIN_HOST}/build/cdp_components/${CDP_BUILD_NUMBER}/maven"
-export CDP_AVRO_JAVA_VERSION=1.8.2.7.2.7.0-30
-export CDP_HADOOP_VERSION=3.1.1.7.2.7.0-30
-export CDP_HBASE_VERSION=2.2.6.7.2.7.0-30
-export CDP_HIVE_VERSION=3.1.3000.7.2.7.0-30
-export CDP_KNOX_VERSION=1.3.0.7.2.7.0-30
-export CDP_OZONE_VERSION=1.0.0.7.2.7.0-30
-export CDP_PARQUET_VERSION=1.10.99.7.2.7.0-30
-export CDP_RANGER_VERSION=2.1.0.7.2.7.0-30
-export CDP_TEZ_VERSION=0.9.1.7.2.7.0-30
+export CDP_AVRO_JAVA_VERSION=1.8.2.7.2.7.0-44
+export CDP_HADOOP_VERSION=3.1.1.7.2.7.0-44
+export CDP_HBASE_VERSION=2.2.6.7.2.7.0-44
+export CDP_HIVE_VERSION=3.1.3000.7.2.7.0-44
+export CDP_ICEBERG_VERSION=0.9.1.7.2.7.0-44
+export CDP_KNOX_VERSION=1.3.0.7.2.7.0-44
+export CDP_OZONE_VERSION=1.0.0.7.2.7.0-44
+export CDP_PARQUET_VERSION=1.10.99.7.2.7.0-44
+export CDP_RANGER_VERSION=2.1.0.7.2.7.0-44
+export CDP_TEZ_VERSION=0.9.1.7.2.7.0-44
 
 export ARCH_NAME=$(uname -p)
 
 export IMPALA_HUDI_VERSION=0.5.0-incubating
 export IMPALA_KITE_VERSION=1.1.0
 export IMPALA_ORC_JAVA_VERSION=1.6.2
-export IMPALA_ICEBERG_VERSION=0.8.0-incubating
 
 # When IMPALA_(CDP_COMPONENT)_URL are overridden, they may contain '$(platform_label)'
 # which will be substituted for the CDP platform label in bootstrap_toolchain.py
@@ -227,6 +227,7 @@ export CDP_HADOOP_URL=${CDP_HADOOP_URL-}
 export CDP_HBASE_URL=${CDP_HBASE_URL-}
 export CDP_HIVE_URL=${CDP_HIVE_URL-}
 export CDP_HIVE_SOURCE_URL=${CDP_HIVE_SOURCE_URL-}
+export CDP_ICEBERG_URL=${CDP_ICEBERG_URL-}
 export CDP_RANGER_URL=${CDP_RANGER_URL-}
 export CDP_TEZ_URL=${CDP_TEZ_URL-}
 
@@ -241,6 +242,8 @@ export IMPALA_HBASE_URL=${CDP_HBASE_URL-}
 export IMPALA_HIVE_VERSION=${CDP_HIVE_VERSION}
 export IMPALA_HIVE_URL=${CDP_HIVE_URL-}
 export IMPALA_HIVE_SOURCE_URL=${CDP_HIVE_SOURCE_URL-}
+export IMPALA_ICEBERG_VERSION=${CDP_ICEBERG_VERSION}
+export IMPALA_ICEBERG_URL=${CDP_ICEBERG_URL-}
 export IMPALA_KNOX_VERSION=${CDP_KNOX_VERSION}
 export IMPALA_OZONE_VERSION=${CDP_OZONE_VERSION}
 export IMPALA_PARQUET_VERSION=${CDP_PARQUET_VERSION}
diff --git a/common/thrift/CatalogObjects.thrift b/common/thrift/CatalogObjects.thrift
index c1a5d15..b335992 100644
--- a/common/thrift/CatalogObjects.thrift
+++ b/common/thrift/CatalogObjects.thrift
@@ -97,6 +97,7 @@ enum TIcebergFileFormat {
 enum TIcebergCatalog {
   HADOOP_TABLES = 0
   HADOOP_CATALOG = 1
+  HIVE_CATALOG = 2
 }
 
 enum TColumnEncoding {
diff --git a/fe/pom.xml b/fe/pom.xml
index 9bb7c7b..af7ddbb 100644
--- a/fe/pom.xml
+++ b/fe/pom.xml
@@ -368,7 +368,7 @@ under the License.
 
     <dependency>
       <groupId>org.apache.iceberg</groupId>
-      <artifactId>iceberg-core</artifactId>
+      <artifactId>iceberg-hive-runtime</artifactId>
       <version>${iceberg.version}</version>
     </dependency>
 
diff --git a/fe/src/main/java/org/apache/impala/analysis/AlterTableSetTblProperties.java b/fe/src/main/java/org/apache/impala/analysis/AlterTableSetTblProperties.java
index 634c65b..b934b88 100644
--- a/fe/src/main/java/org/apache/impala/analysis/AlterTableSetTblProperties.java
+++ b/fe/src/main/java/org/apache/impala/analysis/AlterTableSetTblProperties.java
@@ -151,6 +151,7 @@ public class AlterTableSetTblProperties extends AlterTableSetStmt {
     icebergPropertyCheck(IcebergTable.ICEBERG_CATALOG);
     icebergPropertyCheck(IcebergTable.ICEBERG_CATALOG_LOCATION);
     icebergPropertyCheck(IcebergTable.ICEBERG_TABLE_IDENTIFIER);
+    icebergPropertyCheck(IcebergTable.METADATA_LOCATION);
   }
 
   private void icebergPropertyCheck(String property) throws AnalysisException {
diff --git a/fe/src/main/java/org/apache/impala/analysis/CreateTableStmt.java b/fe/src/main/java/org/apache/impala/analysis/CreateTableStmt.java
index 10ec916..299478c 100644
--- a/fe/src/main/java/org/apache/impala/analysis/CreateTableStmt.java
+++ b/fe/src/main/java/org/apache/impala/analysis/CreateTableStmt.java
@@ -601,26 +601,63 @@ public class CreateTableStmt extends StatementBase {
       putGeneratedKuduProperty(IcebergTable.ICEBERG_FILE_FORMAT, "parquet");
     }
 
-    String catalog = getTblProperties().get(IcebergTable.ICEBERG_CATALOG);
-    if (catalog == null || catalog.isEmpty()) {
-      putGeneratedKuduProperty(IcebergTable.ICEBERG_CATALOG, "hadoop.catalog");
-    }
-
-    // Some constraints for Iceberg table with 'hadoop.catalog'
-    if (catalog == null || catalog.isEmpty() ||
-        IcebergUtil.getTIcebergCatalog(catalog) == TIcebergCatalog.HADOOP_CATALOG) {
-      // Table location cannot be set in SQL when using 'hadoop.catalog'
-      if (getLocation() != null) {
-        throw new AnalysisException(String.format("Location cannot be set for Iceberg " +
-            "table with 'hadoop.catalog'."));
-      }
+    // Determine the Iceberg catalog being used. The default catalog is HiveCatalog.
+    String catalogStr = getTblProperties().get(IcebergTable.ICEBERG_CATALOG);
+    TIcebergCatalog catalog;
+    if (catalogStr == null || catalogStr.isEmpty()) {
+      catalog = TIcebergCatalog.HIVE_CATALOG;
+      putGeneratedKuduProperty(IcebergTable.ICEBERG_CATALOG, "hive.catalog");
+    } else {
+      catalog = IcebergUtil.getTIcebergCatalog(catalogStr);
+    }
+    validateIcebergTableProperties(catalog);
+  }
 
-      String catalogLoc = getTblProperties().get(IcebergTable.ICEBERG_CATALOG_LOCATION);
-      if (catalogLoc == null || catalogLoc.isEmpty()) {
-        throw new AnalysisException(String.format("Table property '%s' is necessary " +
-            "for Iceberg table with 'hadoop.catalog'.",
-            IcebergTable.ICEBERG_CATALOG_LOCATION));
-      }
+  private void validateIcebergTableProperties(TIcebergCatalog catalog)
+      throws AnalysisException {
+    // Metadata location is only used by HiveCatalog, but we shouldn't allow setting this
+    // for any catalogs to avoid confusion.
+    if (getTblProperties().get(IcebergTable.METADATA_LOCATION) != null) {
+      throw new AnalysisException(String.format("%s cannot be set for Iceberg tables",
+          IcebergTable.METADATA_LOCATION));
+    }
+    switch(catalog) {
+      case HIVE_CATALOG: validateTableInHiveCatalog();
+      break;
+      case HADOOP_CATALOG: validateTableInHadoopCatalog();
+      break;
+      case HADOOP_TABLES: validateTableInHadoopTables();
+      break;
+      default: throw new AnalysisException(String.format(
+          "Unknown Iceberg catalog type: %s", catalog));
+    }
+  }
+
+  private void validateTableInHiveCatalog() throws AnalysisException {
+    if (getTblProperties().get(IcebergTable.ICEBERG_CATALOG_LOCATION) != null) {
+      throw new AnalysisException(String.format("%s cannot be set for Iceberg table " +
+          "stored in hive.catalog", IcebergTable.ICEBERG_CATALOG_LOCATION));
+    }
+  }
+
+  private void validateTableInHadoopCatalog() throws AnalysisException {
+    // Table location cannot be set in SQL when using 'hadoop.catalog'
+    if (getLocation() != null) {
+      throw new AnalysisException(String.format("Location cannot be set for Iceberg " +
+          "table with 'hadoop.catalog'."));
+    }
+    String catalogLoc = getTblProperties().get(IcebergTable.ICEBERG_CATALOG_LOCATION);
+    if (catalogLoc == null || catalogLoc.isEmpty()) {
+      throw new AnalysisException(String.format("Table property '%s' is necessary " +
+          "for Iceberg table with 'hadoop.catalog'.",
+          IcebergTable.ICEBERG_CATALOG_LOCATION));
+    }
+  }
+
+  private void validateTableInHadoopTables() throws AnalysisException {
+    if (getTblProperties().get(IcebergTable.ICEBERG_CATALOG_LOCATION) != null) {
+      throw new AnalysisException(String.format("%s cannot be set for Iceberg table " +
+          "stored in hadoop.tables", IcebergTable.ICEBERG_CATALOG_LOCATION));
     }
   }
 
diff --git a/fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java b/fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
index 1919a33..a154216 100644
--- a/fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
+++ b/fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java
@@ -413,7 +413,10 @@ public class ToSqlUtils {
     } else if (table instanceof FeFsTable) {
       if (table instanceof FeIcebergTable) {
         storageHandlerClassName = null;
+        // Internal properties, should not be exposed to the user.
         properties.remove(IcebergTable.KEY_STORAGE_HANDLER);
+        properties.remove(StatsSetupConst.DO_NOT_UPDATE_STATS);
+        properties.remove(IcebergTable.METADATA_LOCATION);
 
         // Fill "PARTITION BY SPEC" part if the Iceberg table is partitioned.
         FeIcebergTable feIcebergTable= (FeIcebergTable)table;
diff --git a/fe/src/main/java/org/apache/impala/catalog/IcebergTable.java b/fe/src/main/java/org/apache/impala/catalog/IcebergTable.java
index 9c2742a..89f61d7 100644
--- a/fe/src/main/java/org/apache/impala/catalog/IcebergTable.java
+++ b/fe/src/main/java/org/apache/impala/catalog/IcebergTable.java
@@ -81,6 +81,10 @@ public class IcebergTable extends Table implements FeIcebergTable {
   // We use database.table instead if this property not been set in SQL
   public static final String ICEBERG_TABLE_IDENTIFIER = "iceberg.table_identifier";
 
+  // Internal Iceberg table property that specifies the absolute path of the current
+  // table metadata. This property is only valid for tables in 'hive.catalog'.
+  public static final String METADATA_LOCATION = "metadata_location";
+
   // Iceberg catalog type dependend on table properties
   private TIcebergCatalog icebergCatalog_;
 
diff --git a/fe/src/main/java/org/apache/impala/catalog/iceberg/IcebergHiveCatalog.java b/fe/src/main/java/org/apache/impala/catalog/iceberg/IcebergHiveCatalog.java
new file mode 100644
index 0000000..e90e3be
--- /dev/null
+++ b/fe/src/main/java/org/apache/impala/catalog/iceberg/IcebergHiveCatalog.java
@@ -0,0 +1,101 @@
+// 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.impala.catalog.iceberg;
+
+import java.util.Map;
+import org.apache.hadoop.hive.conf.HiveConf;
+import org.apache.iceberg.PartitionSpec;
+import org.apache.iceberg.Schema;
+import org.apache.iceberg.Table;
+import org.apache.iceberg.catalog.TableIdentifier;
+import org.apache.iceberg.exceptions.NoSuchTableException;
+import org.apache.iceberg.hadoop.ConfigProperties;
+import org.apache.iceberg.hive.HiveCatalog;
+import org.apache.impala.catalog.FeIcebergTable;
+import org.apache.impala.catalog.TableLoadingException;
+import org.apache.impala.common.FileSystemUtil;
+import org.apache.impala.thrift.TIcebergCatalog;
+import org.apache.impala.util.IcebergUtil;
+
+import com.google.common.base.Preconditions;
+
+/**
+ * Implementation of IcebergCatalog for tables stored in HiveCatalog.
+ */
+public class IcebergHiveCatalog implements IcebergCatalog {
+  private static IcebergHiveCatalog instance_;
+
+  public synchronized static IcebergHiveCatalog getInstance() {
+    if (instance_ == null) {
+      instance_ = new IcebergHiveCatalog();
+    }
+    return instance_;
+  }
+
+  private HiveCatalog hiveCatalog_;
+
+  private IcebergHiveCatalog() {
+    HiveConf conf = new HiveConf(IcebergHiveCatalog.class);
+    conf.setBoolean(ConfigProperties.ENGINE_HIVE_ENABLED, true);
+    hiveCatalog_ = new HiveCatalog(conf);
+  }
+
+  @Override
+  public Table createTable(
+      TableIdentifier identifier,
+      Schema schema,
+      PartitionSpec spec,
+      String location,
+      Map<String, String> properties) {
+    return hiveCatalog_.createTable(identifier, schema, spec, location, properties);
+  }
+
+  @Override
+  public Table loadTable(FeIcebergTable feTable) throws TableLoadingException {
+    Preconditions.checkState(
+        feTable.getIcebergCatalog() == TIcebergCatalog.HIVE_CATALOG);
+    TableIdentifier tableId = IcebergUtil.getIcebergTableIdentifier(feTable);
+    return loadTable(tableId, null);
+  }
+
+  @Override
+  public Table loadTable(TableIdentifier tableId, String tableLocation)
+      throws TableLoadingException {
+    Preconditions.checkState(tableId != null);
+    try {
+      return hiveCatalog_.loadTable(tableId);
+    } catch (Exception e) {
+      throw new TableLoadingException(String.format(
+          "Failed to load Iceberg table with id: %s", tableId), e);
+    }
+  }
+
+  @Override
+  public boolean dropTable(FeIcebergTable feTable, boolean purge) {
+    Preconditions.checkState(
+        feTable.getIcebergCatalog() == TIcebergCatalog.HIVE_CATALOG);
+    TableIdentifier tableId = IcebergUtil.getIcebergTableIdentifier(feTable);
+    return hiveCatalog_.dropTable(tableId, purge);
+  }
+
+  @Override
+  public void renameTable(FeIcebergTable feTable, TableIdentifier newTableId) {
+    TableIdentifier oldTableId = IcebergUtil.getIcebergTableIdentifier(feTable);
+    hiveCatalog_.renameTable(oldTableId, newTableId);
+  }
+}
diff --git a/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java b/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
index 20afadc..8efc2c7 100644
--- a/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
+++ b/fe/src/main/java/org/apache/impala/service/CatalogOpExecutor.java
@@ -1843,9 +1843,19 @@ public class CatalogOpExecutor {
     }
   }
 
+  private boolean isHmsIntegrationAutomatic(
+      org.apache.hadoop.hive.metastore.api.Table msTbl) throws ImpalaRuntimeException {
+    if (KuduTable.isKuduTable(msTbl)) {
+      return isKuduHmsIntegrationEnabled(msTbl);
+    }
+    if (IcebergTable.isIcebergTable(msTbl)) {
+      return isIcebergHmsIntegrationEnabled(msTbl);
+    }
+    return false;
+  }
+
   private boolean isKuduHmsIntegrationEnabled(
-      org.apache.hadoop.hive.metastore.api.Table msTbl)
-          throws ImpalaRuntimeException {
+      org.apache.hadoop.hive.metastore.api.Table msTbl) throws ImpalaRuntimeException {
     // Check if Kudu's integration with the Hive Metastore is enabled, and validate
     // the configuration.
     Preconditions.checkState(KuduTable.isKuduTable(msTbl));
@@ -1854,6 +1864,16 @@ public class CatalogOpExecutor {
     return KuduTable.isHMSIntegrationEnabledAndValidate(masterHosts, hmsUris);
   }
 
+  private boolean isIcebergHmsIntegrationEnabled(
+      org.apache.hadoop.hive.metastore.api.Table msTbl) throws ImpalaRuntimeException {
+    // Check if Iceberg's integration with the Hive Metastore is enabled, and validate
+    // the configuration.
+    Preconditions.checkState(IcebergTable.isIcebergTable(msTbl));
+    // Only synchronized tables can be integrated.
+    if (!IcebergTable.isSynchronizedTable(msTbl)) return false;
+    return IcebergUtil.getTIcebergCatalog(msTbl) == TIcebergCatalog.HIVE_CATALOG;
+  }
+
   /**
    * Drops a table or view from the metastore and removes it from the catalog.
    * Also drops all associated caching requests on the table and/or table's partitions,
@@ -1938,7 +1958,24 @@ public class CatalogOpExecutor {
         throw new CatalogException("Table/View does not exist.");
       }
 
-      // Retrieve the HMS table to determine if this is a Kudu table.
+      // Check to make sure we don't drop a view with "drop table" statement and
+      // vice versa. is_table field is marked optional in TDropTableOrViewParams to
+      // maintain catalog api compatibility.
+      // TODO: Remove params.isSetIs_table() check once catalog api compatibility is
+      // fixed.
+      if (params.isSetIs_table() && ((params.is_table && existingTbl instanceof View)
+          || (!params.is_table && !(existingTbl instanceof View)))) {
+        String errorMsg = "DROP " + (params.is_table ? "TABLE " : "VIEW ") +
+            "not allowed on a " + (params.is_table ? "view: " : "table: ") + tableName;
+        if (params.if_exists) {
+          addSummary(resp, "Drop " + (params.is_table ? "table " : "view ") +
+              "is not allowed on a " + (params.is_table ? "view." : "table."));
+          return;
+        }
+        throw new CatalogException(errorMsg);
+      }
+
+      // Retrieve the HMS table to determine if this is a Kudu or Iceberg table.
       org.apache.hadoop.hive.metastore.api.Table msTbl = existingTbl.getMetaStoreTable();
       if (msTbl == null) {
         Preconditions.checkState(existingTbl instanceof IncompleteTable);
@@ -1954,41 +1991,28 @@ public class CatalogOpExecutor {
         }
         existingTbl.updateHMSLoadTableSchemaTime(hmsLoadTime);
       }
-      boolean isSynchronizedTable = msTbl != null &&
+      boolean isSynchronizedKuduTable = msTbl != null &&
               KuduTable.isKuduTable(msTbl) && KuduTable.isSynchronizedTable(msTbl);
-      if (isSynchronizedTable) {
+      if (isSynchronizedKuduTable) {
         KuduCatalogOpExecutor.dropTable(msTbl, /* if exists */ true);
       }
 
-      if (msTbl != null &&
-          !(existingTbl instanceof IncompleteTable) &&
+      boolean isSynchronizedIcebergTable = msTbl != null &&
           IcebergTable.isIcebergTable(msTbl) &&
-          IcebergTable.isSynchronizedTable(msTbl)) {
+          IcebergTable.isSynchronizedTable(msTbl);
+      if (!(existingTbl instanceof IncompleteTable) && isSynchronizedIcebergTable) {
         Preconditions.checkState(existingTbl instanceof IcebergTable);
         IcebergCatalogOpExecutor.dropTable((IcebergTable)existingTbl, params.if_exists);
       }
 
-      // Check to make sure we don't drop a view with "drop table" statement and
-      // vice versa. is_table field is marked optional in TDropTableOrViewParams to
-      // maintain catalog api compatibility.
-      // TODO: Remove params.isSetIs_table() check once catalog api compatibility is
-      // fixed.
-      if (params.isSetIs_table() && ((params.is_table && existingTbl instanceof View)
-          || (!params.is_table && !(existingTbl instanceof View)))) {
-        String errorMsg = "DROP " + (params.is_table ? "TABLE " : "VIEW ") +
-            "not allowed on a " + (params.is_table ? "view: " : "table: ") + tableName;
-        if (params.if_exists) {
-          addSummary(resp, "Drop " + (params.is_table ? "table " : "view ") +
-              "is not allowed on a " + (params.is_table ? "view." : "table."));
-          return;
-        }
-        throw new CatalogException(errorMsg);
-      }
-
-      // When Kudu's HMS integration is enabled, Kudu will drop the managed table
-      // entries automatically. In all other cases, we need to drop the HMS table
-      // entry ourselves.
-      if (!isSynchronizedTable || !isKuduHmsIntegrationEnabled(msTbl)) {
+      // When HMS integration is automatic, the table is dropped automatically. In all
+      // other cases, we need to drop the HMS table entry ourselves.
+      boolean isSynchronizedTable = isSynchronizedKuduTable || isSynchronizedIcebergTable;
+      boolean needsHmsDropTable =
+          (existingTbl instanceof IncompleteTable && isSynchronizedIcebergTable) ||
+          !isSynchronizedTable ||
+          !isHmsIntegrationAutomatic(msTbl);
+      if (needsHmsDropTable) {
         try (MetaStoreClient msClient = catalog_.getMetaStoreClient()) {
           msClient.getHiveClient().dropTable(
               tableName.getDb(), tableName.getTbl(), true,
@@ -2731,7 +2755,23 @@ public class CatalogOpExecutor {
             // include one or more of the table columns
             Preconditions.checkState(newTable.getPartitionKeys() == null ||
                 newTable.getPartitionKeys().isEmpty());
-            msClient.getHiveClient().createTable(newTable);
+            if (!isIcebergHmsIntegrationEnabled(newTable)) {
+              msClient.getHiveClient().createTable(newTable);
+            } else {
+              // Currently HiveCatalog doesn't set the table property
+              // 'external.table.purge' during createTable().
+              org.apache.hadoop.hive.metastore.api.Table msTbl =
+                  msClient.getHiveClient().getTable(
+                      newTable.getDbName(), newTable.getTableName());
+              msTbl.putToParameters("external.table.purge", "TRUE");
+              // HiveCatalog also doesn't set the table properties either.
+              for (Map.Entry<String, String> entry :
+                  params.getTable_properties().entrySet()) {
+                msTbl.putToParameters(entry.getKey(), entry.getValue());
+              }
+              msClient.getHiveClient().alter_table(
+                  newTable.getDbName(), newTable.getTableName(), msTbl);
+            }
           } else {
             addSummary(response, "Table already exists.");
             return false;
@@ -3307,15 +3347,12 @@ public class CatalogOpExecutor {
     msTbl.setTableName(newTableName.getTbl());
 
     // If oldTbl is a synchronized Kudu table, rename the underlying Kudu table.
-    boolean isSynchronizedTable = (oldTbl instanceof KuduTable) &&
+    boolean isSynchronizedKuduTable = (oldTbl instanceof KuduTable) &&
                                  KuduTable.isSynchronizedTable(msTbl);
-    boolean altersHMSTable = true;
-    if (isSynchronizedTable) {
+    boolean integratedHmsTable = isHmsIntegrationAutomatic(msTbl);
+    if (isSynchronizedKuduTable) {
       Preconditions.checkState(KuduTable.isKuduTable(msTbl));
-      boolean isKuduHmsIntegrationEnabled = isKuduHmsIntegrationEnabled(msTbl);
-      altersHMSTable = !isKuduHmsIntegrationEnabled;
-      renameManagedKuduTable((KuduTable) oldTbl, msTbl, newTableName,
-          isKuduHmsIntegrationEnabled);
+      renameManagedKuduTable((KuduTable) oldTbl, msTbl, newTableName, integratedHmsTable);
     }
 
     // If oldTbl is a synchronized Iceberg table, rename the underlying Iceberg table.
@@ -3325,11 +3362,11 @@ public class CatalogOpExecutor {
       renameManagedIcebergTable((IcebergTable) oldTbl, msTbl, newTableName);
     }
 
-    // Always updates the HMS metadata for non-Kudu tables. For Kudu tables, when
-    // Kudu is not integrated with the Hive Metastore or if this is an external table,
-    // Kudu will not automatically update the HMS metadata, we have to do it
-    // manually.
-    if (altersHMSTable) {
+    boolean isSynchronizedTable = isSynchronizedKuduTable || isSynchronizedIcebergTable;
+    // Update the HMS table, unless the table is synchronized and the HMS integration
+    // is automatic.
+    boolean needsHmsAlterTable = !isSynchronizedTable || !integratedHmsTable;
+    if (needsHmsAlterTable) {
       try (MetaStoreClient msClient = catalog_.getMetaStoreClient()) {
         msClient.getHiveClient().alter_table(
             tableName.getDb(), tableName.getTbl(), msTbl);
diff --git a/fe/src/main/java/org/apache/impala/service/IcebergCatalogOpExecutor.java b/fe/src/main/java/org/apache/impala/service/IcebergCatalogOpExecutor.java
index 4ab4739..1c731d7 100644
--- a/fe/src/main/java/org/apache/impala/service/IcebergCatalogOpExecutor.java
+++ b/fe/src/main/java/org/apache/impala/service/IcebergCatalogOpExecutor.java
@@ -75,7 +75,8 @@ public class IcebergCatalogOpExecutor {
     Schema schema = createIcebergSchema(params);
     PartitionSpec spec = IcebergUtil.createIcebergPartition(schema, params);
     IcebergCatalog icebergCatalog = IcebergUtil.getIcebergCatalog(catalog, location);
-    Table iceTable = icebergCatalog.createTable(identifier, schema, spec, location, null);
+    Table iceTable = icebergCatalog.createTable(identifier, schema, spec, location,
+        params.getTable_properties());
     LOG.info("Create iceberg table successful.");
     return iceTable;
   }
diff --git a/fe/src/main/java/org/apache/impala/util/IcebergUtil.java b/fe/src/main/java/org/apache/impala/util/IcebergUtil.java
index efd4f87..aad0775 100644
--- a/fe/src/main/java/org/apache/impala/util/IcebergUtil.java
+++ b/fe/src/main/java/org/apache/impala/util/IcebergUtil.java
@@ -56,6 +56,7 @@ import org.apache.impala.catalog.TableLoadingException;
 import org.apache.impala.catalog.Type;
 import org.apache.impala.catalog.iceberg.IcebergHadoopCatalog;
 import org.apache.impala.catalog.iceberg.IcebergHadoopTables;
+import org.apache.impala.catalog.iceberg.IcebergHiveCatalog;
 import org.apache.impala.catalog.iceberg.IcebergCatalog;
 import org.apache.impala.common.ImpalaRuntimeException;
 import org.apache.impala.thrift.TColumnType;
@@ -84,6 +85,7 @@ public class IcebergUtil {
       throws ImpalaRuntimeException {
     switch (catalog) {
       case HADOOP_TABLES: return IcebergHadoopTables.getInstance();
+      case HIVE_CATALOG: return IcebergHiveCatalog.getInstance();
       case HADOOP_CATALOG: return new IcebergHadoopCatalog(location);
       default: throw new ImpalaRuntimeException (
           "Unexpected catalog type: " + catalog.toString());
@@ -204,13 +206,13 @@ public class IcebergUtil {
 
   /**
    * Get iceberg table catalog type from hms table properties
-   * use HadoopCatalog as default
+   * use HiveCatalog as default
    */
   public static TIcebergCatalog getTIcebergCatalog(
       org.apache.hadoop.hive.metastore.api.Table msTable) {
     TIcebergCatalog catalog = getTIcebergCatalog(
         msTable.getParameters().get(IcebergTable.ICEBERG_CATALOG));
-    return catalog == null ? TIcebergCatalog.HADOOP_CATALOG : catalog;
+    return catalog == null ? TIcebergCatalog.HIVE_CATALOG : catalog;
   }
 
   /**
@@ -221,6 +223,8 @@ public class IcebergUtil {
       return TIcebergCatalog.HADOOP_TABLES;
     } else if ("hadoop.catalog".equalsIgnoreCase(catalog)) {
       return TIcebergCatalog.HADOOP_CATALOG;
+    } else if ("hive.catalog".equalsIgnoreCase(catalog)) {
+      return TIcebergCatalog.HIVE_CATALOG;
     }
     return null;
   }
@@ -235,10 +239,11 @@ public class IcebergUtil {
   }
 
   /**
-   * Get TIcebergFileFormat from a string, usually from table properties
+   * Get TIcebergFileFormat from a string, usually from table properties.
+   * Returns PARQUET when 'format' is null. Returns null for invalid formats.
    */
-  public static TIcebergFileFormat getIcebergFileFormat(String format){
-    if ("PARQUET".equalsIgnoreCase(format)) {
+  public static TIcebergFileFormat getIcebergFileFormat(String format) {
+    if ("PARQUET".equalsIgnoreCase(format) || format == null) {
       return TIcebergFileFormat.PARQUET;
     } else if ("ORC".equalsIgnoreCase(format)) {
       return TIcebergFileFormat.ORC;
diff --git a/testdata/workloads/functional-query/queries/QueryTest/iceberg-alter.test b/testdata/workloads/functional-query/queries/QueryTest/iceberg-alter.test
index b5c9827..0afccd2 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/iceberg-alter.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/iceberg-alter.test
@@ -94,3 +94,20 @@ DESCRIBE FORMATTED iceberg_hadoop_catalog;
 ---- TYPES
 string, string, string
 ====
+---- QUERY
+CREATE TABLE iceberg_rename (i int)
+STORED AS ICEBERG
+TBLPROPERTIES('iceberg.catalog'='hive.catalog');
+INSERT INTO iceberg_rename values (42);
+ALTER TABLE iceberg_rename RENAME TO iceberg_rename2;
+SELECT * FROM iceberg_rename2;
+---- RESULTS
+42
+---- TYPES
+INT
+====
+---- QUERY
+SELECT * FROM iceberg_rename;
+---- CATCH
+Could not resolve table reference: 'iceberg_rename'
+====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/iceberg-create.test b/testdata/workloads/functional-query/queries/QueryTest/iceberg-create.test
index 8fde387..12990ee 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/iceberg-create.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/iceberg-create.test
@@ -306,7 +306,7 @@ PARTITION BY SPEC
   register_time DAY
 )
 STORED AS ICEBERG
-TBLPROPERTIES('iceberg.file_format'='orc','iceberg_catalog'='hadoop.tables',
+TBLPROPERTIES('iceberg.file_format'='orc','iceberg.catalog'='hadoop.catalog',
 'iceberg.catalog_location'='/test-warehouse/$DATABASE/hadoop_catalog_test/iceberg_test');
 ---- RESULTS
 'Table has been created.'
@@ -356,3 +356,48 @@ describe formatted iceberg_default_trans
 ---- TYPES
 STRING, STRING, STRING
 ====
+---- QUERY
+CREATE TABLE iceberg_part_hive_cat(
+  level STRING,
+  event_time TIMESTAMP,
+  register_time DATE,
+  message STRING,
+  price DECIMAL(8,1),
+  map_test MAP <STRING, array <STRING>>,
+  struct_test STRUCT <f1: BIGINT, f2: BIGINT>
+)
+PARTITION BY SPEC
+(
+  level IDENTITY,
+  event_time IDENTITY,
+  event_time HOUR,
+  register_time DAY
+)
+STORED AS ICEBERG
+TBLPROPERTIES('iceberg.catalog'='hive.catalog')
+---- RESULTS
+'Table has been created.'
+====
+---- QUERY
+DESCRIBE iceberg_part_hive_cat;
+---- RESULTS
+'level','string',''
+'event_time','timestamp',''
+'register_time','date',''
+'message','string',''
+'price','decimal(8,1)',''
+'map_test','map<string,array<string>>',''
+'struct_test','struct<\n  f1:bigint,\n  f2:bigint\n>',''
+---- TYPES
+STRING,STRING,STRING
+====
+---- QUERY
+DESCRIBE FORMATTED iceberg_part_hive_cat;
+---- RESULTS: VERIFY_IS_SUBSET
+'Location:           ','$NAMENODE/test-warehouse/$DATABASE.db/iceberg_part_hive_cat','NULL'
+row_regex:'','metadata_location   ','$NAMENODE/test-warehouse/$DATABASE.db/iceberg_part_hive_cat/metadata/.*.metadata.json'
+'','table_type          ','ICEBERG             '
+'','iceberg.catalog     ','hive.catalog        '
+---- TYPES
+string, string, string
+====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/iceberg-insert.test b/testdata/workloads/functional-query/queries/QueryTest/iceberg-insert.test
index 4e48bb5..6bbc606 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/iceberg-insert.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/iceberg-insert.test
@@ -125,7 +125,7 @@ select * from ts_iceberg;
 create table iceberg_hadoop_cat (i int)
 stored as iceberg
 tblproperties('iceberg.catalog'='hadoop.catalog',
-  'iceberg.catalog_location'='/test-warehouse/$DATABASE/hadoop_catalog_test');
+  'iceberg.catalog_location'='/test-warehouse/$DATABASE.db/hadoop_catalog_test');
 insert into iceberg_hadoop_cat values (1), (2), (3);
 ---- RESULTS
 : 3
@@ -142,7 +142,7 @@ INT
 ---- QUERY
 show files in iceberg_hadoop_cat;
 ---- RESULTS: VERIFY_IS_SUBSET
-row_regex:'$NAMENODE/test-warehouse/$DATABASE/hadoop_catalog_test/$DATABASE/iceberg_hadoop_cat/data/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/hadoop_catalog_test/$DATABASE/iceberg_hadoop_cat/data/.*.0.parq','.*',''
 ---- TYPES
 STRING, STRING, STRING
 ====
@@ -151,7 +151,7 @@ STRING, STRING, STRING
 create table iceberg_hadoop_cat_ti (i int)
 stored as iceberg
 tblproperties('iceberg.catalog'='hadoop.catalog',
-  'iceberg.catalog_location'='/test-warehouse/$DATABASE/hadoop_catalog_test',
+  'iceberg.catalog_location'='/test-warehouse/$DATABASE.db/hadoop_catalog_test',
   'iceberg.table_identifier'='test.custom_db.int_table');
 insert into iceberg_hadoop_cat_ti values (1), (2), (3);
 ---- RESULTS
@@ -169,7 +169,126 @@ INT
 ---- QUERY
 show files in iceberg_hadoop_cat_ti;
 ---- RESULTS: VERIFY_IS_SUBSET
-row_regex:'$NAMENODE/test-warehouse/$DATABASE/hadoop_catalog_test/test/custom_db/int_table/data/.*.0.parq','.*',''
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/hadoop_catalog_test/test/custom_db/int_table/data/.*.0.parq','.*',''
+---- TYPES
+STRING, STRING, STRING
+====
+---- QUERY
+# Insert into table stored in Iceberg's HiveCatalog
+create table iceberg_hive_cat (i int)
+stored as iceberg
+tblproperties('iceberg.catalog'='hive.catalog');
+---- RESULTS
+'Table has been created.'
+====
+---- QUERY
+insert into iceberg_hive_cat values (7);
+select * from iceberg_hive_cat;
+---- RESULTS
+7
+---- TYPES
+INT
+====
+---- QUERY
+# Query external Iceberg table
+create external table iceberg_hive_cat_ext (i int)
+stored as iceberg
+location '/test-warehouse/$DATABASE.db/iceberg_hive_cat'
+tblproperties('iceberg.catalog'='hive.catalog',
+    'iceberg.table_identifier'='$DATABASE.iceberg_hive_cat');
+---- RESULTS
+'Table has been created.'
+====
+---- QUERY
+select * from iceberg_hive_cat_ext;
+---- RESULTS
+7
+---- TYPES
+INT
+====
+---- QUERY
+# INSET INTO external Iceberg table stored in HiveCatalog.
+insert into iceberg_hive_cat_ext values (8);
+select * from iceberg_hive_cat_ext;
+---- RESULTS
+7
+8
+---- TYPES
+INT
+====
+---- QUERY
+# Query original table
+refresh iceberg_hive_cat;
+select * from iceberg_hive_cat;
+---- RESULTS
+7
+8
+---- TYPES
+INT
+====
+---- QUERY
+# DROP external Iceberg table
+drop table iceberg_hive_cat_ext
+---- RESULTS
+'Table has been dropped.'
+====
+---- QUERY
+# Original table is not affected after external table drop.
+refresh iceberg_hive_cat;
+select * from iceberg_hive_cat;
+---- RESULTS
+7
+8
+---- TYPES
+INT
+====
+---- QUERY
+# Create another external Iceberg table
+create external table iceberg_hive_cat_ext_2 (i int)
+stored as iceberg
+location '/test-warehouse/$DATABASE.db/iceberg_hive_cat'
+tblproperties('iceberg.catalog'='hive.catalog',
+    'iceberg.table_identifier'='$DATABASE.iceberg_hive_cat');
+select * from iceberg_hive_cat_ext_2
+---- RESULTS
+7
+8
+====
+---- QUERY
+# DROP the synchronized Iceberg table (data is purged).
+drop table iceberg_hive_cat
+---- RESULTS
+'Table has been dropped.'
+====
+---- QUERY
+# The data has been purged, so querying the external table fails.
+select * from iceberg_hive_cat_ext_2
+---- CATCH
+Table does not exist
+====
+---- QUERY
+# Insert into hive catalog with custom location.
+create table iceberg_hive_cat_custom_loc (i int)
+stored as iceberg
+location '/test-warehouse/$DATABASE.db/custom_hive_cat'
+tblproperties('iceberg.catalog'='hive.catalog');
+insert into iceberg_hive_cat_custom_loc values (1), (2), (3);
+---- RESULTS
+: 3
+====
+---- QUERY
+select * from iceberg_hive_cat_custom_loc;
+---- RESULTS
+1
+2
+3
+---- TYPES
+INT
+====
+---- QUERY
+show files in iceberg_hive_cat_custom_loc;
+---- RESULTS: VERIFY_IS_SUBSET
+row_regex:'$NAMENODE/test-warehouse/$DATABASE.db/custom_hive_cat/data/.*.0.parq','.*',''
 ---- TYPES
 STRING, STRING, STRING
 ====
diff --git a/testdata/workloads/functional-query/queries/QueryTest/iceberg-negative.test b/testdata/workloads/functional-query/queries/QueryTest/iceberg-negative.test
index cc65d26..068e82d 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/iceberg-negative.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/iceberg-negative.test
@@ -37,6 +37,14 @@ SHOW PARTITIONS functional_parquet.iceberg_non_partitioned
 AnalysisException: Table is not partitioned: functional_parquet.iceberg_non_partitioned
 ====
 ---- QUERY
+CREATE TABLE iceberg_table_hadoop_tables_cat_loc(i INT)
+STORED AS ICEBERG
+TBLPROPERTIES('iceberg.catalog'='hadoop.tables',
+              'iceberg.catalog_location'='/test-warehouse/cat_loc')
+---- CATCH
+iceberg.catalog_location cannot be set for Iceberg table stored in hadoop.tables
+====
+---- QUERY
 CREATE TABLE iceberg_table_hadoop_catalog(
   level STRING
 )
@@ -59,21 +67,26 @@ AnalysisException: Table property 'iceberg.catalog_location' is necessary for Ic
 CREATE EXTERNAL TABLE iceberg_external_table_hadoop_catalog
 STORED AS ICEBERG
 LOCATION '/test-warehouse/$DATABASE/hadoop_catalog_test/iceberg_test'
-TBLPROPERTIES('iceberg.catalog_location'='/test-warehouse/fake_table', 'iceberg.table_identifier'='fake_db.fake_table');
+TBLPROPERTIES('iceberg.catalog'='hadoop.catalog',
+    'iceberg.catalog_location'='/test-warehouse/fake_table',
+    'iceberg.table_identifier'='fake_db.fake_table');
 ---- CATCH
 AnalysisException: Location cannot be set for Iceberg table with 'hadoop.catalog'.
 ====
 ---- QUERY
 CREATE EXTERNAL TABLE iceberg_table_hadoop_catalog
 STORED AS ICEBERG
-TBLPROPERTIES('iceberg.table_identifier'='fake_db.fake_table');
+TBLPROPERTIES('iceberg.catalog'='hadoop.catalog',
+    'iceberg.table_identifier'='fake_db.fake_table');
 ---- CATCH
 AnalysisException: Table property 'iceberg.catalog_location' is necessary for Iceberg table with 'hadoop.catalog'.
 ====
 ---- QUERY
 CREATE EXTERNAL TABLE fake_iceberg_table_hadoop_catalog
 STORED AS ICEBERG
-TBLPROPERTIES('iceberg.catalog_location'='/test-warehouse/fake_table', 'iceberg.table_identifier'='fake_db.fake_table');
+TBLPROPERTIES('iceberg.catalog'='hadoop.catalog',
+    'iceberg.catalog_location'='/test-warehouse/fake_table',
+    'iceberg.table_identifier'='fake_db.fake_table');
 SHOW CREATE TABLE fake_iceberg_table_hadoop_catalog;
 ---- CATCH
 row_regex:.*CAUSED BY: TableLoadingException: Table does not exist: fake_db.fake_table*
@@ -95,6 +108,39 @@ INSERT OVERWRITE iceberg_overwrite VALUES (1), (2), (3);
 AnalysisException: INSERT OVERWRITE not supported for Iceberg tables.
 ====
 ---- QUERY
+CREATE TABLE iceberg_hive_cat_with_cat_locaction (i int)
+STORED AS ICEBERG
+TBLPROPERTIES('iceberg.catalog'='hive.catalog',
+    'iceberg.catalog_location'='/test-warehouse/catalog_loc')
+---- CATCH
+iceberg.catalog_location cannot be set for Iceberg table stored in hive.catalog
+====
+---- QUERY
+CREATE TABLE iceberg_hadoop_tables_with_metdata_locaction (i int)
+STORED AS ICEBERG
+TBLPROPERTIES('iceberg.catalog'='hadoop.tables',
+    'metadata_location'='/test-warehouse/catalog/metadata_loc')
+---- CATCH
+metadata_location cannot be set for Iceberg tables
+====
+---- QUERY
+CREATE TABLE iceberg_hadoop_cat_with_metadata_locaction (i int)
+STORED AS ICEBERG
+TBLPROPERTIES('iceberg.catalog'='hadoop.catalog',
+    'iceberg.catalog_location'='/test-warehouse/catalog',
+    'metadata_location'='/test-warehouse/catalog/metadata_loc')
+---- CATCH
+metadata_location cannot be set for Iceberg tables
+====
+---- QUERY
+CREATE TABLE iceberg_hive_cat_with_metadata_locaction (i int)
+STORED AS ICEBERG
+TBLPROPERTIES('iceberg.catalog'='hive.catalog',
+    'metadata_location'='/test-warehouse/catalog/metadata_loc')
+---- CATCH
+metadata_location cannot be set for Iceberg tables
+====
+---- QUERY
 CREATE TABLE iceberg_partitioned_insert(
   level STRING,
   event_time TIMESTAMP
@@ -119,6 +165,11 @@ ALTER TABLE iceberg_table_hadoop_tables RENAME TO iceberg_table_hadoop_tables_ne
 UnsupportedOperationException: Cannot rename Iceberg tables that use 'hadoop.tables' as catalog.
 ====
 ---- QUERY
+CREATE TABLE iceberg_table_hive_catalog (level STRING)
+STORED AS ICEBERG
+TBLPROPERTIES('iceberg.catalog'='hive.catalog')
+====
+---- QUERY
 CREATE TABLE iceberg_table_hadoop_catalog(
   level STRING,
   event_time TIMESTAMP
@@ -151,6 +202,16 @@ ALTER TABLE iceberg_table_hadoop_catalog set TBLPROPERTIES('iceberg.table_identi
 AnalysisException: Changing the 'iceberg.table_identifier' table property is not supported for Iceberg table.
 ====
 ---- QUERY
+ALTER TABLE iceberg_table_hadoop_catalog set TBLPROPERTIES('metadata_location'='/test-warehouse/metadata_loc');
+---- CATCH
+AnalysisException: Changing the 'metadata_location' table property is not supported for Iceberg table.
+====
+---- QUERY
+ALTER TABLE iceberg_table_hive_catalog set TBLPROPERTIES('metadata_location'='/test-warehouse/metadata_loc');
+---- CATCH
+AnalysisException: Changing the 'metadata_location' table property is not supported for Iceberg table.
+====
+---- QUERY
 ALTER TABLE iceberg_table_hadoop_catalog set FILEFORMAT PARQUET;
 ---- CATCH
 AnalysisException: ALTER TABLE SET FILEFORMAT is not supported on Iceberg tables: $DATABASE.iceberg_table_hadoop_catalog
diff --git a/testdata/workloads/functional-query/queries/QueryTest/show-create-table.test b/testdata/workloads/functional-query/queries/QueryTest/show-create-table.test
index 61bd879..6a96c06 100644
--- a/testdata/workloads/functional-query/queries/QueryTest/show-create-table.test
+++ b/testdata/workloads/functional-query/queries/QueryTest/show-create-table.test
@@ -644,6 +644,7 @@ PARTITION BY SPEC (
 )
 STORED AS ICEBERG
 TBLPROPERTIES('iceberg.file_format'='parquet',
+    'iceberg.catalog'='hadoop.catalog',
     'iceberg.catalog_location'='/test-warehouse/hadoop_catalog_test')
 ---- RESULTS-HIVE
 CREATE TABLE show_create_table_test_db.iceberg_test1_partitioned (
@@ -665,6 +666,7 @@ PARTITION BY SPEC
 )
 STORED AS ICEBERG
 TBLPROPERTIES('iceberg.file_format'='parquet',
+    'iceberg.catalog'='hadoop.catalog',
     'iceberg.catalog_location'='/test-warehouse/hadoop_catalog_test')
 ---- RESULTS-HIVE-3
 CREATE EXTERNAL TABLE show_create_table_test_db.iceberg_test1_partitioned (
@@ -687,6 +689,7 @@ PARTITION BY SPEC
 STORED AS ICEBERG
 TBLPROPERTIES ('external.table.purge'='TRUE', 'iceberg.catalog'='hadoop.catalog',
     'iceberg.file_format'='parquet',
+    'iceberg.catalog'='hadoop.catalog',
     'iceberg.catalog_location'='/test-warehouse/hadoop_catalog_test')
 ====
 ---- CREATE_TABLE
@@ -711,3 +714,50 @@ LOCATION '$$location_uri$$'
 TBLPROPERTIES ('external.table.purge'='TRUE', 'iceberg.file_format'='orc',
 'iceberg.catalog'='hadoop.tables')
 ====
+---- CREATE_TABLE
+# Default Iceberg table
+CREATE TABLE iceberg_default_tbl (
+  level STRING
+)
+STORED AS ICEBERG;
+---- RESULTS-HIVE-3
+CREATE EXTERNAL TABLE show_create_table_test_db.iceberg_default_tbl (
+  level STRING
+)
+STORED AS ICEBERG
+LOCATION '$$location_uri$$'
+TBLPROPERTIES ('iceberg.file_format'='parquet', 'iceberg.catalog'='hive.catalog',
+'external.table.purge'='TRUE', 'table_type'='ICEBERG')
+====
+---- CREATE_TABLE
+# Default Iceberg table with ORC format
+CREATE TABLE iceberg_default_tbl_orc (
+  level STRING
+)
+STORED AS ICEBERG
+TBLPROPERTIES ('iceberg.file_format'='orc');
+---- RESULTS-HIVE-3
+CREATE EXTERNAL TABLE show_create_table_test_db.iceberg_default_tbl_orc (
+  level STRING
+)
+STORED AS ICEBERG
+LOCATION '$$location_uri$$'
+TBLPROPERTIES ('iceberg.file_format'='orc', 'iceberg.catalog'='hive.catalog',
+'external.table.purge'='TRUE', 'table_type'='ICEBERG')
+====
+---- CREATE_TABLE
+# Iceberg table in HiveCatalog
+CREATE TABLE iceberg_hive_cat_explicit (
+  level STRING
+)
+STORED AS ICEBERG
+TBLPROPERTIES ('iceberg.catalog'='hive.catalog');
+---- RESULTS-HIVE-3
+CREATE EXTERNAL TABLE show_create_table_test_db.iceberg_hive_cat_explicit (
+  level STRING
+)
+STORED AS ICEBERG
+LOCATION '$$location_uri$$'
+TBLPROPERTIES ('iceberg.file_format'='parquet', 'iceberg.catalog'='hive.catalog',
+'external.table.purge'='TRUE', 'table_type'='ICEBERG')
+====