启动spark-shell遇到两个报错
来源:5-5 spark-shell&spark-sql的使用
被吊打的学渣
2018-08-12
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. org.datanucleus.exceptions.NucleusDataStoreException: 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.
18/07/31 13:48:04 ERROR Datastore: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 3072 bytes com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 3072 bytes
一个是mysql表长度不够,还有个是无法自动创建表
写回答
3回答
-
陈素素
2019-05-28
您好, 我启动spark-shell时报这个错误: 19/05/27 23:27:14 ERROR Datastore: An exception was thrown while adding/validating class(es) : Specified key was too long; max key length is 767 bytes com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 767 bytes 跟您遇到的基本一样,我想请教一下这句命令 :alter database sparksql character set latin1; 在哪儿执行啊?
012019-05-28 -
被吊打的学渣
提问者
2018-08-13
自问自答一波。
记住如果你已经在mysql创建了作为hive元数据库的‘sparksql’数据库(这个是课程中起的名字)。一定要修改这个数据库的字符集,而不是在在mysql数据库系统文件中修改,比如在
/etc/my.cnf
中修改是毫无意义的,它只会对你之后创建的数据库的字符集有影响,而不会改变之前。所以要执行下面这个命令才有效。
alter database sparksql character set latin1;
012018-08-13 -
Michael_PK
2018-08-12
MySQL的字符集不对,你改成lin1可能就OK。这个问题解决办法问答区有,你可以搜下
032018-08-13
相似问题
Spark启动
回答 4
启动spark 这样看比较明显吧
回答 5