Skip to content

Commit 73afab1

Browse files
address comments
1 parent 33a0e9a commit 73afab1

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/DecorrelateInnerQuery.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ object DecorrelateInnerQuery extends PredicateHelper {
162162
*/
163163
private def replaceOuterInNamedExpressions(
164164
expressions: Seq[NamedExpression],
165-
outerReferenceMap: Map[Attribute, Attribute]): Seq[NamedExpression] = {
165+
outerReferenceMap: AttributeMap[Attribute]): Seq[NamedExpression] = {
166166
expressions.map { expr =>
167167
val newExpr = replaceOuterReference(expr, outerReferenceMap)
168168
if (!newExpr.toAttribute.semanticEquals(expr.toAttribute)) {

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -733,19 +733,19 @@ object OptimizeOneRowRelationSubquery extends Rule[LogicalPlan] {
733733
*/
734734
private def rewrite(plan: LogicalPlan): LogicalPlan = plan.transformUpWithSubqueries {
735735
case LateralJoin(left, right @ LateralSubquery(OneRowSubquery(projectList), _, _, _), _, None)
736-
if right.plan.subqueriesAll.isEmpty && right.joinCond.isEmpty =>
736+
if right.plan.subqueries.isEmpty && right.joinCond.isEmpty =>
737737
Project(left.output ++ projectList, left)
738738
case p: LogicalPlan => p.transformExpressionsUpWithPruning(
739739
_.containsPattern(SCALAR_SUBQUERY)) {
740740
case s @ ScalarSubquery(OneRowSubquery(projectList), _, _, _)
741-
if s.plan.subqueriesAll.isEmpty && s.joinCond.isEmpty =>
741+
if s.plan.subqueries.isEmpty && s.joinCond.isEmpty =>
742742
assert(projectList.size == 1)
743743
projectList.head
744744
}
745745
}
746746

747747
def apply(plan: LogicalPlan): LogicalPlan = {
748-
if (!conf.optimizeOneRowRelationSubquery) {
748+
if (!conf.getConf(SQLConf.OPTIMIZE_ONE_ROW_RELATION_SUBQUERY)) {
749749
plan
750750
} else {
751751
rewrite(plan)

sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4061,8 +4061,6 @@ class SQLConf extends Serializable with Logging {
40614061

40624062
def decorrelateInnerQueryEnabled: Boolean = getConf(SQLConf.DECORRELATE_INNER_QUERY_ENABLED)
40634063

4064-
def optimizeOneRowRelationSubquery: Boolean = getConf(SQLConf.OPTIMIZE_ONE_ROW_RELATION_SUBQUERY)
4065-
40664064
def maxConcurrentOutputFileWriters: Int = getConf(SQLConf.MAX_CONCURRENT_OUTPUT_FILE_WRITERS)
40674065

40684066
def inferDictAsStruct: Boolean = getConf(SQLConf.INFER_NESTED_DICT_AS_STRUCT)

0 commit comments

Comments
 (0)