Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,13 @@ object ViewHelper {
"spark.sql.shuffle.",
"spark.sql.adaptive.")

private val configAllowList = Seq(
SQLConf.DISABLE_HINTS.key
)

private def shouldCaptureConfig(key: String): Boolean = {
!configPrefixDenyList.exists(prefix => key.startsWith(prefix))
configAllowList.exists(prefix => key.equals(prefix)) ||
!configPrefixDenyList.exists(prefix => key.startsWith(prefix))
}

import CatalogTable._
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import org.apache.spark.sql._
import org.apache.spark.sql.catalyst.TableIdentifier
import org.apache.spark.sql.catalyst.analysis.NoSuchTableException
import org.apache.spark.sql.catalyst.parser.ParseException
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 @@ -909,4 +910,17 @@ 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
)
}
}
}
}