首先presto是通过hive metastore来访问hive的,所以需要在hive/conf目录下配置hive-site.xml的

hive.metastore.uris属性

hive.metastore.uris

thrift://ip:9083

Thrift URI for the remote metastore. Used by metastore client to connect to remote metastore.

736e413df7ef93d8bf2303ca12a261de.png

然后在presto-server\etc\catalog\smartbix里面配置hive.properties,mysql.properties等文件内容

hive.properties文件

connector.name=hive-hadoop2

hive.metastore.uri=thrift:/ip:9083(具体hive.metastore.uris可在hive-site.xml里面配置)

mysql.properties文件

connector.name=mysql

connection-url=jdbc:mysql://ip:port?useCursorFetch=true&defaultFetchSize=10000

connection-user=username

connection-password=password

oracle.properties文件

connector.name=oracle

connection-driver=oracle.jdbc.OracleDriver

connection-identifier-quote="

connection-url=jdbc:oracle:thin:@ip:port:

connection-user=username

connection-password=password

mongodb.properties文件

connector.name=mongodb

mongodb.seeds=ip:27017

配置完后启动presto服务器,通过smartbi新建关系数据源presto连接

c88f34d1ff8d32380c1ead2389b9ad3f.png

右键presto数据源的数据库管理查看各个类型数据库表,并添加至右侧

980e6c78fe14ff9fd3d6a9443fb376e6.png

利用smartbi原生SQL进行查询

ad8e81584828cc30248d70ca8ceb43b7.png

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐