You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Marc Limotte <ms...@gmail.com> on 2013/01/31 19:42:13 UTC

DROP TABLE does not respect the IF EXISTS clause

Hi,

I'm testing with Hive 0.9.0 (in Amazon EC2, but NOT emr).  I'm experiencing
a problem where DROP TABLE does not respect the IF EXISTS clause, so it
still throws an error when the table doesn't exist and this causes the
script to stop executing.  Here's what it looks like from the hive shell:

hive> DROP TABLE IF EXISTS recalc_aggregate_premium;

FAILED: Error in semantic analysis: Table not found recalc_aggregate_premium


Marc

Re: DROP TABLE does not respect the IF EXISTS clause

Posted by Marc Limotte <ms...@gmail.com>.
Created https://issues.apache.org/jira/browse/HIVE-3973

On Thu, Jan 31, 2013 at 5:02 PM, Mark Grover <gr...@gmail.com>wrote:

> Thanks for the update, Marc. Could you please create a Hive JIRA for this?
> Thanks!
>
> Harsh, it's most likely the case with your JIRA as well that the error
> message is misleading. Thanks for reporting it!
>
> Mark
>
> On Thu, Jan 31, 2013 at 4:58 PM, Marc Limotte <ms...@gmail.com> wrote:
>
>> Thanks, Harsh.   My issues seems to be related to the one-user limitation
>> of the derby metastore.  Once that issue was resolved the "table not found"
>> error went away.  It was just a misleading error message.
>>
>> Marc
>>
>>
>> On Thu, Jan 31, 2013 at 4:40 PM, Harsh J <ha...@cloudera.com> wrote:
>>
>>> Not sure how relevant it is but I faced a similar problem around ALTER
>>> TABLE DROP PARTITION IF EXIST.
>>>
>>> See https://issues.apache.org/jira/browse/HIVE-3576 for the specific
>>> issue and my commands to reproduce it, and also try to perhaps set
>>> hive.exec.drop.ignorenonexistent to true to see if it changes anything
>>> for you?
>>>
>>> On Fri, Feb 1, 2013 at 3:27 AM, Marc Limotte <ms...@gmail.com>
>>> wrote:
>>> > Hi Mark,
>>> >
>>> > A table.  But it doesn't seem to matter.  I get this error on the DROP,
>>> > before even attempting to create a table.  I get the same thing for any
>>> > arbitrary table name.  For example:
>>> >
>>> > hive> DROP TABLE IF EXISTS kdsjhfkjhds;
>>> > FAILED: Error in semantic analysis: Table not found kdsjhfkjhds
>>> >
>>> >
>>> > I think I found something, though.  This install is still using the
>>> Derby
>>> > metastore, and the hive web service is running, so I'm getting errors
>>> like
>>> > "A read-only user or a user in a read-only database…".  I'm guessing
>>> the
>>> > error above is just a consequence of this one-user limitation.  So,
>>> the real
>>> > issue is that the error message reported by "DROP TABLE IF EXISTS" is
>>> > mis-leading and obscures the real problem.
>>> >
>>> >
>>> > thanks,
>>> > Marc
>>> >
>>> > On Thu, Jan 31, 2013 at 11:42 AM, Mark Grover <
>>> grover.markgrover@gmail.com>
>>> > wrote:
>>> >>
>>> >> Marc,
>>> >> It seemed to work on my installation of Hive 0.9. Is this a table or a
>>> >> view you are trying to drop?
>>> >> Mind sharing the create table definition?
>>> >>
>>> >> Mark
>>> >>
>>> >>
>>> >> On Thu, Jan 31, 2013 at 10:42 AM, Marc Limotte <ms...@gmail.com>
>>> >> wrote:
>>> >>>
>>> >>> Hi,
>>> >>>
>>> >>> I'm testing with Hive 0.9.0 (in Amazon EC2, but NOT emr).  I'm
>>> >>> experiencing a problem where DROP TABLE does not respect the IF
>>> EXISTS
>>> >>> clause, so it still throws an error when the table doesn't exist and
>>> this
>>> >>> causes the script to stop executing.  Here's what it looks like from
>>> the
>>> >>> hive shell:
>>> >>>
>>> >>> hive> DROP TABLE IF EXISTS recalc_aggregate_premium;
>>> >>> FAILED: Error in semantic analysis: Table not found
>>> >>> recalc_aggregate_premium
>>> >>>
>>> >>>
>>> >>> Marc
>>> >>>
>>> >>>
>>> >>
>>> >
>>>
>>>
>>>
>>> --
>>> Harsh J
>>>
>>
>>
>

Re: DROP TABLE does not respect the IF EXISTS clause

Posted by Mark Grover <gr...@gmail.com>.
Thanks for the update, Marc. Could you please create a Hive JIRA for this?
Thanks!

Harsh, it's most likely the case with your JIRA as well that the error
message is misleading. Thanks for reporting it!

Mark

On Thu, Jan 31, 2013 at 4:58 PM, Marc Limotte <ms...@gmail.com> wrote:

> Thanks, Harsh.   My issues seems to be related to the one-user limitation
> of the derby metastore.  Once that issue was resolved the "table not found"
> error went away.  It was just a misleading error message.
>
> Marc
>
>
> On Thu, Jan 31, 2013 at 4:40 PM, Harsh J <ha...@cloudera.com> wrote:
>
>> Not sure how relevant it is but I faced a similar problem around ALTER
>> TABLE DROP PARTITION IF EXIST.
>>
>> See https://issues.apache.org/jira/browse/HIVE-3576 for the specific
>> issue and my commands to reproduce it, and also try to perhaps set
>> hive.exec.drop.ignorenonexistent to true to see if it changes anything
>> for you?
>>
>> On Fri, Feb 1, 2013 at 3:27 AM, Marc Limotte <ms...@gmail.com> wrote:
>> > Hi Mark,
>> >
>> > A table.  But it doesn't seem to matter.  I get this error on the DROP,
>> > before even attempting to create a table.  I get the same thing for any
>> > arbitrary table name.  For example:
>> >
>> > hive> DROP TABLE IF EXISTS kdsjhfkjhds;
>> > FAILED: Error in semantic analysis: Table not found kdsjhfkjhds
>> >
>> >
>> > I think I found something, though.  This install is still using the
>> Derby
>> > metastore, and the hive web service is running, so I'm getting errors
>> like
>> > "A read-only user or a user in a read-only database…".  I'm guessing the
>> > error above is just a consequence of this one-user limitation.  So, the
>> real
>> > issue is that the error message reported by "DROP TABLE IF EXISTS" is
>> > mis-leading and obscures the real problem.
>> >
>> >
>> > thanks,
>> > Marc
>> >
>> > On Thu, Jan 31, 2013 at 11:42 AM, Mark Grover <
>> grover.markgrover@gmail.com>
>> > wrote:
>> >>
>> >> Marc,
>> >> It seemed to work on my installation of Hive 0.9. Is this a table or a
>> >> view you are trying to drop?
>> >> Mind sharing the create table definition?
>> >>
>> >> Mark
>> >>
>> >>
>> >> On Thu, Jan 31, 2013 at 10:42 AM, Marc Limotte <ms...@gmail.com>
>> >> wrote:
>> >>>
>> >>> Hi,
>> >>>
>> >>> I'm testing with Hive 0.9.0 (in Amazon EC2, but NOT emr).  I'm
>> >>> experiencing a problem where DROP TABLE does not respect the IF EXISTS
>> >>> clause, so it still throws an error when the table doesn't exist and
>> this
>> >>> causes the script to stop executing.  Here's what it looks like from
>> the
>> >>> hive shell:
>> >>>
>> >>> hive> DROP TABLE IF EXISTS recalc_aggregate_premium;
>> >>> FAILED: Error in semantic analysis: Table not found
>> >>> recalc_aggregate_premium
>> >>>
>> >>>
>> >>> Marc
>> >>>
>> >>>
>> >>
>> >
>>
>>
>>
>> --
>> Harsh J
>>
>
>

Re: DROP TABLE does not respect the IF EXISTS clause

Posted by Marc Limotte <ms...@gmail.com>.
Thanks, Harsh.   My issues seems to be related to the one-user limitation
of the derby metastore.  Once that issue was resolved the "table not found"
error went away.  It was just a misleading error message.

Marc

On Thu, Jan 31, 2013 at 4:40 PM, Harsh J <ha...@cloudera.com> wrote:

> Not sure how relevant it is but I faced a similar problem around ALTER
> TABLE DROP PARTITION IF EXIST.
>
> See https://issues.apache.org/jira/browse/HIVE-3576 for the specific
> issue and my commands to reproduce it, and also try to perhaps set
> hive.exec.drop.ignorenonexistent to true to see if it changes anything
> for you?
>
> On Fri, Feb 1, 2013 at 3:27 AM, Marc Limotte <ms...@gmail.com> wrote:
> > Hi Mark,
> >
> > A table.  But it doesn't seem to matter.  I get this error on the DROP,
> > before even attempting to create a table.  I get the same thing for any
> > arbitrary table name.  For example:
> >
> > hive> DROP TABLE IF EXISTS kdsjhfkjhds;
> > FAILED: Error in semantic analysis: Table not found kdsjhfkjhds
> >
> >
> > I think I found something, though.  This install is still using the Derby
> > metastore, and the hive web service is running, so I'm getting errors
> like
> > "A read-only user or a user in a read-only database…".  I'm guessing the
> > error above is just a consequence of this one-user limitation.  So, the
> real
> > issue is that the error message reported by "DROP TABLE IF EXISTS" is
> > mis-leading and obscures the real problem.
> >
> >
> > thanks,
> > Marc
> >
> > On Thu, Jan 31, 2013 at 11:42 AM, Mark Grover <
> grover.markgrover@gmail.com>
> > wrote:
> >>
> >> Marc,
> >> It seemed to work on my installation of Hive 0.9. Is this a table or a
> >> view you are trying to drop?
> >> Mind sharing the create table definition?
> >>
> >> Mark
> >>
> >>
> >> On Thu, Jan 31, 2013 at 10:42 AM, Marc Limotte <ms...@gmail.com>
> >> wrote:
> >>>
> >>> Hi,
> >>>
> >>> I'm testing with Hive 0.9.0 (in Amazon EC2, but NOT emr).  I'm
> >>> experiencing a problem where DROP TABLE does not respect the IF EXISTS
> >>> clause, so it still throws an error when the table doesn't exist and
> this
> >>> causes the script to stop executing.  Here's what it looks like from
> the
> >>> hive shell:
> >>>
> >>> hive> DROP TABLE IF EXISTS recalc_aggregate_premium;
> >>> FAILED: Error in semantic analysis: Table not found
> >>> recalc_aggregate_premium
> >>>
> >>>
> >>> Marc
> >>>
> >>>
> >>
> >
>
>
>
> --
> Harsh J
>

Re: DROP TABLE does not respect the IF EXISTS clause

Posted by Harsh J <ha...@cloudera.com>.
Not sure how relevant it is but I faced a similar problem around ALTER
TABLE DROP PARTITION IF EXIST.

See https://issues.apache.org/jira/browse/HIVE-3576 for the specific
issue and my commands to reproduce it, and also try to perhaps set
hive.exec.drop.ignorenonexistent to true to see if it changes anything
for you?

On Fri, Feb 1, 2013 at 3:27 AM, Marc Limotte <ms...@gmail.com> wrote:
> Hi Mark,
>
> A table.  But it doesn't seem to matter.  I get this error on the DROP,
> before even attempting to create a table.  I get the same thing for any
> arbitrary table name.  For example:
>
> hive> DROP TABLE IF EXISTS kdsjhfkjhds;
> FAILED: Error in semantic analysis: Table not found kdsjhfkjhds
>
>
> I think I found something, though.  This install is still using the Derby
> metastore, and the hive web service is running, so I'm getting errors like
> "A read-only user or a user in a read-only database…".  I'm guessing the
> error above is just a consequence of this one-user limitation.  So, the real
> issue is that the error message reported by "DROP TABLE IF EXISTS" is
> mis-leading and obscures the real problem.
>
>
> thanks,
> Marc
>
> On Thu, Jan 31, 2013 at 11:42 AM, Mark Grover <gr...@gmail.com>
> wrote:
>>
>> Marc,
>> It seemed to work on my installation of Hive 0.9. Is this a table or a
>> view you are trying to drop?
>> Mind sharing the create table definition?
>>
>> Mark
>>
>>
>> On Thu, Jan 31, 2013 at 10:42 AM, Marc Limotte <ms...@gmail.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> I'm testing with Hive 0.9.0 (in Amazon EC2, but NOT emr).  I'm
>>> experiencing a problem where DROP TABLE does not respect the IF EXISTS
>>> clause, so it still throws an error when the table doesn't exist and this
>>> causes the script to stop executing.  Here's what it looks like from the
>>> hive shell:
>>>
>>> hive> DROP TABLE IF EXISTS recalc_aggregate_premium;
>>> FAILED: Error in semantic analysis: Table not found
>>> recalc_aggregate_premium
>>>
>>>
>>> Marc
>>>
>>>
>>
>



-- 
Harsh J

Re: DROP TABLE does not respect the IF EXISTS clause

Posted by Marc Limotte <ms...@gmail.com>.
Hi Mark,

A table.  But it doesn't seem to matter.  I get this error on the DROP,
before even attempting to create a table.  I get the same thing for any
arbitrary table name.  For example:

hive> DROP TABLE IF EXISTS kdsjhfkjhds;
FAILED: Error in semantic analysis: Table not found kdsjhfkjhds


I think I found something, though.  This install is still using the Derby
metastore, and the hive web service is running, so I'm getting errors like
"A read-only user or a user in a read-only database…".  I'm guessing the
error above is just a consequence of this one-user limitation.  So, the
real issue is that the error message reported by "DROP TABLE IF EXISTS" is
mis-leading and obscures the real problem.


thanks,
Marc

On Thu, Jan 31, 2013 at 11:42 AM, Mark Grover
<gr...@gmail.com>wrote:

> Marc,
> It seemed to work on my installation of Hive 0.9. Is this a table or a
> view you are trying to drop?
> Mind sharing the create table definition?
>
> Mark
>
>
> On Thu, Jan 31, 2013 at 10:42 AM, Marc Limotte <ms...@gmail.com>wrote:
>
>> Hi,
>>
>> I'm testing with Hive 0.9.0 (in Amazon EC2, but NOT emr).  I'm
>> experiencing a problem where DROP TABLE does not respect the IF EXISTS
>> clause, so it still throws an error when the table doesn't exist and this
>> causes the script to stop executing.  Here's what it looks like from the
>> hive shell:
>>
>> hive> DROP TABLE IF EXISTS recalc_aggregate_premium;
>>
>> FAILED: Error in semantic analysis: Table not found
>> recalc_aggregate_premium
>>
>>
>> Marc
>>
>>
>>
>

Re: DROP TABLE does not respect the IF EXISTS clause

Posted by Mark Grover <gr...@gmail.com>.
Marc,
It seemed to work on my installation of Hive 0.9. Is this a table or a view
you are trying to drop?
Mind sharing the create table definition?

Mark

On Thu, Jan 31, 2013 at 10:42 AM, Marc Limotte <ms...@gmail.com> wrote:

> Hi,
>
> I'm testing with Hive 0.9.0 (in Amazon EC2, but NOT emr).  I'm
> experiencing a problem where DROP TABLE does not respect the IF EXISTS
> clause, so it still throws an error when the table doesn't exist and this
> causes the script to stop executing.  Here's what it looks like from the
> hive shell:
>
> hive> DROP TABLE IF EXISTS recalc_aggregate_premium;
>
> FAILED: Error in semantic analysis: Table not found
> recalc_aggregate_premium
>
>
> Marc
>
>
>