我在 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/