presto web查詢工具

一、Yanagishima工具包:

網上有很多,我這裏用的是yanagishima-18.0.zip

也可以在官網下載源碼編譯,不過最新版本需要jdk11,現在企業中普遍使用jdk8,所以選了一個較低的版本

https://github.com/yanagishima/yanagishima

二、使用很簡單,但是也遇到的一些坑,主要還是配置問題,由於我司的HTTP端口是通過代理映射出來,導致踩了一個大坑,另外配置的註釋也要認真看看,不然容易配置錯誤。

# yanagishima web port
jetty.port=7080
# 30 minutes. If presto query exceeds this time, yanagishima cancel the query.
presto.query.max-run-time-seconds=1800
# 1GB. If presto query result file size exceeds this value, yanagishima cancel the query.
presto.max-result-file-byte-size=1073741824
# you can specify freely. But you need to specify same name to presto.coordinator.server.[...] and presto.redirect.server.[...] and .[...] and schema.[...]

# 這裏presto.datasources參數隨便填,但是presto.coordinator.server.[...] 和 catalog.[...] 和 schema.[...] 要和presto.datasources參數保持一致,如presto.coordinator.server.emr-presto ,如果寫成presto.coordinator.server.presto就會出問題
presto.datasources=emr-presto
auth.your-presto=false
# presto coordinator url

# 這裏配置服務器的IP,
presto.coordinator.server.emr-presto=http://ip:9090
# almost same as presto coordinator url. If you use reverse proxy, specify it

# 這裏配置代理的路徑,不能配置成IP+端口,不然你會報錯的
presto.redirect.server.emr-presto=https://presto-pre.ops.cn
# presto catalog name
catalog.emr-presto=hive
# presto schema name
schema.emr-presto=default
# if query result exceeds this limit, to show rest of result is skipped
select.limit=500
# http header name for audit log
audit.http.header.name=some.auth.header
use.audit.http.header.name=false
# limit to convert from tsv to values query
to.values.query.limit=500
# authorization feature
check.datasource=false
hive.jdbc.url.emr-hive=jdbc:hive2://localhost:10000/default;auth=noSasl
hive.jdbc.user.emr-hive=hive
hive.jdbc.password.emr-hive=hive
hive.query.max-run-time-seconds=3600
hive.query.max-run-time-seconds.emr-hive=3600
resource.manager.url.emr-hive=https://yarn-pre.ops.cn
sql.query.engines=presto,hive
hive.datasources=emr-hive
hive.disallowed.keywords.emr-hive=insert,drop
# 1GB. If hive query result file size exceeds this value, yanagishima cancel the query.
hive.max-result-file-byte-size=1073741824
hive.setup.query.path.emr-hive=/usr/local/yanagishima/conf/hive_setup_query_emr-hive
cors.enabled=false

 

啓動命令: nohup bin/yanagishima-start.sh >y.log 2>&1 &

關閉命令:bin/yanagishima-shutdown.sh 

 

yanagishima查詢語法有點特別,我現在利用presto查詢kafka的topic數據,數據庫前綴要帶kafka,不然不成功,而且不能用;號

SELECT * FROM kafka.default."dwd_trd_order_ni" LIMIT 100

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章