Skip to content

Commit

Permalink
remove redundant constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
edgao committed Dec 16, 2024
1 parent b30724b commit 3e115bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,11 @@ package io.airbyte.integrations.destination.iceberg.v2
import io.airbyte.cdk.load.test.util.DestinationCleaner
import io.airbyte.cdk.load.test.util.IntegrationTest.Companion.isNamespaceOld
import io.airbyte.cdk.load.test.util.IntegrationTest.Companion.randomizedNamespaceRegex
import io.airbyte.integrations.destination.iceberg.v2.io.IcebergUtil
import org.apache.iceberg.catalog.Catalog
import org.apache.iceberg.catalog.Namespace
import org.apache.iceberg.catalog.SupportsNamespaces

class IcebergDestinationCleaner(private val catalog: Catalog) : DestinationCleaner {
constructor(
configuration: IcebergV2Configuration
) : this(
IcebergUtil(SimpleTableIdGenerator()).let { icebergUtil ->
val props = icebergUtil.toCatalogProperties(configuration)
icebergUtil.createCatalog(DEFAULT_CATALOG_NAME, props)
}
)

override fun cleanup() {
val namespaces: List<Namespace> =
(catalog as SupportsNamespaces).listNamespaces().filter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ class IcebergGlueWriteTest :
IcebergV2WriteTest(
Files.readString(IcebergV2TestUtil.GLUE_CONFIG_PATH),
IcebergDestinationCleaner(
IcebergV2TestUtil.parseConfig(IcebergV2TestUtil.GLUE_CONFIG_PATH)
IcebergV2TestUtil.getCatalog(
IcebergV2TestUtil.parseConfig(IcebergV2TestUtil.GLUE_CONFIG_PATH)
)
),
)

Expand Down

0 comments on commit 3e115bc

Please sign in to comment.