[GitHub] [spark] viirya commented on a change in pull request #29756: [SPARK-32885][SS] Add DataStreamReader.table API
viirya commented on a change in pull request #29756: URL: https://github.com/apache/spark/pull/29756#discussion_r489203444 ## File path: sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamReader.scala ## @@ -475,6 +476,23 @@ final class DataStreamReader private[sql](sparkSession: SparkSession) extends Lo format("parquet").load(path) } + /** + * Define a Streaming DataFrame on a Table. The DataSource corresponding to the table should + * support streaming mode. Review comment: If the data source doesn't support, what will happen? 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. 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
[GitHub] [spark] viirya commented on a change in pull request #29756: [SPARK-32885][SS] Add DataStreamReader.table API
viirya commented on a change in pull request #29756: URL: https://github.com/apache/spark/pull/29756#discussion_r489197789 ## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/command/views.scala ## @@ -174,7 +174,7 @@ case class CreateViewCommand( def verify(child: LogicalPlan) { child.collect { // Disallow creating permanent views based on temporary views. - case UnresolvedRelation(nameParts, _) if catalog.isTempView(nameParts) => + case UnresolvedRelation(nameParts, _, _) if catalog.isTempView(nameParts) => Review comment: isStreaming = false only? 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. 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
[GitHub] [spark] viirya commented on a change in pull request #29756: [SPARK-32885][SS] Add DataStreamReader.table API
viirya commented on a change in pull request #29756: URL: https://github.com/apache/spark/pull/29756#discussion_r489195938 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ## @@ -942,6 +957,47 @@ class Analyzer( } } + /** + * Replace [[UnresolvedRelation]] with concrete streaming logical plans. + */ + object ResolveStreamingRelation extends Rule[LogicalPlan] { +override def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperatorsUp { + case u: UnresolvedRelation if u.isStreaming => +val res = lookupStreamingRelation(u.multipartIdentifier, u.options) +res.getOrElse(u) +} + +// Look up a relation from the session catalog with the following logic: +// 1) If the resolved catalog is not session catalog, return None. +// 2) If a relation is not found in the catalog, return None. +// 3) If a v1 table is found, create a v1 relation. Otherwise, pass the table to +//UnresolvedStreamingRelation. Review comment: hmm, I don't see `UnresolvedStreamingRelation`, is it missing? 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. 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
[GitHub] [spark] viirya commented on a change in pull request #29756: [SPARK-32885][SS] Add DataStreamReader.table API
viirya commented on a change in pull request #29756: URL: https://github.com/apache/spark/pull/29756#discussion_r489192414 ## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala ## @@ -846,9 +848,9 @@ class Analyzer( */ object ResolveTempViews extends Rule[LogicalPlan] { def apply(plan: LogicalPlan): LogicalPlan = plan.resolveOperatorsUp { - case u @ UnresolvedRelation(ident, _) => + case u @ UnresolvedRelation(ident, _, _) => lookupTempView(ident).getOrElse(u) - case i @ InsertIntoStatement(UnresolvedRelation(ident, _), _, _, _, _) => + case i @ InsertIntoStatement(UnresolvedRelation(ident, _, _), _, _, _, _) => Review comment: We don't need to only match `isStreaming` = false here? 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. 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
[GitHub] [spark] viirya commented on a change in pull request #29756: [SPARK-32885][SS] Add DataStreamReader.table API
viirya commented on a change in pull request #29756: URL: https://github.com/apache/spark/pull/29756#discussion_r488421240 ## File path: sql/core/src/main/scala/org/apache/spark/sql/streaming/DataStreamReader.scala ## @@ -475,6 +476,23 @@ final class DataStreamReader private[sql](sparkSession: SparkSession) extends Lo 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 2.4.0 Review comment: 2.4.0? 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. 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