mengw15 commented on code in PR #9049:
URL: https://github.com/apache/texera/pull/9049#discussion_r4498473842
##########
amber/src/main/scala/org/apache/texera/web/service/ExecutionResultService.scala:
##########
@@ -92,11 +93,26 @@ object ExecutionResultService {
pojo.setWorkflowExecutionId(executionId.id.toInt)
pojo.setGlobalPortId(evt.globalPortId.serializeAsString)
pojo.setResultUri(evt.uri.toString)
+ pojo.setOutputMode(toOutputModeEnum(evt.mode).orNull)
new OperatorPortExecutionsDao(
SqlServer.getInstance().createDSLContext().configuration()
).insert(pojo)
}
+ /**
+ * The stored form of a port's output mode. Recorded with the URI so that a
finished
+ * execution's results can be listed without the engine's physical plan
(#8994).
+ * output_mode_enum in sql/texera_ddl.sql mirrors OutputMode; a mode
missing from this
+ * match is stored as no mode rather than failing the insert.
+ */
+ private[service] def toOutputModeEnum(mode: OutputMode):
Option[OutputModeEnum] =
+ mode match {
+ case OutputMode.SET_SNAPSHOT => Some(OutputModeEnum.SET_SNAPSHOT)
+ case OutputMode.SET_DELTA => Some(OutputModeEnum.SET_DELTA)
+ case OutputMode.SINGLE_SNAPSHOT => Some(OutputModeEnum.SINGLE_SNAPSHOT)
+ case _ => None
Review Comment:
Today only `Unrecognized` reaches that case, and a declared port can't have
it: every mode is set in code, and nothing parses an `OutputPort`. Done in
828c52d2740c76272cc8f82357cf41d06ad38dbc: it returns the enum and throws on
`Unrecognized`, as `convertWebResultUpdate` does. This replaces the catch-all,
so a mode missing from the match would now fail the run rather than store no
mode; the test walks `OutputMode.values`, so that fails in CI first.
--
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]