Hi Mark,

  I think 'apache_logs' table created from hive shell and select command is 
executed from 'hive -e'(outside) so the hive shell process is different and 
'hive -e' process is different if derby started in embeded mode(hive by default 
provided embeded derby) it can't see the tables of other processes. 

  Use derby in network server mode then it can work with the tables created 
from other processes.


Hope it helps,
Chinna

----- Original Message -----
From: Mark Kerzner <mark.kerz...@shmsoft.com>
Date: Thursday, September 29, 2011 4:26 am
Subject: Command works inside hive but not outside
To: Hive user <user@hive.apache.org>

> Hi, experts,
> 
> the same command words in hive shell
> 
> add jar WebLogAnalyzer-1.0-SNAPSHOT-jar-with-dependencies.jar; create
> temporary function get_browser as 
> "com.shmsoft.webloganalyzer.GetBrowser";SELECT 
> get_browser(user_agent),  COUNT(get_browser(user_agent)) AS
> NumOccurrences FROM apache_logs GROUP BY get_browser(user_agent);
> 
> but outside,
> 
> hive -e 'add jar WebLogAnalyzer-1.0-SNAPSHOT-jar-with-
> dependencies.jar;create temporary function get_browser as
> "com.shmsoft.webloganalyzer.GetBrowser"; SELECT 
> get_browser(user_agent),COUNT(get_browser(user_agent)) AS 
> NumOccurrences FROM apache_logs GROUP BY
> get_browser(user_agent);'
> 
> it gives me an error
> 
> FAILED: Error in semantic analysis: Unable to fetch table apache_logs
> 
> Thank you,
> Mark
> 

Reply via email to