presto docker简单试用
starburstdata 团队提供了一个docker 版本的presto,其中已经内置了几个connectors
- tpch
- tpcds
- memory
- backhole
- jmx
- system
pull docker images
镜像稍大,最好使用加速
docker pull starburstdata/presto
启动
docker run -d -p 8080:8080 --name demo starburstdata/presto
UI 效果
进入容器
docker exec -it demo presto-cli
查询node
select * from system.runtime.nodes;
node_id | http_uri | node_version |
--------------------------------------+------------------------+--------------+-
32329c8b-5918-488c-93ae-cb7a575f6ce3 | http://172.17.0.2:8080 | 312-e.1 |
(1 row)
Query 20190710_073434_00019_ucty8, FINISHED, 1 node
Splits: 17 total, 17 done (100.00%)
0:00 [1 rows, 72B] [2 rows/s, 146B/s]
简单查询
- 查看catalogs
show catalogs
blackhole
jmx
memory
system
tpcds
tpch
- 查询jmx catlog
SHOW TABLES FROM jmx.current;
com.sun.management:type=diagnosticcommand
com.sun.management:type=hotspotdiagnostic
io.airlift.discovery.client:name=announcer
io.airlift.discovery.client:name=serviceinventory
io.airlift.discovery.store:name=dynamic,type=distributedstore
io.airlift.discovery.store:name=dynamic,type=httpremotestore
io.airlift.discovery.store:name=dynamic,type=replicator
io.airlift.event.client:name=eventclient
io.airlift.http.client:name=fordiscoveryclient,type=httpclient
io.airlift.http.client:name=fordynamicstore,type=httpclient
io.airlift.http.client:name=foreventclient,type=httpclient
io.airlift.http.client:name=forexchange,type=httpclient
io.airlift.http.client:name=forfailuredetector,type=httpclient
io.airlift.http.client:name=formemorymanager,type=httpclient
io.airlift.http.client:name=fornodemanager,type=httpclient
io.airlift.http.client:name=forscheduler,type=httpclient
io.airlift.http.client:name=forworkerinfo,type=httpclient
io.airlift.http.server:context=http/1.1|h2c@73d62b5,id=0,type=httpserverchannel
io.airlift.http.server:id=0,type=classpathresourcehandler
io.airlift.http.server:id=0,type=statsrecordinghandler
io.airlift.http.server:id=1,type=classpathresourcehandler
io.airlift.http.server:name=httpserver
io.airlift.http.server:name=requeststats
io.airlift.jmx:name=stacktracembean
io.airlift.log:name=logging
io.airlift.node:name=nodeinfo
io.airlift.stats:name=pausemeter
java.lang:na
- 查询数据
SELECT node, vmname, vmversion
-> FROM jmx.current."java.lang:type=runtime";
效果
node | vmname | vmversion
--------------------------------------+--------------------------+------------
32329c8b-5918-488c-93ae-cb7a575f6ce3 | OpenJDK 64-Bit Server VM | 25.212-b04
(1 row)
Query 20190710_072619_00016_ucty8, FINISHED, 1 node
Splits: 17 total, 17 done (100.00%)
0:00 [1 rows, 70B] [4 rows/s, 325B/s]
create table 操作
- 简单create
CREATE TABLE memory.default.nation AS
-> SELECT * from tpch.tiny.nation;
CREATE TABLE: 25 rows
Query 20190710_072840_00017_ucty8, FINISHED, 1 node
Splits: 38 total, 38 done (100.00%)
0:04 [25 rows, 0B] [6 rows/s, 0B/s]
- insert 数据
INSERT INTO memory.default.nation
SELECT * FROM tpch.tiny.nation;
- 查询
SELECT * FROM memory.default.nation;
nationkey | name | regionkey |
-----------+----------------+-----------+---------------------------------------
0 | ALGERIA | 0 | haggle. carefully final deposits dete
1 | ARGENTINA | 1 | al foxes promise slyly according to th
2 | BRAZIL | 1 | y alongside of the pending deposits. c
3 | CANADA | 1 | eas hang ironic, silent packages. slyl
4 | EGYPT | 4 | y above the carefully unusual theodoli
5 | ETHIOPIA | 0 | ven packages wake quickly. regu
6 | FRANCE | 3 | refully final requests. regular, ironi
7 | GERMANY | 3 | l platelets. regular accounts x-ray: u
8 | INDIA | 2 | ss excuses cajole slyly across the pac
9 | INDONESIA | 2 | slyly express asymptotes. regular dep
10 | IRAN | 4 | efully alongside of the slyly final de
11 | IRAQ | 4 | nic deposits boost atop the quickly fi
12 | JAPAN | 2 | ously. final, express gifts cajole a
13 | JORDAN | 4 | ic deposits are blithely about the car
14 | KENYA | 0 | pending excuses haggle furiously depo
15 | MOROCCO | 0 | rns. blithely bold courts among the cl
16 | MOZAMBIQUE | 0 | s. ironic, unusual asymptotes wake bli
17 | PERU | 1 | platelets. blithely pending dependenci
18 | CHINA | 2 | c dependencies. furiously express noto
19 | ROMANIA | 3 | ular asymptotes are about the furious
20 | SAUDI ARABIA | 4 | ts. silent requests haggle. closely ex
21 | VIETNAM | 2 | hely enticingly express accounts. even
22 | RUSSIA | 3 | requests against the platelets use ne
23 | UNITED KINGDOM | 3 | eans boost carefully special requests.
24 | UNITED STATES | 1 | y final packages. slow foxes cajole qu
(25 rows)
Query 20190710_072942_00018_ucty8, FINISHED, 1 node
Splits: 18 total, 18 done (100.00%)
0:00 [25 rows, 2.67KB] [92 rows/s, 9.89KB/s]
说明
官方文档提供了比较全的说明,而且对于不同的connector,也有详细的使用说明
参考资料
https://hub.docker.com/r/starburstdata/presto
https://prestodb.github.io/
https://prestodb.github.io/docs/current/
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
2018-07-10 Packer 基本试用
2017-07-10 Service Mesh 了解
2017-07-10 docker swarm mode routing mesh 使用
2017-07-10 Portainer docker 可视化管理工具