hive下eRA载,如何将数据加载到Hive表并使其也可以在Impala中访问

I have a table in Hive:

CREATE EXTERNAL TABLE sr2015(

creation_date STRING,

status STRING,

first_3_chars_of_postal_code STRING,

intersection_street_1 STRING,

intersection_street_2 STRING,

ward STRING,

service_request_type STRING,

division STRING,

section STRING )

ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.OpenCSVSerde' WITH SERDEPROPERTIES (

'colelction.delim'='\u0002',

'field.delim'=',',

'mapkey.delim'='\u0003',

'serialization.format'=',', 'skip.header.line.count'='1',

'quoteChar'= "\"")

The table is loaded data this way:

LOAD DATA INPATH "hdfs:///user/rxie/SR2015.csv" INTO TABLE sr2015;

Why the table is only accessible in Hive? when I attempt to access it in HUE/Impala Editor I got the following error:

AnalysisException: Could not resolve table reference: 'sr2015'

which seems saying there is no such a table, but the table does show up in the left panel.

In Impala-shell, error is different as below:

ERROR: AnalysisException: Failed to load metadata for table: 'sr2015'

CAUSED BY: TableLoadingException: Failed to load metadata for table:

sr2015 CAUSED BY: InvalidStorageDescriptorException: Impala does not

support tables of this type. REASON: SerDe library

'org.apache.hadoop.hive.serde2.OpenCSVSerde' is not supported.

I have always been thinking Hive table and Impala table are essentially the same and difference is Impala is a more efficient query engine.

Can anyone help sort it out? Thank you very much.

解决方案

Assuming that sr2015 is located in DB called db, in order to make the table visible in Impala, you need to either issue

invalidate metadata db;

or

invalidate metadata db.sr2015;

in Impala shell

However in your case, the reason is probably the version of Impala you're using, since it doesn't support the table format altogether

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值