aicam commented on code in PR #6860:
URL: https://github.com/apache/texera/pull/6860#discussion_r3778322101


##########
common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/FileResolver.scala:
##########
@@ -76,106 +85,203 @@ object FileResolver {
   }
 
   /**
-    * Parses a dataset logical path into its components, or None if it is not 
a well-formed dataset path.
-    * Expected format: 
/datasets/ownerEmail/datasetName/versionName/fileRelativePath
-    * The legacy unprefixed format is also accepted.
+    * Parses a versioned-resource file path into its components, or None if it 
is not well-formed.
+    *
+    * Two accepted forms:
+    *   - Prefixed:  
/<prefix>/ownerEmail/resourceName/versionName/fileRelativePath (>= 5 segments)
+    *     where the leading segment names a known [[ResourceType]] (dataset, 
model, …), so a single
+    *     caller can dispatch to the right backing table.
+    *   - Legacy unprefixed (datasets only, backward compat): 
/ownerEmail/datasetName/versionName/
+    *     fileRelativePath (>= 4 segments), resolved as a dataset. Models are 
new and always require
+    *     the /models/ prefix.
     *
-    * @param fileName The file path to parse
-    * @return Some((ownerEmail, datasetName, versionName, fileRelativePath)) 
if valid, None otherwise
+    * @param fileName the file path to parse
+    * @return Some((resourceType, ownerEmail, resourceName, versionName, 
fileRelativePath)) if valid,
+    *         None otherwise
     */
-  private def parseDatasetFilePath(
+  private def parsePrefixedPath(
       fileName: String
-  ): Option[(String, String, String, Array[String])] = {
+  ): Option[(ResourceType.Value, String, String, String, Array[String])] = {
     val filePath = Paths.get(fileName)
     val pathSegments = (0 until 
filePath.getNameCount).map(filePath.getName(_).toString).toArray
 
-    // TODO(datasets-prefix): require the prefix once all stored paths are 
migrated (36.sql).

Review Comment:
   Don't we need to this to be backward compatible?



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