File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
sql/hive/src/test/scala/org/apache/spark/sql/hive Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -217,4 +217,13 @@ class HiveQlSuite extends SparkFunSuite with BeforeAndAfterAll {
217
217
|LATERAL VIEW explode(`gentab1`.`gencol1`) `gentab2` AS `gencol2`
218
218
""" .stripMargin)
219
219
}
220
+
221
+ test(" use escaped backticks in output of Generator" ) {
222
+ val plan = parser.parsePlan(
223
+ """ SELECT `gen``tab2`.`gen``col2`
224
+ |FROM `default`.`src`
225
+ |LATERAL VIEW explode(array(array(1, 2, 3))) `gen``tab1` AS `gen``col1`
226
+ |LATERAL VIEW explode(`gen``tab1`.`gen``col1`) `gen``tab2` AS `gen``col2`
227
+ """ .stripMargin)
228
+ }
220
229
}
Original file line number Diff line number Diff line change @@ -262,6 +262,10 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton {
262
262
checkAnswer(
263
263
sql(" SELECT `a`.`ints` FROM nestedArray LATERAL VIEW explode(a.b) `a` AS `ints`" ),
264
264
Row (1 ) :: Row (2 ) :: Row (3 ) :: Nil )
265
+
266
+ checkAnswer(
267
+ sql(" SELECT `weird``tab`.`weird``col` FROM nestedArray LATERAL VIEW explode(a.b) `weird``tab` AS `weird``col`" ),
268
+ Row (1 ) :: Row (2 ) :: Row (3 ) :: Nil )
265
269
}
266
270
267
271
test(" SPARK-4512 Fix attribute reference resolution error when using SORT BY" ) {
You can’t perform that action at this time.
0 commit comments