[
https://issues.apache.org/jira/browse/HIVE-28307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ASF GitHub Bot updated HIVE-28307:
----------------------------------
Labels: pull-request-available (was: )
> Fast return when database exists and IF NOT EXISTS clause is enabled
> --------------------------------------------------------------------
>
> Key: HIVE-28307
> URL: https://issues.apache.org/jira/browse/HIVE-28307
> Project: Hive
> Issue Type: Bug
> Components: Hive
> Reporter: Wechar
> Assignee: Wechar
> Priority: Major
> Labels: pull-request-available
> Attachments: create_database.png, create_table.png
>
>
> When use beeline for testing purpose:
> {code:bash}
> beeline -u jdbc:hive2://
> {code}
> {{CREATE TABLE IF NOT EXISTS}} will not print {{{}AlreadyExistsException{}}},
> but {{CREATE DATABASE IF NOT EXISTS}} will.
> The error log may be confused because the sql actually execute successfully.
>
> The root cause is that {{SemanticAnalyzer}} will fast-return if table exists:
> [https://github.com/apache/hive/blob/98d9d22398370f817fe64449368671b978fff096/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java#L14163-L14174]
--
This message was sent by Atlassian Jira
(v8.20.10#820010)