This is an automated email from the ASF dual-hosted git repository.
aglinxinyuan pushed a commit to branch xinyuan-document-factory-exists
in repository https://gitbox.apache.org/repos/asf/texera.git
The following commit(s) were added to
refs/heads/xinyuan-document-factory-exists by this push:
new 771f0ebce2 refactor(storage): inline catalog.tableExists in
documentExists
771f0ebce2 is described below
commit 771f0ebce2f90b14534cc97255f84d1bfeeeb999
Author: Xinyuan Lin <[email protected]>
AuthorDate: Fri May 15 18:03:02 2026 -0700
refactor(storage): inline catalog.tableExists in documentExists
Drops the single-use IcebergUtil.tableExists wrapper and calls
catalog.tableExists directly via TableIdentifier.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
---
.../org/apache/texera/amber/core/storage/DocumentFactory.scala | 5 ++++-
.../src/main/scala/org/apache/texera/amber/util/IcebergUtil.scala | 7 -------
2 files changed, 4 insertions(+), 8 deletions(-)
diff --git
a/common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/DocumentFactory.scala
b/common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/DocumentFactory.scala
index 81f83e58d1..7ec0c04e60 100644
---
a/common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/DocumentFactory.scala
+++
b/common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/DocumentFactory.scala
@@ -27,6 +27,7 @@ import org.apache.texera.amber.core.storage.model._
import org.apache.texera.amber.core.storage.result.iceberg.IcebergDocument
import org.apache.texera.amber.core.tuple.{Schema, Tuple}
import org.apache.texera.amber.util.IcebergUtil
+import org.apache.iceberg.catalog.TableIdentifier
import org.apache.iceberg.data.Record
import org.apache.iceberg.{Schema => IcebergSchema}
@@ -117,7 +118,9 @@ object DocumentFactory {
val (_, _, _, resourceType) = decodeURI(uri)
val storageKey = sanitizeURIPath(uri)
val namespace = resolveNamespace(resourceType)
- IcebergUtil.tableExists(IcebergCatalogInstance.getInstance(),
namespace, storageKey)
+ IcebergCatalogInstance
+ .getInstance()
+ .tableExists(TableIdentifier.of(namespace, storageKey))
case unsupportedScheme =>
throw new UnsupportedOperationException(
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 c7b5c889ca..d6e406a53f 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
@@ -227,13 +227,6 @@ object IcebergUtil {
}
}
- def tableExists(
- catalog: Catalog,
- tableNamespace: String,
- tableName: String
- ): Boolean =
- catalog.tableExists(TableIdentifier.of(tableNamespace, tableName))
-
/**
* Converts a custom Amber `Schema` to an Iceberg `Schema`.
* Field names are encoded to preserve LARGE_BINARY type information.