You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by "M.R. Muthukumar" <m_...@yahoo.com> on 2010/11/13 00:23:25 UTC

Question table visibility in hive

Environment Info :

SLES10SP1, Hadoop 0.20.2, Hive 0.6.0

This is the scenario :

1. start hive shell from /root/tmp directory and create a table and quit out of hive.

2. start hive shell from /root directory, show tables does not show the created table, this new
    table is not visible at all.

Can some of you please shed some light on this, is this by design.

Any help is greatly appreciated.

Thanks

-Muthu




      

Re: Question table visibility in hive

Posted by Marcello de Sales <ma...@gmail.com>.
Based on the default hive configuration, different directories called
metastore_db can be created in different locations... If you are prototyping
and trying hive with your peers, it is even worse... Someone creates a
table, others don't see it due to the fact that users are not using the same
metastore_db file... Very annoying side-effect...

You can specify the metastore_db path javax.jdo.option.ConnectionURL... More
information at http://wiki.apache.org/hadoop/Hive/AdminManual/MetastoreAdmin

I preferred to use MySQL as the metastore because it allows different users
to use the CLI interface using the hadoop user through the config... More
information at
http://blog.milford.io/2010/06/installing-apache-hive-with-a-mysql-metastore-in-centos/

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>

<configuration>
<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
</property>
<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
</property>
<property>
  <name>javax.jdo.option.ConnectionUserName</name>
  <value>hadoop</value>
</property>
<property>
  <name>javax.jdo.option.ConnectionPassword</name>
  <value>hadoop</value>
</property>
</configuration>

Before using this configuration, make sure to have installed mysql, created
the user hadoop, granted permissions and started the server...

thanks
Marcello


On Sat, Nov 13, 2010 at 5:40 AM, Pavan <ya...@gmail.com> wrote:

> The default hive configuration makes use of Derby, an embedded derby
> database, for storing metadata. This is usually metastore_db in your
> current directory from where hive is launched [configured via
> javax.jdo.option.ConnectionURL in conf/hive-site.xml]. In the default
> configuration, this metadata is only visible to one user at a time.
>
> If you change directories, it doesn't find metastore_db anymore and
> thus doesn't show up your tables.
>
>
> ~
> Pavan
> ** Sent from Mobile **
>
>
>
> On Sat, Nov 13, 2010 at 4:53 AM, M.R. Muthukumar <m_...@yahoo.com>
> wrote:
> > Environment Info :
> >
> > SLES10SP1, Hadoop 0.20.2, Hive 0.6.0
> >
> > This is the scenario :
> >
> > 1. start hive shell from /root/tmp directory and create a table and quit
> out of hive.
> >
> > 2. start hive shell from /root directory, show tables does not show the
> created table, this new
> >    table is not visible at all.
> >
> > Can some of you please shed some light on this, is this by design.
> >
> > Any help is greatly appreciated.
> >
> > Thanks
> >
> > -Muthu
> >
> >
> >
> >
> >
> >
>

Re: Question table visibility in hive

Posted by Pavan <ya...@gmail.com>.
The default hive configuration makes use of Derby, an embedded derby
database, for storing metadata. This is usually metastore_db in your
current directory from where hive is launched [configured via
javax.jdo.option.ConnectionURL in conf/hive-site.xml]. In the default
configuration, this metadata is only visible to one user at a time.

If you change directories, it doesn't find metastore_db anymore and
thus doesn't show up your tables.


~
Pavan
** Sent from Mobile **



On Sat, Nov 13, 2010 at 4:53 AM, M.R. Muthukumar <m_...@yahoo.com> wrote:
> Environment Info :
>
> SLES10SP1, Hadoop 0.20.2, Hive 0.6.0
>
> This is the scenario :
>
> 1. start hive shell from /root/tmp directory and create a table and quit out of hive.
>
> 2. start hive shell from /root directory, show tables does not show the created table, this new
>    table is not visible at all.
>
> Can some of you please shed some light on this, is this by design.
>
> Any help is greatly appreciated.
>
> Thanks
>
> -Muthu
>
>
>
>
>
>