您好,登錄后才能下訂單哦!
LZO表創(chuàng)建:
create table lzoer(id int,name string, ip string)ROW FORMAT DELIMITED
FIELDS TERMINATED BY ',' STORED AS INPUTFORMAT 'com.hadoop.mapred.DeprecatedLzoTextInputFormat' OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat';
LZO表創(chuàng)建索引:
hadoop jar /usr/hdp/2.2.6.0-2800/hadoop/lib/hadoop-lzo-0.6.0.2.2.6.0-2800.jar com.hadoop.compression.lzo.DistributedLzoIndexer hdfs://hadoop001:8020/apps/hive/warehouse/hly.db/lzo_aa/1.txt.lzo
TXT表創(chuàng)建:
CREATE TABLE wubai(id int,name string,ip string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' STORED AS TEXTFILE;
ES表創(chuàng)建:
CREATE EXTERNAL TABLE eswubai(
id bigint,
name string,
ip string)
STORED BY 'org.elasticsearch.hadoop.hive.EsStorageHandler'
TBLPROPERTIES('es.resource' = 'wubai/wubai','es.nodes'='ip','es.port'='9200','es.nodes.wan.only'='true','es.mapping.names'='id:esid,name:esname,ip:esage');
LOAD數(shù)據(jù):
load data local inpath '/usr/local/999.txt' into table estest.test01_source;
LOAD DATA LOCAL INPATH '/usr/local/500.txt.lzo' OVERWRITE INTO TABLE lzowubai;
INSERT INTO 數(shù)據(jù):
insert overwrite table eswuk select * from wuk;
insert into eser select * from wu;
insert overwrite table web select s.id, s.name, s.ip, s.time from test01_source s;
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。