[ 
https://issues.apache.org/jira/browse/HIVE-28307?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Denys Kuzmenko updated HIVE-28307:
----------------------------------
    Labels: hive-4.0.1-merged pull-request-available  (was: 
pull-request-available)

> 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: hive-4.0.1-merged, pull-request-available
>             Fix For: 4.1.0
>
>         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)

Reply via email to