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


##########
amber/src/main/scala/org/apache/texera/web/resource/dashboard/user/warehouse/WarehouseResource.scala:
##########


Review Comment:
   Done — reworded: the display name no longer reaches the catalog name or any 
URI.



##########
common/dao/src/test/scala/org/apache/texera/dao/UserWarehouseSpec.scala:
##########


Review Comment:
   Done.



##########
amber/src/test/scala/org/apache/texera/web/resource/dashboard/user/warehouse/WarehouseResourceSpec.scala:
##########


Review Comment:
   Done — shared `squatOnNextMintedName`, which now also derives the sequence 
lookup from jOOQ metadata like production.



##########
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)
+      )
+    )
+    val lakekeeperWarehouseName = s"user-$uid-$whid"

Review Comment:
   Done — `WarehouseResource.lakekeeperWarehouseName(uid, whid)`, used by 
`create()` and the spec.



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