本文介绍了如何将数据加载到Hive表并使其在Impala中也可访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Hive中有一张桌子:

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;

为什么只能在Hive中访问该表?当我尝试在HUE/Impala编辑器中访问它时,出现以下错误:

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

似乎没有这样的表格,但该表格确实显示在左侧面板中.

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

在Impala-shell中,错误如下:

In Impala-shell, error is different as below:

我一直认为Hive表和Impala表本质上是相同的,不同之处在于Impala是更高效的查询引擎.

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.

推荐答案

假定sr2015位于名为db的数据库中,为了使该表在Impala中可见,您都需要发布

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

在Impala外壳中

但是,在您的情况下,原因可能是您使用的Impala版本,因为它完全不支持表格格式

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

这篇关于如何将数据加载到Hive表并使其在Impala中也可访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 08:18