2014-06-24 57 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."

所以,僅僅在蜂巢外殼,或色調蜂巢運行命令,然後在黑斑羚,鍵入「無效的元數據」,然後就可以看到你的表一中「顯示錶」。

因此,對於這部分問題似乎解決了。