Home > Database > Mysql Tutorial > 在hive中使用parquet (CDH4.3)

在hive中使用parquet (CDH4.3)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:32:39
Original
1704 people have browsed it

hadoop版本 cdh4.3 使用impala创建parquet表后,查询会出错。 [impala:21000] SELECT * FROM foo;Query: SELECT * FROM fooERROR: AnalysisException: Failed TO LOAD metadata FOR TABLE: DEFAULT.fooCAUSED BY: TableLoadingException: Failed TO LOAD met

hadoop版本 cdh4.3

使用impala创建parquet表后,查询会出错。

[impala:21000] > SELECT * FROM foo;
Query: SELECT * FROM foo
ERROR: AnalysisException: Failed TO LOAD metadata FOR TABLE: DEFAULT.foo
CAUSED BY: TableLoadingException: Failed TO LOAD metadata FOR TABLE: foo
CAUSED BY: MetaException: org.apache.hadoop.hive.serde2.SerDeException SerDe parquet.hive.serde.ParquetHiveSerDe does NOT exist
Copy after login

原因是hive并没有这些lib,下载它们并放入/opt/cloudera/parcels/CDH/lib/hive/lib目录(我是使用cloudera manager部署的),创建脚本下载

#!/bin/sh
#parquet-pig parquet-scrooge parquet-test-hadoop2 parquet-thrift parquet-avro parquet-cascading 
?
for f in parquet-column parquet-common parquet-encoding parquet-generator parquet-hadoop parquet-hive 
do
curl -O http://repo1.maven.org/maven2/com/twitter/${f}/1.2.4/${f}-1.2.4.jar
#curl -O http://oss.sonatype.org/service/local/repositories/releases/content/com/twitter/${f}/1.2.4/${f}-1.2.4.jar
done
curl -O http://repo1.maven.org/maven2/com/twitter/parquet-format/1.0.0/parquet-format-1.0.0.jar
Copy after login

然后把他们拷贝进去

cp parquet-*  /opt/cloudera/parcels/CDH/lib/hive/lib
Copy after login

可能要重启metastore,然后在impala中刷新metastore

INVALIDATE METADATA;
Copy after login

在impala修改parquet表

create table test2 (name STRING) STORED AS PARQUETFILE;
Copy after login

插入数据

insert into test2 select * from test;
Copy after login

参考

https://issues.cloudera.org/browse/IMPALA-574

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template