bobbai00 commented on code in PR #9049:
URL: https://github.com/apache/texera/pull/9049#discussion_r4452142603
##########
sql/texera_ddl.sql:
##########
@@ -102,6 +102,7 @@ CREATE TYPE workflow_computing_unit_termination_reason_enum
AS ENUM ('USER_REQUE
CREATE TYPE provider_type_enum AS ENUM ('LOCAL', 'GOOGLE', 'ORCID', 'APPLE');
CREATE TYPE user_warehouse_flavor_enum AS ENUM ('local', 'aws');
CREATE TYPE default_view_enum AS ENUM ('CANVAS', 'FORM');
+CREATE TYPE output_mode_enum AS ENUM ('SET_SNAPSHOT', 'SET_DELTA',
'SINGLE_SNAPSHOT');
Review Comment:
**Advisory:**
This type repeats `OutputMode` from
[workflow.proto:51-60](https://github.com/apache/texera/blob/af143f821760bc243a25e74f600c66e398e5ac2d/common/workflow-core/src/main/protobuf/org/apache/texera/amber/core/workflow.proto#L51-L60)
value for value, and neither definition mentions the other. A new mode needs a
migration here and a case in `toOutputModeEnum`. That match has no catch-all
and amber does not fail on warnings, so a missed case compiles and then throws
`MatchError` in the callback that inserts the port's URI row. A comment on each
definition pointing at the other keeps the next edit from missing one.
##########
amber/src/main/scala/org/apache/texera/web/service/ExecutionResultService.scala:
##########
@@ -442,10 +456,11 @@ class ExecutionResultService(
val opStorage =
DocumentFactory.openDocument(storageUri.get)._1
allTableStats(opId.id) = opStorage.getTableStatistics
- WorkflowExecutionsResource.updateResultSize(
+ WorkflowExecutionsResource.updateResultSizeAndCount(
Review Comment:
**Must fix:**
The column itself is right; the problem is where it is written. This write
only happens while a browser tab is subscribed to the result store.
`StateStore` runs diff handlers once per websocket subscriber, and never
without one
([StateStore.scala:38-46](https://github.com/apache/texera/blob/af143f821760bc243a25e74f600c66e398e5ac2d/amber/src/main/scala/org/apache/texera/web/storage/StateStore.scala#L38-L46)).
So a run that ends after the user leaves the workspace
([workspace.component.ts:220](https://github.com/apache/texera/blob/af143f821760bc243a25e74f600c66e398e5ac2d/frontend/src/app/workspace/component/workspace.component.ts#L220)),
or a sync run with no tab open, keeps a stale `result_count` or none. The new
tests pass only because `new ResultEvents(...)` subscribes first. Moving the
call into `onResultUpdate` (line 544) fixes it: that runs on every poll and
once more when the run ends, with or without a tab, and already computes each
port's count (line 555).
--
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]