MaxGekk commented on code in PR #41580:
URL: https://github.com/apache/spark/pull/41580#discussion_r1430137080


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/service/SessionHolder.scala:
##########
@@ -163,6 +170,31 @@ case class SessionHolder(userId: String, sessionId: 
String, session: SparkSessio
       }
     }
   }
+
+  /**
+   * Caches given DataFrame with the ID. The cache does not expire. The entry 
needs to be
+   * explicitly removed by the owners of the DataFrame once it is not needed.
+   */
+  private[connect] def cacheDataFrameById(dfId: String, df: DataFrame): Unit = 
{
+    if (dataFrameCache.putIfAbsent(dfId, df) != null) {
+      SparkException.internalError(s"A dataframe is already associated with id 
$dfId")

Review Comment:
   The `internalError` just creates `SparkException`, so, need to throw it 
apparently. Here is the PR https://github.com/apache/spark/pull/44400 with a 
minor fix of this mistake and another one. 



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