You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "WweiL (via GitHub)" <gi...@apache.org> on 2023/04/20 21:27:50 UTC
[GitHub] [spark] WweiL commented on a diff in pull request #40887: [SPARK-43144] Scala Client DataStreamReader table() API
WweiL commented on code in PR #40887:
URL: https://github.com/apache/spark/pull/40887#discussion_r1173109006
##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/streaming/DataStreamReader.scala:
##########
@@ -217,6 +217,20 @@ final class DataStreamReader private[sql] (sparkSession: SparkSession) extends L
*/
def parquet(path: String): DataFrame = format("parquet").load(path)
+ /**
+ * Define a Streaming DataFrame on a Table. The DataSource corresponding to the table should
+ * support streaming mode.
+ * @param tableName The name of the table
+ * @since 3.5.0
+ */
+ def table(tableName: String): DataFrame = {
+ require(tableName != null, "The table name can't be null")
+ sparkSession.newDataFrame { builder =>
+ builder.getReadBuilder.setIsStreaming(true).getNamedTableBuilder
Review Comment:
Sure I'll make it multiple lines. For options I thought they are already set in the option method?
https://github.com/apache/spark/blob/ad58f4c99eb9957d8f6bf55aa8dc7f7d48692f31/connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/streaming/DataStreamReader.scala#L82
Here we don't have the `extraOptions` like what did in `DataFrameReader`
--
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-unsubscribe@spark.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org