Copilot commented on code in PR #5085:
URL: https://github.com/apache/texera/pull/5085#discussion_r3251742128
##########
common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/DocumentFactory.scala:
##########
@@ -103,6 +106,29 @@ object DocumentFactory {
}
}
+ /**
+ * Check whether a document exists at the given URI without opening it.
+ *
+ * Returns true iff the underlying storage already has an entry for this
+ * URI (e.g., an iceberg table at the resolved namespace + storage key).
+ */
+ def documentExists(uri: URI): Boolean = {
+ uri.getScheme match {
+ case VFS_FILE_URI_SCHEME =>
+ val (_, _, _, resourceType) = decodeURI(uri)
+ val storageKey = sanitizeURIPath(uri)
+ val namespace = resolveNamespace(resourceType)
+ IcebergCatalogInstance
+ .getInstance()
+ .tableExists(TableIdentifier.of(namespace, storageKey))
+
Review Comment:
PR description says `documentExists` probes via
`IcebergUtil.loadTableMetadata`, but the implementation now uses
`IcebergCatalogInstance.getInstance().tableExists(TableIdentifier.of(...))`. To
avoid confusion for reviewers/callers, update the PR description/test plan to
match the actual existence check mechanism (catalog `tableExists`).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]