我想弄清楚为什么我的表创建不起作用。由于我无法将我的Impala链接到我的Hbase,因此无法在我的Twitter流上进行查询:/
对于SerDe属性,我是否需要像Hive这样的特殊JAR?
这是我的命令:
CREATE EXTERNAL TABLE HB_IMPALA_TWEETS( id int, id_str字符串, 文字字符串, created_at时间戳, geo_latitude double, geo_longitude double, user_screen_name字符串, user_location字符串, user_followers_count字符串, user_profile_image_url字符串 )
存储者'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
与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”=“推文”);
但是我收到了一个错误:strored by:
查询:创建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“) 错误:AnalysisException:第1行中的语法错误: ... image_url string)STORED BY 'org.apache.hadoop.hive.h ...
遇到:BY
预期:AS
CAUSED BY:异常:语法错误
有关信息,我按照此页面操作: https://github.com/AronMacDonald/Twitter_Hbase_Impala/blob/master/README.md
感谢您帮助我:)
答案 0 :(得分:2)
好吧,似乎Impala仍然不支持SerDe(序列化/反序列化)。
“您使用Hive shell在Impala端创建表, 因为Impala CREATE TABLE语句目前不支持 自定义SerDes和这些表所需的一些其他语法:你 使用STORED BY将其指定为HBase表 蜂巢上的'org.apache.hadoop.hive.hbase.HBaseStorageHandler'条款 CREATE TABLE语句。“
因此,只需在hive shell或hue hive上运行该命令,然后在impala中输入“invalidate metadata”,然后您就可以看到带有“show tables”的表格。
所以对于这部分问题似乎已经解决了。