Skip to content
Closed
Show file tree
Hide file tree
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 @@ -71,7 +71,11 @@ private[sql] trait QueryErrorsBase {
}

def toSQLId(parts: Seq[String]): String = {
parts.map(quoteIdentifier).mkString(".")
val cleaned = parts match {
case "__auto_generated_subquery_name" :: rest if rest != Nil => rest
case other => other
}
cleaned.map(quoteIdentifier).mkString(".")
}

def toSQLId(parts: String): String = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ org.apache.spark.sql.AnalysisException
"sqlState" : "42703",
"messageParameters" : {
"objectName" : "`nt2`.`k`",
"proposal" : "`__auto_generated_subquery_name`.`k`, `__auto_generated_subquery_name`.`v1`, `__auto_generated_subquery_name`.`v2`"
"proposal" : "`k`, `v1`, `v2`"
},
"queryContext" : [ {
"objectType" : "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "INCOMPARABLE_PIVOT_COLUMN",
"sqlState" : "42818",
"messageParameters" : {
"columnName" : "`__auto_generated_subquery_name`.`m`"
"columnName" : "`m`"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "INCOMPARABLE_PIVOT_COLUMN",
"sqlState" : "42818",
"messageParameters" : {
"columnName" : "`__auto_generated_subquery_name`.`m`"
"columnName" : "`m`"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ org.apache.spark.sql.AnalysisException
"sqlState" : "42703",
"messageParameters" : {
"objectName" : "`nt2`.`k`",
"proposal" : "`__auto_generated_subquery_name`.`k`, `__auto_generated_subquery_name`.`v1`, `__auto_generated_subquery_name`.`v2`"
"proposal" : "`k`, `v1`, `v2`"
},
"queryContext" : [ {
"objectType" : "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "INCOMPARABLE_PIVOT_COLUMN",
"sqlState" : "42818",
"messageParameters" : {
"columnName" : "`__auto_generated_subquery_name`.`m`"
"columnName" : "`m`"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ org.apache.spark.sql.AnalysisException
"errorClass" : "INCOMPARABLE_PIVOT_COLUMN",
"sqlState" : "42818",
"messageParameters" : {
"columnName" : "`__auto_generated_subquery_name`.`m`"
"columnName" : "`m`"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,13 +486,14 @@ class QueryCompilationErrorsSuite
sqlState = None,
parameters = Map(
"objectName" -> "`v`.`i`",
"proposal" -> "`__auto_generated_subquery_name`.`i`"),
"proposal" -> "`i`"),
context = ExpectedContext(
fragment = "v.i",
start = 7,
stop = 9))

checkAnswer(sql("SELECT __auto_generated_subquery_name.i from (SELECT i FROM v)"), Row(1))
checkAnswer(sql("SELECT i from (SELECT i FROM v)"), Row(1))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ class QueryExecutionErrorsSuite
checkError(
exception = e,
errorClass = "INCOMPARABLE_PIVOT_COLUMN",
parameters = Map("columnName" -> "`__auto_generated_subquery_name`.`map`"),
parameters = Map("columnName" -> "`map`"),
sqlState = "42818")
}

Expand Down