Reputation: 83
There is output the following error information:
Error: FUNCTION 'NUCLEUS_ASCII' already exists. (state=X0Y68,code=30000)
org.apache.hadoop.hive.metastore.HiveMetaException: Schema initialization FAILED! Metastore state would be inconsistent !!
Underlying cause: java.io.IOException : Schema script failed, errorcode 2
Use --verbose for detailed stacktrace.
*** schemaTool failed ***
Hive and Hadoop daemons are running fine. I ran Hive services after the Metastore services via Cygwin. I deleted all the Metastore db
directories. Then I am facing also the same issue mentioned above after running the commands below.
In Windows command prompt window:
C:\hadoop_new\db-derby-10.14.2.0\bin\startNetworkServer -h 0.0.0.0
In Cygwin terminal window:
$HIVE_HOME/bin/schematool -dbType derby -initSchema
Error:
hive > FAILED: HiveException java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
Upvotes: 2
Views: 7244
Reputation: 31
I had a similar issue. The error was because I attempted to start hive before establishing the schema. Try the following:
$mv metastore_db metastore_db.tmp
Now run your schema setup.
I found this solution here.
Upvotes: 3
Reputation: 83
Solution : Go to below directory: C:\hadoop_new\apache-hive-3.1.2\scripts\metastore\upgrade\derby\hive-schema-3.1.0.derby.sql comment the 'NUCLEUS_ASCII' function and 'NUCLEUS_MATCHES' function rerun schematool -dbType derby -initSchema, then everything goes well!
Upvotes: 5