title: Failed to initialize schema for HiveServer2 in Apache Hive 3.0.0 on Cygwin (Windows 10)
body: <p>I already had a Hadoop 3.0.0 cluster consisting of 2 machine: 1 namenode + RM and 1 datanode. I tried to install Apache Hive 3.0.0 by following <a href="https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-RunningHiveServer2andBeeline.1" rel="nofollow noreferrer">this document</a>.</p>
  
  <p>When I run <code>schematool -dbType derby -initSchema --verbose</code> on Cygwin, an exception was thrown:</p>
  
  <pre><code>$ schematool -dbType derby -initSchema --verbose
  SLF4J: Class path contains multiple SLF4J bindings.
  SLF4J: Found binding in [jar:file:/C:/BigSol/apache-hive-3.0.0-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  SLF4J: Found binding in [jar:file:/C:/BigSol/hadoop-3.0.0/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
  SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
  SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
  Metastore connection URL:        jdbc:derby:;databaseName=metastore_db;create=true
  Metastore Connection Driver :    org.apache.derby.jdbc.EmbeddedDriver
  Metastore connection User:       APP
  Starting metastore schema initialization to 3.0.0
  org.apache.hadoop.hive.metastore.HiveMetaException: Unknown version specified for initialization: 3.0.0
  org.apache.hadoop.hive.metastore.HiveMetaException: Unknown version specified for initialization: 3.0.0
          at org.apache.hadoop.hive.metastore.MetaStoreSchemaInfo.generateInitFileName(MetaStoreSchemaInfo.java:137)
          at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:580)
          at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:562)
          at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1445)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:498)
          at org.apache.hadoop.util.RunJar.run(RunJar.java:239)
          at org.apache.hadoop.util.RunJar.main(RunJar.java:153)
  *** schemaTool failed ***
  </code></pre>
  
  <p>When viewing the <a href="https://github.com/apache/hive/blob/branch-3/standalone-metastore/src/main/java/org/apache/hadoop/hive/metastore/MetaStoreSchemaInfo.java#L137" rel="nofollow noreferrer">line of code</a> that thrown the exception, I found that Hive tried to find a SQL schema located at <code>%HIVE_HOME%\scripts\metastore\upgrade\derby\hive-schema-3.0.0.derby.sql</code>.</p>
  
  <p>I doubt that Cygwin messed up the path so that Hive didn't find that schema.</p>
  
  <p>My questions:</p>
  
  <ol>
  <li>How can I correct the path (or fix the problem)?</li>
  <li>Are there batch files equivalent to <code>*.sh</code> files in <code>%HIVE_HOME%\bin</code> directory as Hive 2.1.1 have?</li>
  </ol>