mengw15 commented on code in PR #7754:
URL: https://github.com/apache/texera/pull/7754#discussion_r3818915307


##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/warehouse/WarehouseResource.scala:
##########
@@ -131,21 +134,35 @@ class WarehouseResource(client: LakekeeperClient, 
enabled: Boolean) extends Lazy
       throw new WebApplicationException(s"a warehouse named '$name' already 
exists", 409)
     }
 
-    val warehouseName = s"user-$uid-$name"
+    // Never derive the catalog name from `name`: it is also the S3 key prefix 
and a
+    // component of every result URI an execution wrote, so a name-derived one 
could
+    // never change again. Drawing the id up front keeps the creation order 
below
+    // intact. The sequence is looked up rather than named literally -- its 
generated
+    // name is not a stable contract.
+    val whid: Integer = context.fetchValue(
+      DSL.field(
+        "nextval(pg_get_serial_sequence({0}, {1}))",
+        classOf[Integer],
+        
DSL.inline(s"${USER_WAREHOUSE.getSchema.getName}.${USER_WAREHOUSE.getName}"),
+        DSL.inline(USER_WAREHOUSE.WHID.getName)
+      )
+    )

Review Comment:
   Done — extracted `WarehouseResource.drawNextWhid`, shared by `create()` and 
the spec.



##########
amber/src/main/scala/org/apache/texera/web/model/websocket/request/WorkflowExecuteRequest.scala:
##########
@@ -37,6 +37,8 @@ case class WorkflowExecuteRequest(
     workflowSettings: WorkflowSettings,
     emailNotificationEnabled: Boolean,
     computingUnitId: Int,
-    // The user_warehouse this run writes into; absent = the shared default 
warehouse.
+    // The user_warehouse row this run writes into; absent = the shared default
+    // warehouse. (Lakekeeper's own warehouse id is a different, UUID-typed
+    // identifier, always named `lakekeeperWarehouseId`.)

Review Comment:
   Done — reverted; the file is untouched by this branch now.



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