viirya commented on a change in pull request #31182:
URL: https://github.com/apache/spark/pull/31182#discussion_r567178325



##########
File path: sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala
##########
@@ -1316,6 +1316,30 @@ class CachedTableSuite extends QueryTest with 
SQLTestUtils
     }
   }
 
+  test("SPARK-34269: cache lookup with ORDER BY clause") {
+    withTable("t") {
+      withTempView("v1") {
+        sql("CREATE TABLE t (key bigint, value string) USING parquet")
+        sql("CACHE TABLE v1 AS SELECT * FROM t ORDER BY key")
+
+        val query = sql("SELECT * FROM t ORDER BY key")
+        
assert(spark.sharedState.cacheManager.lookupCachedData(query).isDefined)
+      }
+    }
+  }
+
+  test("SPARK-34269: cache lookup with LIMIT clause") {
+    withTable("t") {
+      withTempView("v1") {
+        sql("CREATE TABLE t (key bigint, value string) USING parquet")
+        sql("CACHE TABLE v1 AS SELECT * FROM t LIMIT 10")
+
+        val query = sql("SELECT * FROM t LIMIT 10")

Review comment:
       Seems two tests can be combined? Only the query is different.




----------------------------------------------------------------
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]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to