You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Cameron Moberg (Jira)" <ji...@apache.org> on 2019/09/30 00:14:00 UTC

[jira] [Created] (HIVE-22268) schematool references wrong scripts directory

Cameron Moberg created HIVE-22268:
-------------------------------------

             Summary: schematool references wrong scripts directory
                 Key: HIVE-22268
                 URL: https://issues.apache.org/jira/browse/HIVE-22268
             Project: Hive
          Issue Type: Bug
          Components: Metastore
    Affects Versions: 2.3.6, 3.1.2
            Reporter: Cameron Moberg


When running schematool on 2.3.6, 3.1.2 (no standalone metastore) and possibly others, the schematool uses a Java class org.apache.hadoop.hive.metastore.MetaStoreSchemaInfo where it checks for metastore script dirs `getMetaStoreScriptDir()`.

This function returns (essentially) scripts/*metastore*/upgrade/<FILE_NAME> whereas in 2.3.6 and 3.1.2 now it is *metastore/*scripts/upgrade/<FILE_NAME>.

 
{code:java}
// OLD
public String getMetaStoreScriptDir() {
    return  hiveHome + File.separatorChar +
        "scripts" + File.separatorChar + "metastore" +
	File.separatorChar + "upgrade" + File.separatorChar + dbType;
}

// NEW (tested only with schematool mysql)
public String getMetaStoreScriptDir() {
    return  hiveHome + File.separatorChar +
        "metastore" + File.separatorChar + "scripts" +
	File.separatorChar + "upgrade" + File.separatorChar + dbType;
}
{code}

I did test it by changing the code and swapping metastore/scripts in the method and it did work.


{code:java}
org.apache.hadoop.hive.metastore.HiveMetaException: File /opt/apache-hive-2.3.6-src/scripts/metastore/upgrade/mysql/upgrade.order.mysqlnot found 
 at org.apache.hadoop.hive.metastore.MetaStoreSchemaInfo.<init>(MetaStoreSchemaInfo.java:69)
 at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:92)
 at org.apache.hive.beeline.HiveSchemaTool.<init>(HiveSchemaTool.java:82)
 at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:1117)
 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:244)
 at org.apache.hadoop.util.RunJar.main(RunJar.java:158)
Caused by: java.io.FileNotFoundException: /opt/apache-hive-2.3.6-src/scripts/metastore/upgrade/mysql/upgrade.order.mysql (No such file or directory)
 at java.io.FileInputStream.open0(Native Method)
 at java.io.FileInputStream.open(FileInputStream.java:195)
 at java.io.FileInputStream.<init>(FileInputStream.java:138)
 at java.io.FileInputStream.<init>(FileInputStream.java:93)
 at java.io.FileReader.<init>(FileReader.java:58)
 at org.apache.hadoop.hive.metastore.MetaStoreSchemaInfo.<init>(MetaStoreSchemaInfo.java:62)
 ... 9 more
*** schemaTool failed ***
{code}
 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)