【总结】各种数据格式的Hive建表语句

Xml格式

CREATE EXTERNAL TABLE Gateway_pmsarisoap(

10多年的陆良网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。营销型网站的优势是能够根据用户设备显示端的尺寸不同,自动调整陆良建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。成都创新互联公司从事“陆良网站设计”,“陆良网站推广”以来,每个客户项目都认真落实执行。

BookingSoapLogID STRING, 

GuidNo STRING, 

SoapType STRING, 

SoapContent STRING, 

InsertDate STRING, 

SourceOpsType STRING)

PARTITIONED BY ( 

  `dt` string)

ROW FORMAT SERDE 'com.ibm.spss.hive.serde2.xml.XmlSerDe'

WITH SERDEPROPERTIES (

"column.xpath.BookingSoapLogID"="/HWSoapBase/BookingSoapLogID/text()",

"column.xpath.GuidNo"="/HWSoapBase/GuidNo/text()",

"column.xpath.SoapType"="/HWSoapBase/SoapType/text()",

"column.xpath.SoapContent"="/HWSoapBase/SoapContent/*",

"column.xpath.InsertDate"="/HWSoapBase/InsertDate/text()",

"column.xpath.SourceOpsType"="/HWSoapBase/SourceOpsType/text()"

)

STORED AS

INPUTFORMAT 'com.ibm.spss.hive.serde2.xml.XmlInputFormat'

OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.IgnoreKeyTextOutputFormat'

LOCATION 'hdfs://ns1/wh/source/hw/Gateway/PmsARISoap'

TBLPROPERTIES (

"xmlinput.start"="<HWSoapBase",

"xmlinput.end"="</HWSoapBase>"

);

Json格式

CREATE EXTERNAL TABLE QuhuhuGateway_pmsinvcountnotify(

CountType string,

Count string,

HotelCode string,

Start string,

`End` string) 

PARTITIONED BY (dt string) 

ROW FORMAT SERDE 'com.cloudera.hive.serde.JSONSerDe' 

STORED AS INPUTFORMAT 'com.hadoop.mapred.DeprecatedLzoTextInputFormat' 

OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat' 

LOCATION 'hdfs://ns1/wh/source/hw/QuhuhuGateway/PmsInvCountNotify';

ORC格式

create external table BWAdmin_Log(

  `LogID` BIGINT, 

  `AccountID` BIGINT,  

  `VHotelID` BIGINT, 

  `LogType` String, 

  `LogComment` String,

  `OperateTime` INT

)

row format delimited

fields terminated by '\t'

STORED AS ORC

location 

'hdfs://ns1/wh/source/bw/hotel/admin_log'

AVRO格式

CREATE EXTERNAL TABLE `hotel_list`

PARTITIONED BY ( `dt` string)

ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe'

WITH SERDEPROPERTIES( 'avro.schema.url'='hdfs://ns1/wh/config/schema/web/online/hotel_list.avsc')

STORED AS INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat'

OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'

LOCATION 'hdfs://ns1/wh/format/online_search';

LZO格式

CREATE EXTERNAL TABLE online_test(

sid int,

pvid int,

ts bigint)

PARTITIONED BY ( dt string)

ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'

LINES TERMINATED BY '\n'

STORED AS INPUTFORMAT'com.hadoop.mapred.DeprecatedLzoTextInputFormat'

OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'

LOCATION 'hdfs://ns1/test/online';

TEXT格式

CREATE EXTERNAL TABLE `order_currenthis`(

`orderid` string,

`room` int)

PARTITIONED BY ( `dt` string)

ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'

STORED AS INPUTFORMAT 'org.apache.hadoop.mapred.TextInputFormat'

OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'

LOCATION 'hdfs://ns1/wh/format/otb/order_currenthis'

网页名称:【总结】各种数据格式的Hive建表语句
网页网址:https://www.cdcxhl.com/article18/ipgcgp.html

成都网站建设公司_创新互联,为您提供小程序开发App设计企业建站云服务器网站排名App开发

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

成都定制网站建设