LantaoJin opened a new pull request #26543: [SPARK-29911][SQL] Fix cache table 
leak when session closed
URL: https://github.com/apache/spark/pull/26543
 
 
   ### What changes were proposed in this pull request?
   How to reproduce:
   1. create a local temporary view v1
   2. cache it in memory
   3. close session without drop v1.
   The application will hold the memory forever. In a long running thrift 
server scenario. It's worse.
   ```shell
   0: jdbc:hive2://localhost:10000> CACHE TABLE testCacheTable AS SELECT 1;
   CACHE TABLE testCacheTable AS SELECT 1;
   +---------+--+
   | Result  |
   +---------+--+
   +---------+--+
   No rows selected (1.498 seconds)
   0: jdbc:hive2://localhost:10000> !close
   !close
   Closing: 0: jdbc:hive2://localhost:10000
   0: jdbc:hive2://localhost:10000 (closed)> !connect 
'jdbc:hive2://localhost:10000'
   !connect 'jdbc:hive2://localhost:10000'
   Connecting to jdbc:hive2://localhost:10000
   Enter username for jdbc:hive2://localhost:10000:
   lajin
   Enter password for jdbc:hive2://localhost:10000:
   ***
   Connected to: Spark SQL (version 3.0.0-SNAPSHOT)
   Driver: Hive JDBC (version 1.2.1.spark2)
   Transaction isolation: TRANSACTION_REPEATABLE_READ
   1: jdbc:hive2://localhost:10000> select * from testCacheTable;
   select * from testCacheTable;
   Error: Error running query: org.apache.spark.sql.AnalysisException: Table or 
view not found: testCacheTable; line 1 pos 14;
   'Project [*]
   +- 'UnresolvedRelation [testCacheTable] (state=,code=0)
   ```
   <img width="1047" alt="Screen Shot 2019-11-15 at 2 03 49 PM" 
src="https://user-images.githubusercontent.com/1853780/68923527-7ca8c180-07b9-11ea-9cc7-74f276c46840.png";>
   
   
   
   ### Why are the changes needed?
   Resolve memory leak for thrift server
   
   
   ### Does this PR introduce any user-facing change?
   No
   
   
   ### How was this patch tested?
   Manual test in UI storage tab
   

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

Reply via email to