Hive使用中遇到的几个小问题

1. 在Hive中使用show tables;等命令报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes

解决办法: 到mysql中的hive数据库里执行 alter database hive character set latin1;mysql

改变hive元数据库的字符集,问题就能够解决! 可是这时你若是建一个表里有中文,就会报错了。sql

2. Sqoop不能将数据导入到Hive中,报错:Warning: /usr/lib/hbase does not exist! HBase imports will fail. Please set $HBASE_HOME to the root of your HBase installation.

解决办法: 在配置文件中将HBase和ZooKeeper的配置去掉就能够了。数据库

SQOOP_HOME/bin/configure-sqoop 中关于 HBASE 和ZOOKEEPER去掉。oop

3. 若是在Sqoop导数据时报错,提示文件已经存在,这时确定是存在了。能够去HDFS中找找看,通常会是在/user/${user_name}目录下有一个。

若是使用了--create-hive-table 选项,那么文件和表都必需要清掉。code

4. LOAD时,必定要指定数据类型,不然默认的ByteArray没法转成String

5. jdbc驱动忘拷到lib目录了

####6. show tables时log报:MetaException(message:Version information not found in metastore. )orm

hive.metastore.schema.verification设为falseci

<name>hive.metastore.schema.verification</name>
  <value>false</value>
相关文章
相关标签/搜索