Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535

hive创建数据库成功,但是创建表的时候报错
创建数据库:

hive (default)> create  database  if not exists test;
OK
Time taken: 0.45 seconds

创建表:

hive (test)> create  table if not exists student_info
       >  (
       >   name    string,
       >   sex  string
       > )
       > row format delimited fields terminated by '|' lines terminated by '\n';

创建表报错信息:

	FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. 
	MetaException(message:An exception was thrown while adding/validating class(es) :
	 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. 
	 This includes storage overhead, check the manual. You have to change some columns to 
	 TEXT or BLOBs com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 
	 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535. 
	 This includes storage overhead, check the manual. You have to change some columns to 
	 TEXT or BLOBs

解决办法:
登录mysql修改hive元数据库的编码方式
mysql -uroot -p123456
alter database metastore character set latin1;

测试:

hive (test)> create  table if not exists student_info
       >  (
       >   name    string,
       >   sex  string
       > )
       > row format delimited fields terminated by '|' lines terminated by '\n';
OK
Time taken: 8.656 seconds

你可能感兴趣的:(Hive)