[
https://issues.apache.org/jira/browse/DRILL-4956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15826228#comment-15826228
]
ASF GitHub Bot commented on DRILL-4956:
---------------------------------------
Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/666#discussion_r96421340
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserSession.java ---
@@ -54,18 +66,41 @@
private Map<String, String> properties;
private OptionManager sessionOptions;
private final AtomicInteger queryCount;
+ private final String sessionId;
+
+ /** Stores list of temporary tables, key is original table name, value
is generated table name. **/
+ private final ConcurrentMap<String, String> temporaryTables;
+ /** Stores list of session temporary locations, key is path to location,
value is file system associated with location. **/
+ private final ConcurrentMap<Path, FileSystem> temporaryLocations;
+
+ /** On session close deletes all session temporary locations
recursively. */
+ @Override
+ public void close() {
+ for (Map.Entry<Path, FileSystem> entry :
temporaryLocations.entrySet()) {
+ Path path = entry.getKey();
+ FileSystem fs = entry.getValue();
+ try {
+ fs.delete(path, true);
+ logger.info("Deleted session temporary location [{}] from file
system [{}]",
+ path.toUri().getPath(), fs.getUri());
+ } catch (Exception e) {
+ logger.debug("Error during session temporary location [{}]
deletion from file system [{}]",
--- End diff --
Changed to warn level. Since files will be dropped any way on file system
close.
> Temporary tables support
> ------------------------
>
> Key: DRILL-4956
> URL: https://issues.apache.org/jira/browse/DRILL-4956
> Project: Apache Drill
> Issue Type: Improvement
> Affects Versions: 1.8.0
> Reporter: Arina Ielchiieva
> Assignee: Arina Ielchiieva
> Labels: doc-impacting
> Fix For: Future
>
>
> Link to design doc -
> https://docs.google.com/document/d/1gSRo_w6q2WR5fPx7SsQ5IaVmJXJ6xCOJfYGyqpVOC-g/edit
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)