第 6 步:查询 DynamoDB 表中的数据
在此步骤中,将使用 HiveQL 查询 DynamoDB 的 Features 表。尝试以下 Hive 查询:
-
所有地形类型 (
feature_class
) 按字母顺序排列:SELECT DISTINCT feature_class FROM ddb_features ORDER BY feature_class;
-
所有以字母“M”开头的湖泊:
SELECT feature_name, state_alpha FROM ddb_features WHERE feature_class = 'Lake' AND feature_name LIKE 'M%' ORDER BY feature_name;
-
至少有三个地形高于一英里(5,280 英尺)的州:
SELECT state_alpha, feature_class, COUNT(*) FROM ddb_features WHERE elev_in_ft > 5280 GROUP by state_alpha, feature_class HAVING COUNT(*) >= 3 ORDER BY state_alpha, feature_class;