Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move
  • Loading branch information
ulysses-you committed Mar 4, 2021
commit 66ef82fe09ad715097e3068631b62ebdf5871c49
Original file line number Diff line number Diff line change
Expand Up @@ -910,17 +910,4 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils {
}
}
}

test("SPARK-34613: Fix view does not capture disable hint config") {
withSQLConf(DISABLE_HINTS.key -> "true") {
withView("v1") {
sql("CREATE VIEW v1 AS SELECT /*+ repartition(1) */ 1")
assert(
sql("SELECT * FROM v1").queryExecution.analyzed.collect {
case e: Repartition => e
}.isEmpty
)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package org.apache.spark.sql.execution

import org.apache.spark.sql.{AnalysisException, QueryTest, Row}
import org.apache.spark.sql.catalyst.plans.logical.Repartition
import org.apache.spark.sql.internal.SQLConf._
import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils}

Expand Down Expand Up @@ -278,6 +279,19 @@ abstract class SQLViewTestSuite extends QueryTest with SQLTestUtils {
}
}
}

test("SPARK-34613: Fix view does not capture disable hint config") {
withSQLConf(DISABLE_HINTS.key -> "true") {
withView("v1") {
sql("CREATE VIEW v1 AS SELECT /*+ repartition(1) */ 1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's follow other tests in this suite and use createView, which can test all 3 different view types.

assert(
sql("SELECT * FROM v1").queryExecution.analyzed.collect {
case e: Repartition => e
}.isEmpty
)
}
}
}
}

class LocalTempViewTestSuite extends SQLViewTestSuite with SharedSparkSession {
Expand Down