hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prasad Mujumdar (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-5606) Default Derby metastore_db initial creation fails if hive.metastore.schema.verification=true
Date Tue, 22 Oct 2013 17:44:44 GMT

    [ https://issues.apache.org/jira/browse/HIVE-5606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13802054#comment-13802054
] 

Prasad Mujumdar commented on HIVE-5606:
---------------------------------------

ah ok, The code default is false and the hive-default.xml.template setting on trunk is also
false. Looks this change didn't make it to 0.12
You don't need to explicitly enable this check for normal hive functionality. This is an optional
feature to safeguard metastore consistency.

Hive wouldn't know if you are accessing/creating the metastore for first time or using an
existing older metastore. The dataNucleus ORM layer and Derby's autocreate database makes
it transparent to Hive. Hence with schema.verification setting Hive turns off dataNuclues's
settings to automatically create/alter the underlying tables and compares the version stored
in the metastore DB with the expected version in the code. The schema upgrade could be complex
and might involve updating data as well as schema (eg Hive 0.7 to 0.8). In such cases the
auto upgrade would end up with corrupt/inconsistent metastore.

The check is optional mainly due to the out of box experience as well as testing impact of
Hive and other downstream products. Please feel free to log a ticket to make it true by default.


> Default Derby metastore_db initial creation fails if hive.metastore.schema.verification=true
> --------------------------------------------------------------------------------------------
>
>                 Key: HIVE-5606
>                 URL: https://issues.apache.org/jira/browse/HIVE-5606
>             Project: Hive
>          Issue Type: Bug
>          Components: Database/Schema
>    Affects Versions: 0.12.0
>         Environment: JDK 1.6.0_43, Hadoop 1.2.1
>            Reporter: Brett Randall
>
> Hive cannot create the default//initial/Derby metastore_db, if new 0.12 configuration
property {{hive.metastore.schema.verification}} is set to {{true}}.
> # Start with a clean 0.12 installation, or remove any existing (Derby) default metastore_db
directory
> # In {{hive-site.xml}}, set {{hive.metastore.schema.verification=true}}
> # Start hive CLI
> # Run {{hive> create database if not exists mydb;}}
> The following exception occurs:
> {noformat}
> 2013-10-22 15:02:59,390 WARN  bonecp.BoneCPConfig (BoneCPConfig.java:sanitize(1537))
- Max Connections < 1. Setting to 20
> 2013-10-22 15:03:01,899 ERROR exec.DDLTask (DDLTask.java:execute(435)) - org.apache.hadoop.hive.ql.metadata.HiveException:
java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
>         at org.apache.hadoop.hive.ql.metadata.Hive.createDatabase(Hive.java:231)
>         at org.apache.hadoop.hive.ql.exec.DDLTask.createDatabase(DDLTask.java:3442)
>         at org.apache.hadoop.hive.ql.exec.DDLTask.execute(DDLTask.java:227)
>         at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:151)
>         at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:65)
>         at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:1414)
>         at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1192)
>         at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1020)
>         at org.apache.hadoop.hive.ql.Driver.run(Driver.java:888)
>         at org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:259)
>         at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:216)
>         at org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:413)
>         at org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:781)
>         at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:675)
>         at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:614)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.util.RunJar.main(RunJar.java:160)
> Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
>         at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1212)
>         at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.<init>(RetryingMetaStoreClient.java:62)
>         at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:72)
>         at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2372)
>         at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2383)
>         at org.apache.hadoop.hive.ql.metadata.Hive.createDatabase(Hive.java:225)
>         ... 19 more
> Caused by: java.lang.reflect.InvocationTargetException
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>         at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1210)
>         ... 24 more
> Caused by: MetaException(message:Version information not found in metastore. )
>         at org.apache.hadoop.hive.metastore.ObjectStore.checkSchema(ObjectStore.java:5638)
>         at org.apache.hadoop.hive.metastore.ObjectStore.verifySchema(ObjectStore.java:5622)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at org.apache.hadoop.hive.metastore.RetryingRawStore.invoke(RetryingRawStore.java:124)
>         at com.sun.proxy.$Proxy10.verifySchema(Unknown Source)
>         at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:403)
>         at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:441)
>         at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:326)
>         at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.<init>(HiveMetaStore.java:286)
>         at org.apache.hadoop.hive.metastore.RetryingHMSHandler.<init>(RetryingHMSHandler.java:54)
>         at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:59)
>         at org.apache.hadoop.hive.metastore.HiveMetaStore.newHMSHandler(HiveMetaStore.java:4060)
>         at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.<init>(HiveMetaStoreClient.java:121)
>         ... 29 more
> 2013-10-22 15:03:01,900 ERROR ql.Driver (SessionState.java:printError(419)) - FAILED:
Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. java.lang.RuntimeException:
Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
> {noformat}
> The version check should not apply when creating the initial Derby metastore_db.
> *Workaround*: set hive.metastore.schema.verification=false, run Hive CLI and perform
any operation that forces the metastore to be created.  On 0.12 this will add the 0.12.0 version
to the VERSION table.  You can then change hive.metastore.schema.verification=true if you
prefer for subsequent access.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message