[
https://issues.apache.org/jira/browse/DRILL-5952?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16256563#comment-16256563
]
ASF GitHub Bot commented on DRILL-5952:
---------------------------------------
Github user prasadns14 commented on a diff in the pull request:
https://github.com/apache/drill/pull/1033#discussion_r151613897
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/planner/sql/handlers/CreateTableHandler.java
---
@@ -83,7 +84,20 @@ public PhysicalPlan getPlan(SqlNode sqlNode) throws
ValidationException, RelConv
final DrillConfig drillConfig = context.getConfig();
final AbstractSchema drillSchema = resolveSchema(sqlCreateTable,
config.getConverter().getDefaultSchema(), drillConfig);
- checkDuplicatedObjectExistence(drillSchema, originalTableName,
drillConfig, context.getSession());
+ String schemaPath = drillSchema.getFullSchemaName();
+
+ // Check duplicate object existence
+ boolean isTemporaryTable =
context.getSession().isTemporaryTable(drillSchema, drillConfig,
originalTableName);
--- End diff --
1) Added unit tests for temp tables
2) Implemented for views as well
> Implement "CREATE TABLE IF NOT EXISTS"
> --------------------------------------
>
> Key: DRILL-5952
> URL: https://issues.apache.org/jira/browse/DRILL-5952
> Project: Apache Drill
> Issue Type: Improvement
> Components: SQL Parser
> Affects Versions: 1.11.0
> Reporter: Prasad Nagaraj Subramanya
> Assignee: Prasad Nagaraj Subramanya
> Fix For: Future
>
>
> Currently, if a table/view with the same name exists CREATE TABLE fails with
> VALIDATION ERROR
> Having "IF NOT EXISTS" support for CREATE TABLE will ensure that query
> succeeds
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)