1.shell连接 方式1:连接具体的数据库 ./presto-cli --server localhost:8080 --catalog mysql --schema mysql的数据库名 方式2:连接所有的数据 ./presto-cli --server localhost:8080 2.此处讲解第二连接方式 show catalogs; //查看所连接的所有的数据源 show schemas from mysql; //查看mysql数据源下的数据库有那些 show tables from mysql.库名; //查看mysql.库名下的表都有那些 create table hive.default.表名 as select * from mysq.库名.表名; //把mysql的表,结构和数据都导入到hive里面 select * from mysql.库名.表明 where id=(select id from hive.库名.表明 where 字段=值)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)