文章来自:http://mangocool.com/1461124430493.html
原标题: Error: FUNCTION 'NUCLEUS_ASCII' already exists. (state=X0Y68,code=30000)
恰好我遇到了类似的问题,借鉴此方法得以解决,转载于此。
--------------------------——-------------——-------------——------------
安装好hive之后,直接运行启动:
1
|
$ ./hive
|
报错:
1
2
3
4
|
Logging initialized using configuration in jar:file:/home/hadoop/SW/hive-2.0.0/lib/hive-common-2.0.0.jar!/hive-log4j2.properties
Exception in thread "main" java.lang.RuntimeException: Hive metastore database is not initialized.
Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema.
If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql)
|
执行命令:
1
|
$ ./schematool -initSchema -dbType derby
|
继续报错:
1
2
3
4
|
Initialization script hive-schema-2.0.0.derby.sql
Error: FUNCTION 'NUCLEUS_ASCII' already exists. (state=X0Y68,code=30000)
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
*** schemaTool failed ***
|
这个function的构建是数据库初始化的一部分,既然存在了,就直接去hive-schema-2.0.0-derby.sql里面注释好了。
问题就这么解决了!欢迎交流!