wengh commented on code in PR #50340: URL: https://github.com/apache/spark/pull/50340#discussion_r2014448291
########## sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/python/PythonDataSourceV2.scala: ########## @@ -52,8 +52,22 @@ class PythonDataSourceV2 extends TableProvider { dataSourceInPython } - def setDataSourceInPython(dataSourceInPython: PythonDataSourceCreationResult): Unit = { - this.dataSourceInPython = dataSourceInPython + private var readInfo: PythonDataSourceReadInfo = _ + def getOrCreateReadInfo( + shortName: String, + options: CaseInsensitiveStringMap, + outputSchema: StructType, + isStreaming: Boolean + ): PythonDataSourceReadInfo = { Review Comment: I'm fairly sure that it doesn't need to be thread safe since `getOrCreateDataSourceInPython` is also non thread-safe. https://github.com/apache/spark/blob/9dd35b5cbd3ab8822731262659ba84bd1a4726d3/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/python/PythonDataSourceV2.scala#L45-L53 From my quick searches online it seems like catalyst is sequential per query? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org