presto初学

presto初学,第1张

presto初学
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 字段=值)

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5688938.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存