You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Venky Iyer (JIRA)" <ji...@apache.org> on 2010/01/21 08:20:56 UTC

[jira] Created: (HIVE-1082) "create table if not exists " should check if the specified schema matches the existing schema, and throw an error if it doesnt.

"create table if not exists " should check if the specified  schema matches the existing schema, and throw an error if it doesnt.  
-----------------------------------------------------------------------------------------------------------------------------------

                 Key: HIVE-1082
                 URL: https://issues.apache.org/jira/browse/HIVE-1082
             Project: Hadoop Hive
          Issue Type: Bug
            Reporter: Venky Iyer


I think we should make sure that the table can either be created anew with the specified properties, or it already exists with those properties, where 'properties' includes all metadata except timestamps. Anything else is an error. This makes sense if you think of a table as the name  + its schema, instead of the name alone. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1082) "create table if not exists " should check if the specified schema matches the existing schema, and throw an error if it doesnt.

Posted by "Venky Iyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804735#action_12804735 ] 

Venky Iyer commented on HIVE-1082:
----------------------------------

Talked to Prasad a little more about this:

1) The expectation is that the table that will exist after 'CREATE TABLE IF NOT EXISTS' is a combination of the specified schema + properties, plus the default properties when not specified. We should enforce this
2) Current code may break if we turn this on, so maybe we should have a CREATE TABLE IF NOT EXISTSWITHSCHEMA statement, or a strict mode of some sort.

> "create table if not exists " should check if the specified  schema matches the existing schema, and throw an error if it doesnt.  
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-1082
>                 URL: https://issues.apache.org/jira/browse/HIVE-1082
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Venky Iyer
>
> I think we should make sure that the table can either be created anew with the specified properties, or it already exists with those properties, where 'properties' includes all metadata except timestamps. Anything else is an error. This makes sense if you think of a table as the name  + its schema, instead of the name alone. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1082) "create table if not exists " should check if the specified schema matches the existing schema, and throw an error if it doesnt.

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804744#action_12804744 ] 

Ning Zhang commented on HIVE-1082:
----------------------------------

@venky, I am a little bit confused about the requirement. Do you mean we should allow the following situation: Table T(a int, b string) and table T (a int, b string, c string) exist in the same database? If so, what is the semantics of 'select a, b from T;'?

> "create table if not exists " should check if the specified  schema matches the existing schema, and throw an error if it doesnt.  
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-1082
>                 URL: https://issues.apache.org/jira/browse/HIVE-1082
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Venky Iyer
>
> I think we should make sure that the table can either be created anew with the specified properties, or it already exists with those properties, where 'properties' includes all metadata except timestamps. Anything else is an error. This makes sense if you think of a table as the name  + its schema, instead of the name alone. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1082) "create table if not exists " should check if the specified schema matches the existing schema, and throw an error if it doesnt.

Posted by "Soundararajan Velu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12875569#action_12875569 ] 

Soundararajan Velu commented on HIVE-1082:
------------------------------------------

Venky, have you got this fixed... ?

> "create table if not exists " should check if the specified  schema matches the existing schema, and throw an error if it doesnt.  
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-1082
>                 URL: https://issues.apache.org/jira/browse/HIVE-1082
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Venky Iyer
>
> I think we should make sure that the table can either be created anew with the specified properties, or it already exists with those properties, where 'properties' includes all metadata except timestamps. Anything else is an error. This makes sense if you think of a table as the name  + its schema, instead of the name alone. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1082) "create table if not exists " should check if the specified schema matches the existing schema, and throw an error if it doesnt.

Posted by "Venky Iyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804845#action_12804845 ] 

Venky Iyer commented on HIVE-1082:
----------------------------------

@ning, No, I'm suggesting that CREATE TABLE IF NOT EXISTS should throw an error if a table with the same name but a different schema/properties already exists. 

> "create table if not exists " should check if the specified  schema matches the existing schema, and throw an error if it doesnt.  
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-1082
>                 URL: https://issues.apache.org/jira/browse/HIVE-1082
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Venky Iyer
>
> I think we should make sure that the table can either be created anew with the specified properties, or it already exists with those properties, where 'properties' includes all metadata except timestamps. Anything else is an error. This makes sense if you think of a table as the name  + its schema, instead of the name alone. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1082) "create table if not exists " should check if the specified schema matches the existing schema, and throw an error if it doesnt.

Posted by "Soundararajan Velu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12877769#action_12877769 ] 

Soundararajan Velu commented on HIVE-1082:
------------------------------------------

Thanks Ning, That makes sense, At the moment we have added code to log a WARN, but using Create or replace table is the right approach as you suggest, will update if we get this done..

> "create table if not exists " should check if the specified  schema matches the existing schema, and throw an error if it doesnt.  
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-1082
>                 URL: https://issues.apache.org/jira/browse/HIVE-1082
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Venky Iyer
>
> I think we should make sure that the table can either be created anew with the specified properties, or it already exists with those properties, where 'properties' includes all metadata except timestamps. Anything else is an error. This makes sense if you think of a table as the name  + its schema, instead of the name alone. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1082) "create table if not exists " should check if the specified schema matches the existing schema, and throw an error if it doesnt.

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804859#action_12804859 ] 

Ning Zhang commented on HIVE-1082:
----------------------------------

Venky,  following is what specified in the HiveQL language manual (DDL):

CREATE TABLE creates a table with the given name. An error is thrown if a table or view with the same name already exists. You can use IF NOT EXISTS to skip the error.

So I think what you want is implemented in the plain create table T DDL?


> "create table if not exists " should check if the specified  schema matches the existing schema, and throw an error if it doesnt.  
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-1082
>                 URL: https://issues.apache.org/jira/browse/HIVE-1082
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Venky Iyer
>
> I think we should make sure that the table can either be created anew with the specified properties, or it already exists with those properties, where 'properties' includes all metadata except timestamps. Anything else is an error. This makes sense if you think of a table as the name  + its schema, instead of the name alone. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1082) "create table if not exists " should check if the specified schema matches the existing schema, and throw an error if it doesnt.

Posted by "Ning Zhang (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12875608#action_12875608 ] 

Ning Zhang commented on HIVE-1082:
----------------------------------

this has not been done AFAIK. I had an offline discussion with Venky before and what he want should be implemented using a new synax such as CREATE OR REPLACE TABLE. We should keep the semantics of CREATE TABLE IF NOT EXISTS unchanged since other other users are already using it. Changing the semantics may break their use cases. 

> "create table if not exists " should check if the specified  schema matches the existing schema, and throw an error if it doesnt.  
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-1082
>                 URL: https://issues.apache.org/jira/browse/HIVE-1082
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Venky Iyer
>
> I think we should make sure that the table can either be created anew with the specified properties, or it already exists with those properties, where 'properties' includes all metadata except timestamps. Anything else is an error. This makes sense if you think of a table as the name  + its schema, instead of the name alone. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HIVE-1082) "create table if not exists " should check if the specified schema matches the existing schema, and throw an error if it doesnt.

Posted by "Venky Iyer (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HIVE-1082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12804860#action_12804860 ] 

Venky Iyer commented on HIVE-1082:
----------------------------------

What I want is to create a table if the table doesn't exist already. If it does exist, I want Hive to verify that its schema is identical to the schema I've specified. Basically, at the end of a successful statement, the schema in Hive should be exactly what I specified in the last CREATE TABLE IF NOT EXISTS statement. 

> "create table if not exists " should check if the specified  schema matches the existing schema, and throw an error if it doesnt.  
> -----------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HIVE-1082
>                 URL: https://issues.apache.org/jira/browse/HIVE-1082
>             Project: Hadoop Hive
>          Issue Type: Bug
>            Reporter: Venky Iyer
>
> I think we should make sure that the table can either be created anew with the specified properties, or it already exists with those properties, where 'properties' includes all metadata except timestamps. Anything else is an error. This makes sense if you think of a table as the name  + its schema, instead of the name alone. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.