2014-06-24 59 views
1

我想弄清楚自从昨天为什么我的表创建不起作用。由于我无法将我的Impala链接到我的Hbase,因此我无法在我的Twitter流上查询:/Impala创建外部表,由Hive存储

我需要一个像Hive一样的特殊JAR作为SerDe属性吗?

这里是我的命令:

CREATE EXTERNAL TABLE HB_IMPALA_TWEETS ( id int, id_str string, text string, created_at timestamp, geo_latitude double, geo_longitude double, user_screen_name string, user_location string, user_followers_count string, user_profile_image_url string )
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ( "hbase.columns.mapping" = ":key,tweet:id_str,tweet:text,tweet:created_at,tweet:geo_latitude,tweet:geo_longitude, user:screen_name,user:location,user:followers_count,user:profile_image_url" ) TBLPROPERTIES("hbase.table.name" = "tweets");

但我上得到了一个错误:

查询:通过strored创建外部表HB_IMPALA_TWEETS(ID INT,ID_STR字符串,字符串,created_at时间戳, geo_latitude double,geo_longitude double,user_screen_name string,user_location string,user_followers_count string,user_profile_image_url字符串)'org.apache.hadoop.hive.hbase.HBaseStorageHandler'WITH SERDEPROPERTIES(“hbase.columns.mapping”=“:key,tweet: id_str,推文:文本,推文:created_at,推文:geo_latitude,推文:geo_longitude,用户:screen_name,用户:位置TBLPROPERTIES(“hbase.table.name”=“tweets”) 错误:AnalysisException:第1行的语法错误: ... image_url字符串)STORED BY'org.apache','user:followers_count,user:profile_image_url' .hadoop.hive.h ...

遇到:BY

预期:AS

引起的:异常:语法错误

有关信息,我跟着这个页面: https://github.com/AronMacDonald/Twitter_Hbase_Impala/blob/master/README.md

感谢您的帮助:)

回答

2

好吧,似乎Impala仍然不支持SerDe(序列化/反序列化)。

"You create the tables on the Impala side using the Hive shell, because the Impala CREATE TABLE statement currently does not support custom SerDes and some other syntax needed for these tables: You designate it as an HBase table using the STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler' clause on the Hive CREATE TABLE statement."

所以,仅仅在蜂巢外壳,或色调蜂巢运行命令,然后在黑斑羚,键入“无效的元数据”,然后就可以看到你的表一中“显示表”。

因此,对于这部分问题似乎解决了。