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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章