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 Tue, 06 Dec 2016 06:12:59 GMT

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

ASF GitHub Bot commented on DRILL-4956:
---------------------------------------

Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/666#discussion_r90697836
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateTableHandler.java
---
    @@ -242,4 +244,40 @@ private RexNode composeDisjunction(final RexBuilder rexBuilder, List<RexNode>
co
         return node;
       }
     
    +  /**
    +   * Gets schema path defined in create table statement.
    +   * If temporary table and schema is not indicated,
    +   * set default temporary workspace.
    +   *
    +   * @param sqlCreateTable create table call
    +   * @return table schema path
    +   */
    +  private List<String> getSchemaPath(SqlCreateTable sqlCreateTable) {
    +    List<String> indicatedSchemaPath = sqlCreateTable.getSchemaPath();
    +    if (sqlCreateTable.isTemporary() && indicatedSchemaPath.size() == 0) {
    +      indicatedSchemaPath = Lists.newArrayList();
    +      indicatedSchemaPath.add(context.getConfig().getString(ExecConstants.DEFAULT_TEMPORARY_WORKSPACE));
    +    }
    +    return indicatedSchemaPath;
    +  }
    +
    +  /**
    +   * Checks if any object (persistent table / temporary table / view)
    +   * with the same name as table to be created exists in indicated schema.
    +   *
    +   * @param drillSchema schema where table will be created
    +   * @param tableName table name
    +   * @throws UserException if duplicate is found
    +   */
    +  private void checkDuplicatedObjectExistence(AbstractSchema drillSchema, String tableName)
{
    --- End diff --
    
    We check for a duplicated table here. The plan will soon execute. But, two such plans
might run in parallel. Do we do another check at the time we try to create the table to catch
the case race conditions in which the table was created between this check and actual run?



> 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: Paul Rogers
>              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