cloud-fan commented on code in PR #45176:
URL: https://github.com/apache/spark/pull/45176#discussion_r1495266708


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/catalog/SessionCatalog.scala:
##########
@@ -206,6 +206,17 @@ class SessionCatalog(
     builder.build[QualifiedTableName, LogicalPlan]()
   }
 
+  private val v2TableCache: Cache[QualifiedTableName, Table] = {
+    // Use the same cache size as V1 table cache.
+    var builder = CacheBuilder.newBuilder().maximumSize(cacheSize)
+
+    if (cacheTTL > 0) {
+      builder = builder.expireAfterWrite(cacheTTL, TimeUnit.SECONDS)
+    }
+
+    builder.build[QualifiedTableName, Table]()

Review Comment:
   shall we only cache the `TableProvider`? I'm afraid this cache may cause 
data staleness as the table schema will never change now.



-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to