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

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_r95580538
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateTableHandler.java
 ---
    @@ -67,43 +71,64 @@ public CreateTableHandler(SqlHandlerConfig config, 
Pointer<String> textPlan) {
       @Override
       public PhysicalPlan getPlan(SqlNode sqlNode) throws ValidationException, 
RelConversionException, IOException, ForemanSetupException {
         SqlCreateTable sqlCreateTable = unwrap(sqlNode, SqlCreateTable.class);
    -    final String newTblName = sqlCreateTable.getName();
    +    String originalTableName = sqlCreateTable.getName();
     
         final ConvertedRelNode convertedRelNode = 
validateAndConvert(sqlCreateTable.getQuery());
         final RelDataType validatedRowType = 
convertedRelNode.getValidatedRowType();
         final RelNode queryRelNode = convertedRelNode.getConvertedNode();
     
    -
         final RelNode newTblRelNode =
             SqlHandlerUtil.resolveNewTableRel(false, 
sqlCreateTable.getFieldNames(), validatedRowType, queryRelNode);
     
    +    final String temporaryWorkspace = 
context.getConfig().getString(ExecConstants.DEFAULT_TEMPORARY_WORKSPACE);
    +
         final AbstractSchema drillSchema =
             
SchemaUtilites.resolveToMutableDrillSchema(config.getConverter().getDefaultSchema(),
    -            sqlCreateTable.getSchemaPath());
    -    final String schemaPath = drillSchema.getFullSchemaName();
    +                getSchemaPath(sqlCreateTable, temporaryWorkspace));
    +
    +    boolean isTemporaryWorkspace = 
drillSchema.getFullSchemaName().equals(temporaryWorkspace);
    --- End diff --
    
    Temporary tables names will be case-insensitive. This logic will be covered 
in `UserSession` class. Before storing / looking for / removing original temp 
table name will be converted to lower case.


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

Reply via email to