zoukankan      html  css  js  c++  java
  • Failed with exception MetaException(message:javax.jdo.JDODataStoreException: Error(s) were found while autocreating/validating the datastore for classes.

    hive (db_emp)> load data local inpath '/opt/datas/emp.txt' into table emp_part partition(`date`='2018120');

    在加载数据到HDFS上时,报错:

    Failed with exception MetaException(message:javax.jdo.JDODataStoreException: Error(s) were found while auto-creating/validating the datastore for classes. The errors are printed in the log, and are attached to this exception.

    问题解决:

    1.删除hive元数据库(mysql中metastore)

    2.手动创建metastore,执行SQL语句:show create database metastore;

    mysql> create database metastore;
    Query OK, 1 row affected (0.00 sec)

    mysql> show create database metastore;
    +--------------+-------------------------------------------------------------------------+
    | Database | Create Database |
    +--------------+-------------------------------------------------------------------------+
    | metastore | CREATE DATABASE `metastore` /*!40100 DEFAULT CHARACTER SET latin1 */ |
    +--------------+-------------------------------------------------------------------------+
    1 row in set (0.00 sec)

    3.执行SQL语句:alter database metastore  character set latin1;

    mysql> alter database metastore character set latin1;
    Query OK, 1 row affected (0.00 sec)

    4.到hive配置conf下的hive-site.xml中修改元数据库

    5.给要load data 的数据赋予权限

    6.启动hive

    [xningge@hadoop01 hive-0.13.1-cdh5.3.6]$ bin/hive

    Logging initialized using configuration in file:/opt/modules/cdh/hive-0.13.1-cdh5.3.6/conf/hive-log4j.properties
    hive (default)> show databases;
    OK
    database_name
    default
    Time taken: 0.182 seconds, Fetched: 1 row(s)
    hive (default)> create database db_emp;
    OK
    Time taken: 0.222 seconds
    hive (default)> create table emp_part(
    > empno int ,
    > ename string ,
    > job string ,
    > mgr int ,
    > hiredate string,
    > sal double ,
    > comm double ,
    > deptno int
    > )PARTITIONED BY(`date` string)
    > row format delimited fields terminated by '\t';
    OK
    Time taken: 0.348 seconds
    hive (default)> load data local inpath '/opt/datas/emp.txt' into table emp_part partition(`date`='2018120');
    Loading data to table default.emp_part partition (date=2018120)
    Partition default.emp_part{date=2018120} stats: [numFiles=1, numRows=0, totalSize=657, rawDataSize=0]
    OK
    Time taken: 1.159 seconds

    7.打开浏览器进入http://hadoop01.xningge.com:50070

     问题解决,如果大家按我的步骤还是不成功,给我留言。

  • 相关阅读:
    Elementary Methods in Number Theory Exercise 1.2.25
    Elementary Methods in Number Theory Exercise 1.2.14
    图解欧几里德算法
    图解欧几里德算法
    Elementary Methods in Number Theory Exercise 1.2.14
    Android中的长度单位详解(dp、sp、px、in、pt、mm)
    分享下多年积累的对JAVA程序员成长之路的总结
    android异常之都是deamon惹的祸The connection to adb is down, and a severe error has occured.
    TomatoCartv1.1.8.2部署时报错
    JavaScript浏览器对象之二Document对象
  • 原文地址:https://www.cnblogs.com/xningge/p/8433014.html
Copyright © 2011-2022 走看看