赞
踩
hive> create table sales_info_new_new
> as
> select sku_id,sku_name,category_id3,price,sales_count,dt
> from sales_info where dt = '2019-04-26';
原表DDL:
- CREATE TABLE `sales_info`(
- `sku_id` string COMMENT '商品id',
- `sku_name` string COMMENT '商品名称',
- `category_id3` string COMMENT '三级分类id',
- `price` double COMMENT '销售价格',
- `sales_count` bigint COMMENT '销售数量'
- )
- COMMENT '商品销售信息表'
- PARTITIONED BY(
- `dt` string)
- ROW FORMAT DELIMITED
- FIELDS TERMINATED BY ','
- NULL DEFINED AS ''
- STORED AS TEXTFILE
- LOCATION
- 'hdfs://ns1/abc/sales_info'

原表查询结果:
- hive> select * from sales_info;
- OK
- sku_id sku_name category_id3 price sales_count dt
- 12377 华为Mate10 31 999.0 20 2019-04-26
- 45677 华为Mate30 31
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。