Skip to content

Commit 4753310

Browse files
wForgetulysses-you
authored andcommitted
[KYUUBI #1674] Uncache cached tables when session closed
<!-- Thanks for sending a pull request! Here are some tips for you: 1. If this is your first time, please read our contributor guidelines: https://kyuubi.readthedocs.io/en/latest/community/contributions.html 2. If the PR is related to an issue in https://github.com/apache/incubator-kyuubi/issues, add '[KYUUBI #XXXX]' in your PR title, e.g., '[KYUUBI #XXXX] Your PR title ...'. 3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][KYUUBI #XXXX] Your PR title ...'. --> ### _Why are the changes needed?_ <!-- Please clarify why the changes are needed. For instance, 1. If you add a feature, you can talk about the use case of it. 2. If you fix a bug, you can clarify why it is a bug. --> As mentioned in SPARK-29911 , there may also be memory leaks in kyuubi. #1674 ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [X] Add screenshots for manual tests if appropriate ![微信截图_20220104145456](https://user-images.githubusercontent.com/17894939/148021323-9f3e4268-ff54-4ad3-bb7e-2044d73ae154.png) close session: ![微信截图_20220104145530](https://user-images.githubusercontent.com/17894939/148021331-2a816934-2c07-47dd-b939-01117f93bb5b.png) - [X] [Run test](https://kyuubi.readthedocs.io/en/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #1676 from wForget/KYUUBI-1674. Closes #1674 e2bec4e [Wang Zhen] [KYUUBI-1674] Uncache cached tables when session closed Authored-by: Wang Zhen <wangzhen07@qiyi.com> Signed-off-by: ulysses-you <ulyssesyou@apache.org>
1 parent 4655cd8 commit 4753310

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

externals/kyuubi-spark-sql-engine/src/main/scala/org/apache/kyuubi/engine/spark/session/SparkSessionImpl.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class SparkSessionImpl(
6969
sessionEvent.endTime = System.currentTimeMillis()
7070
EventLoggingService.onEvent(sessionEvent)
7171
super.close()
72+
spark.sessionState.catalog.getTempViewNames().foreach(spark.catalog.uncacheTable(_))
7273
sessionManager.operationManager.asInstanceOf[SparkSQLOperationManager].closeILoop(handle)
7374
}
7475

0 commit comments

Comments
 (0)