/usr/local/service/ 路径下。[root@172 ~]# su hadoop[hadoop@172 ~]# cd /usr/local/service/hive
5,cos_patrick6,cos_stone
[hadoop@172 hive]# hdfs dfs –put cosn://$bucketname/
10,lzo_pop11,lzo_tim
[hadoop@172 hive]$ lzop -v lzo.txtcompressing hive_test.data into lzo.txt.lzo
yum -y install lzo lzop。create database if not exists test;use test;create external table if not exists presto_on_cos (id int,name string) ROW FORMAT DELIMITED FIELDS TERMINATED BY ’,’;insert into presto_on_cos values (12,’hello’),(13,’world’);load data inpath "cosn://$bucketname/cos.txt" into table presto_on_cos;load data local inpath "/$yourpath/lzo.txt.lzo" into table presto_on_cos;
[hadoop@172 hive]$ hive -f "presto_on_cos_test.sql"
[hadoop@172 presto-client]$ ./presto --server $host:$port --catalog hive --schema test
presto:test> select * from presto_on_cos ;id | name----+-------------5 | cos_patrick6 | cos_stone10 | lzo_pop11 | lzo_tim12 | hello13 | world(6 rows)Query 20180702_150000_00011_c4qzg, FINISHED, 3 nodesSplits: 4 total, 4 done (100.00%)0:03 [6 rows, 127B] [1 rows/s, 37B/s]
文档反馈