Skip to content
Open
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 @@ -3190,7 +3190,11 @@ class Analyzer(
throw QueryCompilationErrors.nestedGeneratorError(g.generator)
}
g.copy(generatorOutput =
GeneratorResolution.makeGeneratorOutput(g.generator, g.generatorOutput.map(_.name)))
GeneratorResolution.makeGeneratorOutput(
g.generator, g.generatorOutput.map {
case ua: UnresolvedAttribute => ua.nameParts.head
case a => a.name
}))
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3440,6 +3440,17 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark
checkAnswer(df2, Row(1) :: Nil)
}

test("SPARK-56426: LATERAL VIEW column alias with dot in name should resolve correctly") {
checkAnswer(
sql(
"""
|SELECT id, `skill.inst`
|FROM VALUES (1, array('a', 'b')) AS (id, skills)
|LATERAL VIEW explode(skills) skills_table AS `skill.inst`
""".stripMargin),
Row(1, "a") :: Row(1, "b") :: Nil)
}

test("SPARK-30279 Support 32 or more grouping attributes for GROUPING_ID()") {
withTempView("t") {
sql("CREATE TEMPORARY VIEW t AS SELECT * FROM " +
Expand Down