From b275ca8cfcf410b44d5b6809971ac1de62ce5e6a Mon Sep 17 00:00:00 2001 From: anthonychengit Date: Fri, 10 Jul 2026 00:32:04 -0700 Subject: [PATCH] refactor(workflow-core): remove unused hadoop Iceberg catalog --- common/config/src/main/resources/storage.conf | 2 +- .../core/storage/IcebergCatalogInstance.scala | 5 ----- .../texera/amber/util/IcebergUtil.scala | 21 +------------------ .../iceberg/IcebergTableWriterSpec.scala | 2 +- 4 files changed, 3 insertions(+), 27 deletions(-) diff --git a/common/config/src/main/resources/storage.conf b/common/config/src/main/resources/storage.conf index a9709f9070d..ac34e1e6b84 100644 --- a/common/config/src/main/resources/storage.conf +++ b/common/config/src/main/resources/storage.conf @@ -21,7 +21,7 @@ storage { # Configuration for Apache Iceberg, used for storing the workflow results & stats iceberg { catalog { - type = rest # either hadoop, rest, or postgres + type = rest # either rest or postgres type = ${?STORAGE_ICEBERG_CATALOG_TYPE} rest { diff --git a/common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/IcebergCatalogInstance.scala b/common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/IcebergCatalogInstance.scala index cd4b3c8796f..6b85c51d2a7 100644 --- a/common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/IcebergCatalogInstance.scala +++ b/common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/IcebergCatalogInstance.scala @@ -44,11 +44,6 @@ object IcebergCatalogInstance { case Some(catalog) => catalog case None => val catalog = StorageConfig.icebergCatalogType match { - case "hadoop" => - IcebergUtil.createHadoopCatalog( - "texera_iceberg", - StorageConfig.fileStorageDirectoryPath - ) case "rest" => IcebergUtil.createRestCatalog( "texera_iceberg", diff --git a/common/workflow-core/src/main/scala/org/apache/texera/amber/util/IcebergUtil.scala b/common/workflow-core/src/main/scala/org/apache/texera/amber/util/IcebergUtil.scala index b8e46e5cc5b..4a725bbb69c 100644 --- a/common/workflow-core/src/main/scala/org/apache/texera/amber/util/IcebergUtil.scala +++ b/common/workflow-core/src/main/scala/org/apache/texera/amber/util/IcebergUtil.scala @@ -21,12 +21,11 @@ package org.apache.texera.amber.util import org.apache.texera.common.config.StorageConfig import org.apache.texera.amber.core.tuple.{Attribute, AttributeType, LargeBinary, Schema, Tuple} -import org.apache.hadoop.conf.Configuration import org.apache.iceberg.catalog.{Catalog, SupportsNamespaces, TableIdentifier} import org.apache.iceberg.data.parquet.GenericParquetReaders import org.apache.iceberg.data.{GenericRecord, Record} import org.apache.iceberg.aws.s3.S3FileIO -import org.apache.iceberg.hadoop.{HadoopCatalog, HadoopFileIO} +import org.apache.iceberg.hadoop.HadoopFileIO import org.apache.iceberg.io.{CloseableIterator, InputFile} import org.apache.iceberg.jdbc.JdbcCatalog import org.apache.iceberg.parquet.{Parquet, ParquetValueReader} @@ -59,7 +58,6 @@ object IcebergUtil { private val LARGE_BINARY_FIELD_SUFFIX = "__texera_large_binary_ptr" /** - * Creates and initializes a HadoopCatalog with the given parameters. * - Uses an empty Hadoop `Configuration`, meaning the local file system (or `file:/`) will be used by default * instead of HDFS. * - The `warehouse` parameter specifies the root directory for storing table data. @@ -67,24 +65,7 @@ object IcebergUtil { * * @param catalogName the name of the catalog. * @param warehouse the root path for the warehouse where the tables are stored. - * @return the initialized HadoopCatalog instance. */ - def createHadoopCatalog( - catalogName: String, - warehouse: Path - ): HadoopCatalog = { - val catalog = new HadoopCatalog() - catalog.setConf(new Configuration) // Empty configuration, defaults to `file:/` - catalog.initialize( - catalogName, - Map( - "warehouse" -> warehouse.toString, - CatalogProperties.FILE_IO_IMPL -> classOf[HadoopFileIO].getName - ).asJava - ) - - catalog - } /** * Creates and initializes a RESTCatalog with the given parameters. diff --git a/common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/result/iceberg/IcebergTableWriterSpec.scala b/common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/result/iceberg/IcebergTableWriterSpec.scala index 5c823924170..d7e83157dbf 100644 --- a/common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/result/iceberg/IcebergTableWriterSpec.scala +++ b/common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/result/iceberg/IcebergTableWriterSpec.scala @@ -45,7 +45,7 @@ class IcebergTableWriterSpec extends AnyFlatSpec with BeforeAndAfterAll { override def beforeAll(): Unit = { warehouseDir = Files.createTempDirectory("iceberg-table-writer-spec") - catalog = IcebergUtil.createHadoopCatalog("writer-spec", warehouseDir) + catalog = IcebergUtil.createPostgresCatalog("writer-spec", warehouseDir) } override def afterAll(): Unit = {