You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Keith Wiley <kw...@keithwiley.com> on 2012/10/18 22:46:22 UTC

Error in semantic analysis: Unable to fetch table

If I run a select command on the command line with -e it works.  If I run the same command inside hive (without -e) it still works...but if I exec it with a -e from php (so obviously the apache user), I get "Error in semantic analysis: Unable to fetch table [tablename]".  Bear in mind that this overall system worked perfectly for weeks.  I haven't modified the code or anything.  What did change was I had to reinstall hadoop and hive and I'm sure some configuration parameter is not correct now.  I found some Google references to this error but no clear-but solutions.

What does this error mean and how do I fix it?

Thanks.

________________________________________________________________________________
Keith Wiley     kwiley@keithwiley.com     keithwiley.com    music.keithwiley.com

"The easy confidence with which I know another man's religion is folly teaches
me to suspect that my own is also."
                                           --  Mark Twain
________________________________________________________________________________


Re: Error in semantic analysis: Unable to fetch table

Posted by Keith Wiley <kw...@keithwiley.com>.
Followup: If I run "show tables" then while I get a list from the command line, I get nothing from php.  Furthermore, if I attempt to select from a bogus tablename on the command line, I get that same error, "semantic error" and whatnot...so it looks like the real problem is that when apache/php runs hive, it doesn't see the table list.

Like I said, this used to work...so I'm sure I need to get something configured properly, I just don't remember how.  I do see that I am defining HIVE_HOME in my .bashrc...Do I need to do something like this for the apache account or as a HIVE parameter?

________________________________________________________________________________
Keith Wiley     kwiley@keithwiley.com     keithwiley.com    music.keithwiley.com

"What I primarily learned in grad school is how much I *don't* know.
Consequently, I left grad school with a higher ignorance to knowledge ratio than
when I entered."
                                           --  Keith Wiley
________________________________________________________________________________


Re: Error in semantic analysis: Unable to fetch table

Posted by Chen Song <ch...@gmail.com>.
Hi Keith

Can you get anything when you run "show databases" from php?

Chen

On Fri, Oct 19, 2012 at 2:48 AM, Keith Wiley <kw...@keithwiley.com> wrote:

> I never needed the -S.  I would just call it with -e, but yeah, that's the
> basic idea.  The output is gathered in the remaining optional arguments to
> exec().
>
> On Oct 18, 2012, at 22:15 , MiaoMiao wrote:
>
> > What php, you are using exec('hive -S -e "select * from some_table"')
> > or something like that in php?
> >
> > On Fri, Oct 19, 2012 at 4:46 AM, Keith Wiley <kw...@keithwiley.com>
> wrote:
> >> If I run a select command on the command line with -e it works.  If I
> run the same command inside hive (without -e) it still works...but if I
> exec it with a -e from php (so obviously the apache user), I get "Error in
> semantic analysis: Unable to fetch table [tablename]".  Bear in mind that
> this overall system worked perfectly for weeks.  I haven't modified the
> code or anything.  What did change was I had to reinstall hadoop and hive
> and I'm sure some configuration parameter is not correct now.  I found some
> Google references to this error but no clear-but solutions.
> >>
> >> What does this error mean and how do I fix it?
> >>
> >> Thanks.
>
>
>
> ________________________________________________________________________________
> Keith Wiley     kwiley@keithwiley.com     keithwiley.com
> music.keithwiley.com
>
> "Luminous beings are we, not this crude matter."
>                                            --  Yoda
>
> ________________________________________________________________________________
>
>


-- 
Chen Song

Re: Error in semantic analysis: Unable to fetch table

Posted by Keith Wiley <kw...@keithwiley.com>.
I never needed the -S.  I would just call it with -e, but yeah, that's the basic idea.  The output is gathered in the remaining optional arguments to exec().

On Oct 18, 2012, at 22:15 , MiaoMiao wrote:

> What php, you are using exec('hive -S -e "select * from some_table"')
> or something like that in php?
> 
> On Fri, Oct 19, 2012 at 4:46 AM, Keith Wiley <kw...@keithwiley.com> wrote:
>> If I run a select command on the command line with -e it works.  If I run the same command inside hive (without -e) it still works...but if I exec it with a -e from php (so obviously the apache user), I get "Error in semantic analysis: Unable to fetch table [tablename]".  Bear in mind that this overall system worked perfectly for weeks.  I haven't modified the code or anything.  What did change was I had to reinstall hadoop and hive and I'm sure some configuration parameter is not correct now.  I found some Google references to this error but no clear-but solutions.
>> 
>> What does this error mean and how do I fix it?
>> 
>> Thanks.


________________________________________________________________________________
Keith Wiley     kwiley@keithwiley.com     keithwiley.com    music.keithwiley.com

"Luminous beings are we, not this crude matter."
                                           --  Yoda
________________________________________________________________________________


Re: Error in semantic analysis: Unable to fetch table

Posted by MiaoMiao <li...@gmail.com>.
What php, you are using exec('hive -S -e "select * from some_table"')
or something like that in php?

On Fri, Oct 19, 2012 at 4:46 AM, Keith Wiley <kw...@keithwiley.com> wrote:
> If I run a select command on the command line with -e it works.  If I run the same command inside hive (without -e) it still works...but if I exec it with a -e from php (so obviously the apache user), I get "Error in semantic analysis: Unable to fetch table [tablename]".  Bear in mind that this overall system worked perfectly for weeks.  I haven't modified the code or anything.  What did change was I had to reinstall hadoop and hive and I'm sure some configuration parameter is not correct now.  I found some Google references to this error but no clear-but solutions.
>
> What does this error mean and how do I fix it?
>
> Thanks.
>
> ________________________________________________________________________________
> Keith Wiley     kwiley@keithwiley.com     keithwiley.com    music.keithwiley.com
>
> "The easy confidence with which I know another man's religion is folly teaches
> me to suspect that my own is also."
>                                            --  Mark Twain
> ________________________________________________________________________________
>