Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-51357][SQL] Preserve plan change logging level for views #50118

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all 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 @@ -17,11 +17,13 @@

package org.apache.spark.sql.catalyst.analysis

import org.apache.spark.sql.catalyst.SQLConfHelper
import org.apache.spark.sql.catalyst.catalog.CatalogTable
import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, View}
import org.apache.spark.sql.errors.QueryCompilationErrors
import org.apache.spark.sql.internal.SQLConf

object ViewResolution {
object ViewResolution extends SQLConfHelper {
def resolve(
view: View,
resolveChild: LogicalPlan => LogicalPlan,
Expand All @@ -41,7 +43,7 @@ object ViewResolution {
view
)
}
SQLConf.withExistingConf(View.effectiveSQLConf(view.desc.viewSQLConfigs, view.isTempView)) {
SQLConf.withExistingConf(ViewResolution.getViewResolutionConf(view.desc, view.isTempView)) {
resolveChild(view.child)
}
}
Expand All @@ -52,4 +54,12 @@ object ViewResolution {

view.copy(child = newChild)
}

def getViewResolutionConf(viewDescription: CatalogTable, isTempView: Boolean): SQLConf = {
var viewSQLConfigs = viewDescription.viewSQLConfigs ++ Map(
SQLConf.PLAN_CHANGE_LOG_LEVEL.key -> conf.planChangeLogLevel,
SQLConf.EXPRESSION_TREE_CHANGE_LOG_LEVEL.key -> conf.expressionTreeChangeLogLevel
)
View.effectiveSQLConf(viewSQLConfigs, isTempView)
}
}