我使用配置单元创建了以下hbase表,如下所示:
CREATE TABLE HBWeather (key struct<USAF:INT, WBAN:INT, `Date`:STRING>, TEMP INT)
ROW FORMAT DELIMITED
COLLECTION ITEMS TERMINATED BY '~'
STORED BY 'org.apache.hadoop.hive.hbase.HBaseStorageHandler'
WITH SERDEPROPERTIES ('hbase.columns.mapping'=':key,T:Temp')
TBLPROPERTIES("hbase.table.name"="HBWeather", "hbase.mapred.output.outputtable"="HBWeather");
然后填充数据:
Insert overwrite table HBWeather select NAMED_STRUCT('USAF',USAF, 'WBAN',WBAN,'Date', `Date`) key, TEMP from weather;
运行以下命令将返回预期结果:
select * from hbweather limited 10;
现在我的问题是,当我的键是struct时,如何按特定键过滤?例如,如果我想找到美国空军400010,wban 99999,日期='200906280000'的温度,怎么写?。。。在对struct类型的键进行筛选时,where子句的外观如何?
1条答案
按热度按时间5jvtdoz21#