hive建表语句(不同的数据存储格式,包括txt、orc、分区)
2017-12-12 10:47
495 查看
use sx_360_safe;
create table sx_360_safe.sx_ela_bp_info
(
id_ela_bp_info string
,code string
,agent_no string
,operation_time string
,product_no string
,info_no string
,created_by string
,created_date string
,updated_by string
,updated_date string
,openid string
,page string
)
row format delimited fields terminated by '\t' lines terminated by '\n' stored as textfile;
----delimited fields terminated by '\t' 通过'\t'分割字段
----lines terminated by '\n' 通过'\n'结束一行字段
------------------------------------------------------------------
分隔符
------------------------------------------------------------------
use sx_360_safe;
create table sx_360_safe.agg_lbk_toapp_bussiness_app_wide
(
calc_date string ,
branch0_code string ,
branch0_name string ,
branch1_code string ,
branch1_name string ,
branch2_code string ,
branch2_name string ,
branch3_code string ,
branch3_name string ,
title string ,
measures_code string ,
measures_name string ,
sum_data_day decimal(38,10) ,
sum_data_month decimal(38,10) ,
sum_data_year decimal(38,10) ,
data_lastyear_d decimal(38,10) ,
data_lastyear_m decimal(38,10) ,
data_lastyear_y decimal(38,10) ,
day_inc decimal(38,10) ,
month_inc decimal(38,10) ,
year_inc decimal(38,10) ,
month_comple_deno decimal(38,10),
year_comple_deno decimal(38,10),
month_comple decimal(38,10) ,
year_comple decimal(38,10) ,
data_day_sor string ,
data_month_sor string ,
data_year_sor string ,
day_inc_sor string ,
month_inc_sor string ,
year_inc_sor string ,
month_comple_sor string ,
year_comple_sor string ,
system_order_fm string
)
partitioned by (day string)
row format delimited fields terminated by '\001' stored as TEXTFILE ;
------------------------------------------------------------------
分隔符
------------------------------------------------------------------
use sx_360_safe;
create table sx_360_safe.dim_olp_bank_table_grade_l
(
branch_grade decimal(38,0) ,
branch0_code string ,
branch0_name string ,
branch1_code string ,
branch1_name string ,
branch2_code string ,
branch2_name string ,
branch3_code string ,
branch3_name string ,
branch4_code string ,
branch4_name string ,
branch5_code string ,
branch5_name string ,
branch6_code string ,
branch6_name string
)
stored as orcfile;
create table sx_360_safe.sx_ela_bp_info
(
id_ela_bp_info string
,code string
,agent_no string
,operation_time string
,product_no string
,info_no string
,created_by string
,created_date string
,updated_by string
,updated_date string
,openid string
,page string
)
row format delimited fields terminated by '\t' lines terminated by '\n' stored as textfile;
----delimited fields terminated by '\t' 通过'\t'分割字段
----lines terminated by '\n' 通过'\n'结束一行字段
------------------------------------------------------------------
分隔符
------------------------------------------------------------------
use sx_360_safe;
create table sx_360_safe.agg_lbk_toapp_bussiness_app_wide
(
calc_date string ,
branch0_code string ,
branch0_name string ,
branch1_code string ,
branch1_name string ,
branch2_code string ,
branch2_name string ,
branch3_code string ,
branch3_name string ,
title string ,
measures_code string ,
measures_name string ,
sum_data_day decimal(38,10) ,
sum_data_month decimal(38,10) ,
sum_data_year decimal(38,10) ,
data_lastyear_d decimal(38,10) ,
data_lastyear_m decimal(38,10) ,
data_lastyear_y decimal(38,10) ,
day_inc decimal(38,10) ,
month_inc decimal(38,10) ,
year_inc decimal(38,10) ,
month_comple_deno decimal(38,10),
year_comple_deno decimal(38,10),
month_comple decimal(38,10) ,
year_comple decimal(38,10) ,
data_day_sor string ,
data_month_sor string ,
data_year_sor string ,
day_inc_sor string ,
month_inc_sor string ,
year_inc_sor string ,
month_comple_sor string ,
year_comple_sor string ,
system_order_fm string
)
partitioned by (day string)
row format delimited fields terminated by '\001' stored as TEXTFILE ;
------------------------------------------------------------------
分隔符
------------------------------------------------------------------
use sx_360_safe;
create table sx_360_safe.dim_olp_bank_table_grade_l
(
branch_grade decimal(38,0) ,
branch0_code string ,
branch0_name string ,
branch1_code string ,
branch1_name string ,
branch2_code string ,
branch2_name string ,
branch3_code string ,
branch3_name string ,
branch4_code string ,
branch4_name string ,
branch5_code string ,
branch5_name string ,
branch6_code string ,
branch6_name string
)
stored as orcfile;
相关文章推荐
- hive建表语句(包括txt、Orc和分区)
- hive 压缩全解读(hive表存储格式以及外部表直接加载压缩格式数据);HADOOP存储数据压缩方案对比(LZO,gz,ORC)
- 【转】C数据存储(包括const存储在哪,C++不同部分我在文中用红字已指出)
- Scrapy爬虫爬取天气数据存储为txt和json等多种格式
- C语言中不同数据类型在内存中的存储格式研究
- 纪念一下pyTorch自由读取txt路径存储格式的图片数据
- 大数据:Hive - ORC 文件存储格式
- 【转】C数据存储(包括const存储在哪,C++不同部分我在文中用红字已指出)
- Hive数据导入方案—使用ORC格式存储hive数据
- hive建表没使用LZO存储格式,但是数据是LZO格式时遇到的问题
- hive 压缩全解读(hive表存储格式以及外部表直接加载压缩格式数据);HADOOP存储数据压缩方案对比(LZO,gz,ORC)
- 将excel表格中的数据,转换为sql语句,并存储到txt文档中。
- 环境搭建 Hadoop+Hive(orcfile格式)+Presto实现大数据存储查询一
- hive中不同数据类型存储在Hbase中的格式解析
- Hive 不同存储格式表数据同步问题
- mybatis insert 日期类型字段入库,实际日期数据格式有不同
- Android开发中数据的5种存储方式简介.txt
- oracle不同数据模范存储空间的实例较量
- 把txt格式数据制作成xml数据
- 任何国家都无法限制数字货币。为什么呢? 要想明白这个问题需要具备一点区块链的基础知识: 区块链使用的大致技术包括以下几种: a.点对点网络设计 b.加密技术应用 c.分布式算法的实现 d.数据存储技术 e.拜占庭算法 f.权益证明POW,POS,DPOS 原因一: 点对点网络设计 其中点对点的P2P网络是bittorent ,由于是点对点的网络,没有中心化,因此在全球分布式的网