tanishqgandhi1908 commented on code in PR #5784:
URL: https://github.com/apache/texera/pull/5784#discussion_r3444473966
##########
amber/src/main/scala/org/apache/texera/amber/engine/architecture/scheduling/RegionExecutionCoordinator.scala:
##########
@@ -572,10 +572,18 @@ 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).
+ throw new IllegalStateException(
+ s"Failed to resolve the output schema: ${cause.getMessage}",
+ cause
+ )
+ }
Review Comment:
both addressed in the latest push -
Null getMessage: the message now uses
Option(cause.getMessage).getOrElse(cause.toString), so a cause without a
message (e.g. an NPE) surfaces its class name instead of "…: null". Added a
regression test (fall back to the throwable's string form when the cause has no
message) that asserts this.
Failing port id: I kept it out of the user-facing message on purpose, the
raw GlobalPortIdentity(...) is developer detail and this error already surfaces
at the workflow level in the UI. Instead it's now logged server-side via
logger.error(s"Output schema unavailable for port $outputPortId", cause)
--
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]