anishshri-db commented on code in PR #54373:
URL: https://github.com/apache/spark/pull/54373#discussion_r2849138774


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/streaming/StreamingSourceIdentifyingName.scala:
##########
@@ -47,6 +47,30 @@ sealed trait StreamingSourceIdentifyingName {
     case FlowAssigned(name) => s"""name="$name""""
     case Unassigned => "name=<Unassigned>"
   }
+
+  /**
+   * Returns this instance only if it's a user-provided name.
+   * DataSource requires explicitly user-provided names, not flow-assigned or 
unassigned sources.
+   *
+   * @return Some(UserProvided) if user-provided, None otherwise
+   */
+  def toUserProvided: Option[UserProvided] = this match {
+    case up: UserProvided => Some(up)
+    case _ => None
+  }
+
+  /**
+   * Returns the name string if this source has been assigned a name.
+   * Used when both user-provided and flow-assigned names should be treated 
the same
+   * (e.g., for metadata paths and source ID mapping).
+   *
+   * @return Some(name) if UserProvided or FlowAssigned, None if Unassigned

Review Comment:
   similar as above



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to