vinodkc commented on code in PR #55444:
URL: https://github.com/apache/spark/pull/55444#discussion_r3717372070
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala:
##########
@@ -563,30 +563,34 @@ abstract class SQLQuerySuiteBase extends QueryTest with
SQLTestUtils with TestHi
}
test("SPARK-28551: CTAS Hive Table should be with non-existent or empty
location") {
Review Comment:
The `ifNotExists = false` arm in the new loop is identical to what the test
already covered before this PR — those permutations pass without any code
change. Could you instead keep the SPARK-28551 test untouched and move the IF
NOT EXISTS coverage into the new standalone SPARK-56558 test? That would keep
the existing test clean and avoid running 4 redundant permutations.
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala:
##########
@@ -595,6 +599,31 @@ abstract class SQLQuerySuiteBase extends QueryTest with
SQLTestUtils with TestHi
}
}
+ test("SPARK-56558: CTAS IF NOT EXISTS skips execution when table exists, " +
Review Comment:
This test passes even without the fix since ctas2 already exists in the
catalog and returns early before hitting assertEmptyRootPath. Could you add a
test where the table does not exist in the catalog yet, so it directly
validates the bug fix?
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala:
##########
@@ -595,6 +599,31 @@ abstract class SQLQuerySuiteBase extends QueryTest with
SQLTestUtils with TestHi
}
}
+ test("SPARK-56558: CTAS IF NOT EXISTS skips execution when table exists, " +
Review Comment:
The PR only adds Hive CTAS tests. The DataSource CTAS path
(CreateDataSourceTableAsSelectCommand) has the same bug and need a test for it
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala:
##########
@@ -595,6 +599,31 @@ abstract class SQLQuerySuiteBase extends QueryTest with
SQLTestUtils with TestHi
}
}
+ test("SPARK-56558: CTAS IF NOT EXISTS skips execution when table exists, " +
Review Comment:
- Test Name is misleading, "skips execution when table exists" is existing
correct behavior, not the bug fix.
- No assertion on table contents. It should verify ctas2's data was
unchanged after the CTAS IF NOT EXISTS, not just that no exception was thrown.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]