HyukjinKwon commented on code in PR #44233:
URL: https://github.com/apache/spark/pull/44233#discussion_r1419781456
##########
sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamReader.scala:
##########
@@ -156,8 +156,11 @@ final class DataStreamReader private[sql](sparkSession:
SparkSession) extends Lo
extraOptions + ("path" -> path.get)
}
- val ds = DataSource.lookupDataSource(source,
sparkSession.sessionState.conf).
- getConstructor().newInstance()
+ val ds = DataSource.lookupDataSource(source,
sparkSession.sessionState.conf) match {
+ case cls if classOf[PythonTableProvider].isAssignableFrom(cls) =>
+ cls.getConstructor(classOf[String]).newInstance(source)
+ case cls => cls.getDeclaredConstructor().newInstance()
+ }
Review Comment:
SGTM
--
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]