在select查询中使用配置单元bucketing

wh6knrhe  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(346)

我有一个绑定在userid上的配置单元表,我的select查询在where子句中包含userid,但是配置单元正在执行全表扫描。 hive.enforce.bucketing 是真的,为什么在这种情况下不利用bucketing,是否有任何配置来启用它??
表结构

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

选择查询

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

zujrkrfu1#

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

相关问题