hive代码如下:
set mapred.reduce.tasks = 100;
create table order_dimensions_cube as
select
grouping__id as groupid,
user_level ,
city_level ,
region_name ,
province_name ,
city_name ,
platform ,
sale_type ,
item_first_cate_name ,
app_module ,
department ,
sum(COALESCE(complete_sum, 0)) as complete_price
from
data
group by
user_level ,
city_level ,
region_name ,
province_name ,
city_name ,
platform ,
sale_type ,
item_first_cate_name,
app_module ,
department
with cube having grouping__id >= 704;
事实证明没有生成任何记录。
更多信息:
为什么会发生这种情况以及如果我想使用必须对结果做一些限制,如何解决这个问题?
谢谢。答案 0 :(得分:0)
由于您未提供实际数据,请尝试以下操作:
library(ggplot2)
# Set up a data.frame which works with ggpolt
Names <- c("Leadership", "Management",
"Problem Solving", "Decision Making", "Social Skills")
# add \n
Names[seq(2, length(Names), 2)] <- paste0("\n" ,Names[seq(2, length(Names), 2)])
# data.frame, including a grouping vector
d <- data.frame(Names, vector, group= c(rep("Part1", 3), rep("Part2", 2)))
# correct order
d$Names <- factor(d$Names, levels= unique(d$Names))
# plot the bars
p <- ggplot(d, aes(x= Names, y= vector, group= group)) + geom_bar(stat= "identity") + theme_bw()
# use facet_grid for the groups
p + facet_grid(.~group, scales= "free_x", space= "free_x")
并查看每个grouping__id有多少条记录。那里可能存在一些问题。 另外 - 尝试将外部查询更改为
select grouping_id,count(*) from
(select
grouping__id as groupid,
user_level ,
city_level ,
region_name ,
province_name ,
city_name ,
platform ,
sale_type ,
item_first_cate_name ,
app_module ,
department ,
sum(COALESCE(complete_sum, 0)) as complete_price
from
data
group by
user_level ,
city_level ,
region_name ,
province_name ,
city_name ,
platform ,
sale_type ,
item_first_cate_name,
app_module ,
department
with cube) A
group by grouping_id
并查看问题是否仍然存在。
这不是一个解决方案,而是更多的试验来理解发生了什么