drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-4956) Temporary tables support
Date Mon, 19 Dec 2016 15:05:59 GMT

    [ https://issues.apache.org/jira/browse/DRILL-4956?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15761366#comment-15761366
] 

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_r91952394
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/rpc/user/UserSession.java
---
    @@ -55,13 +61,37 @@
       private OptionManager sessionOptions;
       private final AtomicInteger queryCount;
     
    +  /** Unique session identifier used as suffix in temporary table names. */
    +  private final String uuid;
    +  /** Cache that stores all temporary tables by schema names. */
    +  private final TemporaryTablesCache temporaryTablesCache;
    +
    +  /** On session close drops all temporary tables from their schemas and clears temporary
tables cache. */
    +  @Override
    +  public void close() {
    +    temporaryTablesCache.removeAll(new BiConsumer<AbstractSchema, String>() {
    +      @Override
    +      public void accept(AbstractSchema schema, String tableName) {
    +        try {
    +          if (schema.isAccessible() && schema.getTable(tableName) != null) {
    +            schema.dropTable(tableName);
    +            logger.info("Temporary table [{}] was dropped from schema [{}]", tableName,
schema.getFullSchemaName());
    +          }
    +        } catch (Exception e) {
    +          logger.info("Problem during temporary table [{}] drop from schema [{}]",
    --- End diff --
    
    Such syntax was used before so I decided not to change it, for example, check TestCTAS.


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

Mime
View raw message