【发布时间】:2014-07-03 03:50:27
【问题描述】:
下面是我的蜂巢查询
'select substr(ltrim(date_ts),0,10) date_ts,
sum(if(col1 = 'type1', 1, 0)) as type_1,
sum(if(col1 = 'type2', 1, 0)) as type_2,
sum(if(col1 = 'type3', 1, 0)) as type_3
from table1
GROUP BY substr(ltrim(date_ts),0,10)
ORDER BY date_ts;'
我的table1(外部表)被分区为(年字符串,月字符串,日字符串)
下面是我的分区
'year='2010',month='01',day='01'
year='2010',month='01',day='02'
year='2010',month='01',day='03'
year='2010',month='01',day='04''
如果我在 3 个或更少的分区上运行查询,它就完全可以正常工作。当我添加第 4 个分区时,它会卡在 map=92% 处。无法弄清楚为什么。它正在处理任意 3 个分区的组合。不知道有没有人遇到过这个问题。
我能够得到以下输出。
' date | type1 | type2 |type3 |
------------------------------------------
2011-10-01 | 1 | 0 | 0 |
2011-10-02 | 1 | 0 | 0 |
2011-10-03 | 0 | 1 | 1 |'
在我为第四天添加第 4 个分区的那一刻,地图卡在 90% 左右,即使在 1 到 2 小时后仍然如此。
预期输出
' date | type1 | type2 |type3 |
------------------------------------------
2011-10-01 | 1 | 0 | 0 |
2011-10-02 | 1 | 0 | 0 |
2011-10-03 | 0 | 1 | 1 |
2011-10-05 | 0 | 1 | 0 |'
有什么建议吗?
【问题讨论】: