#!/bin/bash
source /etc/profile;
##################################################
# Author: ouyangyewei #
# #
# Content: Combineorder Algorithm #
##################################################
# change workspace to here
cd /
cd /home/deploy/recsys/algorithm/schedule/project/combineorder
# generate product_sell data
yesterday=$(date -d '-1 day' '+%Y-%m-%d')
lastweek=$(date -d '-1 week' '+%Y-%m-%d')
/usr/local/cloud/hive/bin/hive<<EOF
CREATE EXTERNAL TABLE IF NOT EXISTS product_sell(
category_id bigint,
province_id bigint,
product_id bigint,
price double,
sell_num bigint
)
PARTITIONED BY (ds string)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY '\t'
LINES TERMINATED BY '\n'
STORED AS TEXTFILE;
INSERT OVERWRITE TABLE product_sell PARTITION (ds='$yesterday') select a.category_id, b.
Shell脚本执行hive语句 | hive以日期建立分区表 | linux schedule程序 | sed替换文件字符串 | shell判断hdfs文件目录是否存在
最新推荐文章于 2021-03-16 11:10:13 发布