You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by gi...@apache.org on 2026/07/30 07:40:54 UTC

(texera) 01/01: fix(amber, v1.2): surface real cause when output port schema is unavailable (#7104)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/release/v1.2/pr-7104-a9fa9bc091e2a8a3861c0d05586c0ab5c5bece8d
in repository https://gitbox.apache.org/repos/asf/texera.git

commit d3915afe1c81e9d591bba40ffc002a072c9965f2
Author: Yicong Huang <17...@users.noreply.github.com>
AuthorDate: Thu Jul 30 03:40:32 2026 -0400

    fix(amber, v1.2): surface real cause when output port schema is unavailable (#7104)
    
    ### What changes were proposed in this PR?
    
    Backport of #5784 to `release/v1.2`, cherry-picked from
    6433e713a08606eb952581828e8f9c360a763013.
    
    Follows the Direct Backport Push convention; opened as a PR (rather than
    a direct push) as part of a backport-coverage audit for fixes merged to
    `main` since early June that were never labeled for backport.
    
    ### Any related issues, documentation, discussions?
    
    Backport of #5784. Originally linked #3546.
    
    ### How was this PR tested?
    
    Release-branch CI runs once the conflicts are resolved and this PR is
    marked ready for review. The cherry-pick **conflicted** and was
    committed with conflict markers.
    
    ### Was this PR authored or co-authored using generative AI tooling?
    
    Yes — backport prepared with Claude Code (mechanical cherry-pick;
    conflicts left as markers for the original author to resolve; the change
    itself is #5784 by its original author).
    
    Co-authored-by: Tanishq Gandhi <56...@users.noreply.github.com>
---
 .../scheduling/RegionExecutionCoordinator.scala          | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/amber/src/main/scala/org/apache/texera/amber/engine/architecture/scheduling/RegionExecutionCoordinator.scala b/amber/src/main/scala/org/apache/texera/amber/engine/architecture/scheduling/RegionExecutionCoordinator.scala
index 510893e82c..9e30b11e92 100644
--- a/amber/src/main/scala/org/apache/texera/amber/engine/architecture/scheduling/RegionExecutionCoordinator.scala
+++ b/amber/src/main/scala/org/apache/texera/amber/engine/architecture/scheduling/RegionExecutionCoordinator.scala
@@ -609,10 +609,20 @@ class RegionExecutionCoordinator(
         val portBaseURI = portConfig.storageURIBase
         val resultURI = VFSURIFactory.resultURI(portBaseURI)
         val stateURI = VFSURIFactory.stateURI(portBaseURI)
-        val schemaOptional =
-          region.getOperator(outputPortId.opId).outputPorts(outputPortId.portId)._3
         val schema =
-          schemaOptional.getOrElse(throw new IllegalStateException("Schema is missing"))
+          region.getOperator(outputPortId.opId).outputPorts(outputPortId.portId)._3 match {
+            case Right(resolvedSchema) => resolvedSchema
+            case Left(cause)           =>
+              // The output port schema failed to resolve (e.g. a dataset the workflow reads is not
+              // shared with the running user, making its file and inferred schema unavailable).
+              // Surface the underlying cause instead of a generic "Schema is missing" (issue #3546).
+              val reason = Option(cause.getMessage).getOrElse(cause.toString)
+              logger.error(s"Output schema unavailable for port $outputPortId", cause)
+              throw new IllegalStateException(
+                s"Failed to resolve the output schema: $reason",
+                cause
+              )
+          }
         DocumentFactory.createDocument(resultURI, schema)
         DocumentFactory.createDocument(stateURI, State.schema)
         if (!isRestart) {