lyy-pineapple commented on code in PR #43258:
URL: https://github.com/apache/spark/pull/43258#discussion_r1349937372
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala:
##########
@@ -512,4 +513,19 @@ class JDBCTableCatalogSuite extends QueryTest with
SharedSparkSession {
assert(t.schema === replaced)
}
}
+
+ test("SPARK-45449: Cache Invalidation Issue with JDBC Table") {
+ withTable("h2.test.cache_t") {
+ withConnection { conn =>
+ conn.prepareStatement(
+ """CREATE TABLE "test"."cache_t" (id decimal(25) PRIMARY KEY NOT
NULL,
+ |name TEXT(32) NOT NULL)""".stripMargin).executeUpdate()
+ }
+ sql("INSERT OVERWRITE h2.test.cache_t SELECT 1 AS id, 'a' AS name")
+ sql("CACHE TABLE t1 SELECT id, name FROM h2.test.cache_t")
+ val plan = sql("select * from t1").queryExecution.sparkPlan
+ assert(plan.isInstanceOf[InMemoryTableScanExec])
+ sql("UNCACHE TABLE IF EXISTS t1")
Review Comment:
thanks, I has removed it
##########
sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala:
##########
@@ -512,4 +513,19 @@ class JDBCTableCatalogSuite extends QueryTest with
SharedSparkSession {
assert(t.schema === replaced)
}
}
+
+ test("SPARK-45449: Cache Invalidation Issue with JDBC Table") {
+ withTable("h2.test.cache_t") {
+ withConnection { conn =>
+ conn.prepareStatement(
+ """CREATE TABLE "test"."cache_t" (id decimal(25) PRIMARY KEY NOT
NULL,
+ |name TEXT(32) NOT NULL)""".stripMargin).executeUpdate()
+ }
+ sql("INSERT OVERWRITE h2.test.cache_t SELECT 1 AS id, 'a' AS name")
+ sql("CACHE TABLE t1 SELECT id, name FROM h2.test.cache_t")
+ val plan = sql("select * from t1").queryExecution.sparkPlan
+ assert(plan.isInstanceOf[InMemoryTableScanExec])
+ sql("UNCACHE TABLE IF EXISTS t1")
Review Comment:
thanks, I has removed it
--
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]