maropu commented on a change in pull request #28239: [SPARK-31467][SQL][TEST]
Refactor the tests in hive/SQLQuerySuite to prevent TableAlreadyExistsException
URL: https://github.com/apache/spark/pull/28239#discussion_r410762469
##########
File path:
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala
##########
@@ -898,33 +913,39 @@ class SQLQuerySuite extends QueryTest with SQLTestUtils
with TestHiveSingleton {
}
test("resolve udtf in projection #1") {
- val ds = (1 to 5).map(i => s"""{"a":[$i, ${i + 1}]}""").toDS()
- read.json(ds).createOrReplaceTempView("data")
- val df = sql("SELECT explode(a) AS val FROM data")
- val col = df("val")
+ withTempView("data") {
+ val ds = (1 to 5).map(i => s"""{"a":[$i, ${i + 1}]}""").toDS()
+ read.json(ds).createOrReplaceTempView("data")
+ val df = sql("SELECT explode(a) AS val FROM data")
+ val col = df("val")
Review comment:
(Not related to this pr though), `col` not used?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]