Column length too big for column ‘PARAM_VALUE‘ (max = 21845); use BLOB or TEXT instead

hive在建表时报一下错误:

Error: Error while processing statement: 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) : Column length too big for column ‘PARAM_VALUE’ (max = 21845); use BLOB or TEXT instead
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Column length too big for column ‘PARAM_VALUE’ (max = 21845); use BLOB or TEXT instead

在这里插入图片描述
解决方法:

  • 步骤1:在mysql中把hive库删除再重新建
1
2
3
4
5
6
7
8
9
10
11
12
13
14
mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| hive               |
| mysql              |
| performance_schema |
| test               |
+--------------------+

mysql> drop database hive;

mysql> create database hive;
  • 步骤2:在shell命令行输入:schematool -dbType mysql -initSchema
1
[root@hadoop60 ~]# schematool -dbType mysql -initSchema

  • 步骤3:重新建表即可
1
0: jdbc:hive2://hadoop60:10000> create table student(id int,name string);

在这里插入图片描述