赞
踩
最近需要提取一些数据,故开始使用hive,本机搭建了一个hive客户端环境,但是始终有问题,在本机装好了mysql以后,老是报
依据堆栈提示,然后下得jar文件主要是看 AbstractTable.exists(AbstractTable.java:455)
455 行 便是 异常抛出之地。
依据 hive错误提示
"datanucleus.autoCreateTables" = true
配置了hive-site.xml不行,故结合上面的代码看,猜测是autoCreate没有传递进去,故开始跟踪这个值的设置的地方,最终跟踪到org.datanucleus.store.mapped.MappedStoreManager,其中有一段很关键的代码如下
看来关键是 this.readOnlyDatastore this.fixedDatastore 这2个字段
而且autoCreateSchema 这个设置为true 就可以决定了其他的设置,所以其他设置在此都无效了。
继续追踪org.datanucleus.store.AbstractStoreManager 发现了这2个字段的设置代码
原来问题再这里,再次修改hive-site.xml文件,ok,错误没有了。
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<configuration>
<property>
<name>javax.jdo.option.ConnectionURL</name>
<value>jdbc:mysql://localhost:3306/hive?createDatabaseIfNotExist=true</value>
</property>
<property>
<name>javax.jdo.option.ConnectionDriverName</name>
<value>com.mysql.jdbc.Driver</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
</property>
<property>
<name>hive.hwi.listen.port</name>
<value>9999</value>
<description>This is the port the Hive Web Interface will listen on </description>
</property>
<property>
<name>datanucleus.autoCreateSchema</name>
<value>true</value>
</property>
<property>
<name>datanucleus.autoCreateTables</name>
<value>true</value>
</property>
<property>
<name>datanucleus.fixedDatastore</name>
<value>false</value>
</property>
</configuration>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。