You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/06 09:05:03 UTC

[GitHub] [spark] xuanyuanking commented on a change in pull request #30148: [SPARK-33244][SS] Block reading streaming temp view via `spark.table` API

xuanyuanking commented on a change in pull request #30148:
URL: https://github.com/apache/spark/pull/30148#discussion_r518612218



##########
File path: sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -2837,6 +2837,14 @@ object SQLConf {
       .booleanConf
       .createWithDefault(false)
 
+  val LEGACY_ALLOW_READ_STREAMING_TEMP_VIEW =
+    buildConf("spark.sql.legacy.allowReadStreamingTempView")

Review comment:
       Thanks, done in 2131507

##########
File path: sql/core/src/main/scala/org/apache/spark/sql/DataFrameReader.scala
##########
@@ -831,6 +831,15 @@ class DataFrameReader private[sql](sparkSession: SparkSession) extends Logging {
    */
   def table(tableName: String): DataFrame = {
     assertNoSpecifiedSchema("table")
+    val isStreamingTempView =
+      sparkSession.sessionState.catalog.getTempView(tableName).exists(_.isStreaming) ||
+        sparkSession.sessionState.catalog.getGlobalTempView(tableName).exists(_.isStreaming)
+    if (!SQLConf.get.getConf(SQLConf.LEGACY_ALLOW_READ_STREAMING_TEMP_VIEW)
+        && isStreamingTempView) {
+      throw new UnsupportedOperationException("Using `spark.table` or `spark.read.table` to " +

Review comment:
       Thanks, done in 2131507




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org