You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by Praseetha Krishnamurthy <pr...@oracle.com> on 2015/02/28 18:29:23 UTC

Adding A Table In HIVE Does Not Create A Table On Mysql Which Is The Metastore

 

 

Hi,

 

I have configured remote metastore(mysql) for hive.

I created a table in hive using oozie. But still 'select * from TBLS' remains empty.

The oozie job is successful. No errors are thrown in the log. But not able to see any info in mysql metastore.

The configuration details are given below,

Hive-site.xml

<!--

  Licensed to the Apache Software Foundation (ASF) under one or more

  contributor license agreements.  See the NOTICE file distributed with

  this work for additional information regarding copyright ownership.

  The ASF licenses this file to You under the Apache License, Version 2.0

  (the "License"); you may not use this file except in compliance with

  the License.  You may obtain a copy of the License at

 

      http://www.apache.org/licenses/LICENSE-2.0

 

  Unless required by applicable law or agreed to in writing, software

  distributed under the License is distributed on an "AS IS" BASIS,

  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

  See the License for the specific language governing permissions and

  limitations under the License.

-->

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

 

<configuration>

  

<!-- Hive Configuration can either be stored in this file or in the hadoop configuration files  -->

<!-- that are implied by Hadoop setup variables.                                                -->

<!-- Aside from Hadoop setup variables - this file is provided as a convenience so that Hive    -->

<!-- users do not have to edit hadoop configuration files (that may be managed as a centralized -->

<!-- resource).                                                                                 -->

  

<!-- Hive Execution Parameters -->

 

<property>

  <name>javax.jdo.option.ConnectionURL</name>

      <value>jdbc:mysql://localhost:3306/metastore</value>

  <description>JDBC connect string for a JDBC metastore</description>

</property>

 

<property>

  <name>javax.jdo.option.ConnectionDriverName</name>

      <value>com.mysql.jdbc.Driver</value>

  <description>Driver class name for a JDBC metastore</description>

</property>

<property>

<name>javax.jdo.option.ConnectionUserName</name>

  <value>hive</value>

</property>

 

<property>

  <name>javax.jdo.option.ConnectionPassword</name>

  <value>welcome1</value>

</property>

<property>

  <name>datanucleus.autoCreateSchema</name>

  <value>true</value>

</property>

 

<property>

  <name>datanucleus.fixedDatastore</name>

  <value>true</value>

</property>

 

<property>

  <name>datanucleus.autoStartMechanism</name>

  <value>SchemaTable</value>

</property>

 

<property>

  <name>hive.metastore.uris</name>

  <value>thrift://localhost:9083</value>

  <description>IP address (or fully-qualified domain name) and port of the metastore host</description>

</property>

</configuration>

~                          

 

Workflow.xml

<workflow-app xmlns="uri:oozie:workflow:0.4" name="hive-wf">

    <start to="hive-node"/>

    <action name="hive-node">

        <hive xmlns="uri:oozie:hive-action:0.2">

        <job-tracker>${jobTracker}</job-tracker>

        <name-node>${nameNode}</name-node>

        <job-xml>hive-site.xml</job-xml>

            <configuration>

                <property>

                    <name>mapred.job.queue.name</name>

                    <value>default</value>

                </property>

            </configuration>

            <script>script.hql</script>

<!--            <param>INPUT_PATH=${inputPath}</param> -->

        </hive>

        <ok to="end"/>

        <error to="fail"/>

    </action>

 

    <kill name="fail">

        <message>Hive failed, error message[${wf:errorMessage(wf:lastErrorNode())}]</message>

    </kill>

    <end name="end"/>

</workflow-app>

~                   

Job.properties

nameNode=hdfs://localhost:8020

jobTracker=localhost:8032

oozie.wf.application.path=${nameNode}/user/poc

oozie.libpath=${nameNode}/user/oozie/share/lib/

oozie.use.system.libpath=true

~

 

mysql                              

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema | 

| metastore          | 

+--------------------+

2 rows in set (0.00 sec)

 

Script.hql

Create table test(id STRING, name STRING);

 

Thanks & Regards,

Praseetha

Re: Adding A Table In HIVE Does Not Create A Table On Mysql Which Is The Metastore

Posted by Alan Gates <al...@gmail.com>.
Your hive-site.xml referenced a metastore service at localhost:9083.  
Did you start it with this same hive-site.xml?

Alan.

> Praseetha Krishnamurthy <ma...@oracle.com>
> February 28, 2015 at 9:29
>
>
>
>
> Hi,
>
>
>
> I have configured remote metastore(mysql) for hive.
>
> I created a table in hive using oozie. But still 'select * from TBLS' 
> remains empty.
>
> The oozie job is successful. No errors are thrown in the log. But not 
> able to see any info in mysql metastore.
>
> The configuration details are given below,
>
> Hive-site.xml
>
> <!--
>
> Licensed to the Apache Software Foundation (ASF) under one or more
>
> contributor license agreements. See the NOTICE file distributed with
>
> this work for additional information regarding copyright ownership.
>
> The ASF licenses this file to You under the Apache License, Version 2.0
>
> (the "License"); you may not use this file except in compliance with
>
> the License. You may obtain a copy of the License at
>
>
>
> http://www.apache.org/licenses/LICENSE-2.0
>
>
>
> Unless required by applicable law or agreed to in writing, software
>
> distributed under the License is distributed on an "AS IS" BASIS,
>
> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
>
> See the License for the specific language governing permissions and
>
> limitations under the License.
>
> -->
>
> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
>
>
>
> <configuration>
>
>
>
> <!-- Hive Configuration can either be stored in this file or in the 
> hadoop configuration files -->
>
> <!-- that are implied by Hadoop setup variables. -->
>
> <!-- Aside from Hadoop setup variables - this file is provided as a 
> convenience so that Hive -->
>
> <!-- users do not have to edit hadoop configuration files (that may be 
> managed as a centralized -->
>
> <!-- resource). -->
>
>
>
> <!-- Hive Execution Parameters -->
>
>
>
> <property>
>
> <name>javax.jdo.option.ConnectionURL</name>
>
> <value>jdbc:mysql://localhost:3306/metastore</value>
>
> <description>JDBC connect string for a JDBC metastore</description>
>
> </property>
>
>
>
> <property>
>
> <name>javax.jdo.option.ConnectionDriverName</name>
>
> <value>com.mysql.jdbc.Driver</value>
>
> <description>Driver class name for a JDBC metastore</description>
>
> </property>
>
> <property>
>
> <name>javax.jdo.option.ConnectionUserName</name>
>
> <value>hive</value>
>
> </property>
>
>
>
> <property>
>
> <name>javax.jdo.option.ConnectionPassword</name>
>
> <value>welcome1</value>
>
> </property>
>
> <property>
>
> <name>datanucleus.autoCreateSchema</name>
>
> <value>true</value>
>
> </property>
>
>
>
> <property>
>
> <name>datanucleus.fixedDatastore</name>
>
> <value>true</value>
>
> </property>
>
>
>
> <property>
>
> <name>datanucleus.autoStartMechanism</name>
>
> <value>SchemaTable</value>
>
> </property>
>
>
>
> <property>
>
> <name>hive.metastore.uris</name>
>
> <value>thrift://localhost:9083</value>
>
> <description>IP address (or fully-qualified domain name) and port of 
> the metastore host</description>
>
> </property>
>
> </configuration>
>
> ~
>
>
>
> Workflow.xml
>
> <workflow-app xmlns="uri:oozie:workflow:0.4" name="hive-wf">
>
> <start to="hive-node"/>
>
> <action name="hive-node">
>
> <hive xmlns="uri:oozie:hive-action:0.2">
>
> <job-tracker>${jobTracker}</job-tracker>
>
> <name-node>${nameNode}</name-node>
>
> <job-xml>hive-site.xml</job-xml>
>
> <configuration>
>
> <property>
>
> <name>mapred.job.queue.name</name>
>
> <value>default</value>
>
> </property>
>
> </configuration>
>
> <script>script.hql</script>
>
> <!-- <param>INPUT_PATH=${inputPath}</param> -->
>
> </hive>
>
> <ok to="end"/>
>
> <error to="fail"/>
>
> </action>
>
>
>
> <kill name="fail">
>
> <message>Hive failed, error 
> message[${wf:errorMessage(wf:lastErrorNode())}]</message>
>
> </kill>
>
> <end name="end"/>
>
> </workflow-app>
>
> ~
>
> Job.properties
>
> nameNode=hdfs://localhost:8020
>
> jobTracker=localhost:8032
>
> oozie.wf.application.path=${nameNode}/user/poc
>
> oozie.libpath=${nameNode}/user/oozie/share/lib/
>
> oozie.use.system.libpath=true
>
> ~
>
>
>
> mysql
>
> mysql> show databases;
>
> +--------------------+
>
> | Database |
>
> +--------------------+
>
> | information_schema |
>
> | metastore |
>
> +--------------------+
>
> 2 rows in set (0.00 sec)
>
>
>
> Script.hql
>
> Create table test(id STRING, name STRING);
>
>
>
> Thanks & Regards,
>
> Praseetha
>