brkyvz commented on a change in pull request #25507: [SPARK-28667][SQL] Support
InsertInto through the V2SessionCatalog
URL: https://github.com/apache/spark/pull/25507#discussion_r317668630
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/sources/v2/V1WriteFallbackSuite.scala
##########
@@ -68,13 +69,25 @@ class V1WriteFallbackSuite extends QueryTest with
SharedSparkSession with Before
}
class V1WriteFallbackSessionCatalogSuite
- extends SessionCatalogTest[InMemoryTableWithV1Fallback,
V1FallbackTableCatalog] {
+ extends InsertIntoTests(supportsDynamicOverwrite = false, includeSQLTests =
true)
+ with SessionCatalogTest[InMemoryTableWithV1Fallback, V1FallbackTableCatalog]
{
+
override protected val v2Format = classOf[InMemoryV1Provider].getName
override protected val catalogClassName: String =
classOf[V1FallbackTableCatalog].getName
+ override protected val catalogAndNamespace: String = ""
override protected def verifyTable(tableName: String, expected: DataFrame):
Unit = {
checkAnswer(InMemoryV1Provider.getTableData(spark, s"default.$tableName"),
expected)
}
+
+ protected def doInsert(tableName: String, insert: DataFrame, mode:
SaveMode): Unit = {
+ val tmpView = "tmp_view"
+ withTempView(tmpView) {
+ insert.createOrReplaceTempView(tmpView)
+ val overwrite = if (mode == SaveMode.Overwrite) "OVERWRITE" else "INTO"
+ sql(s"INSERT $overwrite TABLE $tableName SELECT * FROM $tmpView")
Review comment:
InsertIntoTests contain both SQL as well as non-sql tests. The tests in
InsertIntoSQLTests are purely SQL, because they test various versions of static
and dynamic partition overwrites.
----------------------------------------------------------------
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]