duce.tasks=32;drop table if exists product_ " />

duce.tasks=32;drop table if exists product_"/>

hiveconcat_w实现将多行记录合并成一行

更新时间:2023-05-19 07:22:32 阅读: 评论:0

hiveconcat_w实现将多⾏记录合并成⼀⾏建表如下:
black swan# 创建商品与促销活动的映射表
hive -e "t mapred.job.queue.name=pms;
educers.max=32;
牛津高中英语>hopkinsduce.tasks=32;
drop table if exists product_promotion;
opposite什么意思
create table product_promotion(product_id bigint, promotion_id String);
inrt into table product_promotion
不正确lect p2.product_id, p2.promotion_id
from pms.promotionv2 p1 inner join pms.promotionv2_main_product_sku p2
on (p1.id=p2.promotion_id)
recitewhere from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss') between p1.start_date d_date;"
数据表的记录如下:
对promotion_id进⾏合并:
lect product_id, concat_ws('_',collect_t(promotion_id)) as promotion_ids from product_promotion group by product_id
执⾏结果:
hive > lect product_id, concat_ws('_',collect_t(promotion_id)) as promotion_ids from product_promotion group by product_id; OK
5112 960024_960025_960026_960027_960028
化妆品专业知识
5113 960043_960044_960045_960046
招聘人员要求有哪些Time taken: 3.116 conds
oltremare
这⾥的collect_t的作⽤是对promotion_id去重,值得注意的是,必须保证promotion_id的类型是string类型

本文发布于:2023-05-19 07:22:32,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/114262.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:记录   活动   合并   促销   要求   化妆品
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图