Copilot commented on code in PR #9049:
URL: https://github.com/apache/texera/pull/9049#discussion_r4331147057


##########
sql/updates/52.sql:
##########
@@ -0,0 +1,49 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+-- Names are schema-qualified because the two runners disagree about the 
search path: the
+-- liquibase runner in sql/docker-compose.yml strips `SET search_path` out of 
these files before
+-- applying them, while bin/local-dev.sh keeps it.
+
+\c texera_db

Review Comment:
   `\\c` is a psql meta-command (not valid SQL) and will fail under runners 
that execute the file as plain SQL (e.g., Liquibase JDBC execution). To keep 
this migration portable, remove `\\c` and rely on the database configured by 
the runner; if you need schema targeting, keep schema-qualified object names 
(as you already do) and/or use a SQL-level `SET search_path` only.



##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/workflow/WorkflowExecutionsResource.scala:
##########
@@ -413,6 +413,26 @@ object WorkflowExecutionsResource {
       .execute()
   }
 
+  /**
+    * Updates the row count stored for this port's result in 
operator_port_executions.
+    *
+    * @param eid          Execution ID associated with the result.
+    * @param globalPortId Global port identifier for the operator output.
+    * @param count        Number of rows in the result.
+    */
+  def updateResultCount(
+      eid: ExecutionIdentity,
+      globalPortId: GlobalPortIdentity,
+      count: Long
+  ): Unit = {
+    context
+      .update(OPERATOR_PORT_EXECUTIONS)
+      .set(OPERATOR_PORT_EXECUTIONS.RESULT_COUNT, 
java.lang.Long.valueOf(count))
+      .where(OPERATOR_PORT_EXECUTIONS.WORKFLOW_EXECUTION_ID.eq(eid.id.toInt))
+      
.and(OPERATOR_PORT_EXECUTIONS.GLOBAL_PORT_ID.eq(globalPortId.serializeAsString))
+      .execute()
+  }

Review Comment:
   `result_count` is intentionally nullable (e.g., `SINGLE_SNAPSHOT`), but this 
API only supports setting a non-null value. Consider changing the parameter 
type to `java.lang.Long` (nullable) or `Option[Long]` so callers can explicitly 
clear/leave `RESULT_COUNT` null when appropriate, rather than encoding 
optionality in “don’t call this method”.



-- 
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]

Reply via email to