apache - 在选择查询中使用配置单元存储

标签 apache hadoop hive bigdata

我在 userId 上存储了一个 Hive 表,我的选择查询在 where 子句中包含 userId,但 Hive 正在执行全表扫描。 hive.enforce.bucketing 为真 为什么 Hive 在这种情况下不利用分桶,是否有任何配置可以启用它??

表结构

userId int,
name int,
address String,
cell int,
......
......
......
......
CLUSTERED BY  (userId) SORTED BY (userId) INTO 20 BUCKETS

选择查询

select cell from <table> where userId=<userId>

最佳答案

select cell from <table> TABLESAMPLE(BUCKET <n> OUT OF 20 ON userId) usertable where userId = <userId>

关于apache - 在选择查询中使用配置单元存储,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23544420/

相关文章:

Perl Apache : Perl script displayed as plain text

java - 创建 mapreduce Web 应用程序的方法

hadoop - 更改包含数据的 Hive 外部表中的列名

mysql - 替换配置单元列中的特殊字符

sql - 如何规范化配置单元中的列?

python - 如何在Apache2.2上使用mod_wsgi正确部署flask应用

apache - 搞砸了 url 重写

php - 播放音频文件时 Apache 2.4 崩溃

hadoop - oozie 中 Hive 操作的作业队列

hadoop - Hadoop 中自定义计数器的替代文本