Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/config/src/main/resources/storage.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -59,32 +58,14 @@ 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.
* - Sets the file I/O implementation to `HadoopFileIO`.
*
* @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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Loading