1.presto mysql数据写入到hive
insert into hive.prestotest.mysqldata select * from mysql.lyjtest.data;
2.复制数据
insert into hive.prestotest.mysqldata select * from hive.prestotest.mysqldata;
3.查询
presto:lyjpresto> select count(name),name from mysqldata group by name;
_col0 | name
----------+----------------------
33554432 | 2
33554432 | 1
33554432 | 3
(3 rows)
Query 20201230_042634_00067_mczzp, FINISHED, 1 node
Splits: 74 total, 74 done (100.00%)
0:09 [101M rows, 23.4MB] [11.2M rows/s, 2.61MB/s]
4.常用sql
select * from mysql.lyjtest.data;//查询数据
create table lyjpresto.mysqldata as select * from mysql.lyjtest.data; //根据其他表创建表
help //帮助
show catalogs;//查看数据源
show schemas;//查询数据库
use hive.test;//进入到某一数据库
show tables ;//查看某一数据库下的表