sh cca175-problem-03-partitioning.sh

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh cca175-problem-03-partitioning.sh相关的知识,希望对你有一定的参考价值。

create database retail;

create table orders_avro (
  order_id int,
  order_date date,
  order_customer_id int,
  order_status string)
  partitioned by (order_month string)
STORED AS AVRO;

insert overwrite table orders_avro partition (order_month)
select order_id, 
  to_date(from_unixtime(cast(order_date/1000 as int))), 
  order_customer_id, 
  order_status, 
  substr(from_unixtime(cast(order_date/1000 as int)),1,7) as order_month 
from default.orders_sqoop;

以上是关于sh cca175-problem-03-partitioning.sh的主要内容,如果未能解决你的问题,请参考以下文章

sh cca175-problem-5-step-7-validation.sh

sh cca175-problem-07-step-01-flume.sh

sh cca175-problem-07-step-02-flume.sh

sh cca175-problem-02-sqoop-and-hdfs.sh

sh cca175-problem-03-import-all-tables.sh

sh cca175-problem-03-create-hive-table.sh