presto
NULL values are not allowed on the probe side of SemiJoin operator サブクエリの中が空だとNULL values are not allowed on the probe side of SemiJoin operatorになるっぽい presto> select null in (select 1 where false); Query xxxxxxxxxxxxxxxxxx…
presto round round(x,d) round(x) same as inputって書いてあるから、xの型doubleだと戻り値もdoubleになるし、integerならintegerが帰って来る presto> select round(22); _col0 ------- 22 (1 row) presto> select round(22.5); _col0 ------- 23.0 (1 ro…
create schema on presto たぶんそんなに難しくない CREATE SCHEMA web とか CREATE SCHEMA hive.sales とか。 https://prestodb.io/docs/current/sql/create-schema.html
presto 0.187 https://prestodb.io/docs/current/release/release-0.187.html Fix a stability issue that may cause query failures due to a large number of HTTP requests timing out. The issue has been observed in a large deployment under stress.…
show create view SHOW CREATE VIEW view_name なお、ビューテーブルをshow create tableしたら is a view, not a table でエラーになるよ https://prestodb.io/docs/current/sql/show-create-view.html
presto window function prestoのwindow関数の一覧 https://prestodb.io/docs/current/functions/window.html
COALESCE Returns the first non-null value in the argument list. Like a CASE expression, arguments are only evaluated if necessary. 第1引数がnullだったら第2引数を、第2引数がnullだったら第3引数を返す…を繰り返して、第n引数もnullだったらnullを…
ここらへんかな。 github.com 6.8. String Functions and Operators — Presto 0.184 Documentation
presto-users' group っていう
datetimeまわりのドキュメント 6.10. Date and Time Functions and Operators — Presto 0.183 Documentation
KとVはArrayっぽい Constructs a map from those entries of map for which function returns true: SELECT map_filter(MAP(ARRAY[], ARRAY[]), (k, v) -> true); -- {} SELECT map_filter(MAP(ARRAY[10, 20, 30], ARRAY['a', NULL, 'c']), (k, v) -> v IS N…
presto monitoringまわりの設定とか
homebrew presto 0.182 入れた。自動化したい。
fix Fix correctness issue that causes corr() to return positive numbers for inverse correlations. Fix the EXPLAIN query plan for tables that are partitioned on TIMESTAMP or DATE columns. Fix query failure when when using certain window fun…
prestoのcardinalityはmapのsizeを返す。mapは↓のような構造。 presto> select cardinality(map(ARRAY[1,2,3,4,5],ARRAY[3,4,4,5,6])); _col0 ------- 5 (1 row) presto> select map(ARRAY[1,2,3,4,5],ARRAY[3,4,4,5,6]); _col0 ---------------------------…
prestoのクエリを書くときに必要なtips(なんか前も紹介したような) 無邪気にアスタを使わない select * from tbl1 使うならカラム名は絞る prototypeではvalueを使う 可能であるならwithを使う timeのパーティションで割り算とかfloatとかbetweenとか使わな…
row_number なるほどわからん Returns a unique, sequential number for each row, starting with one, according to the ordering of rows within the window partition. https://prestodb.io/docs/current/functions/window.html
システム構成 コンポーネントの役割 prestoリソースの活用 まとめ バッチ環境 hadoop ほかシステム Hadoopに対するETLはやってない(digdag/scoopとかは使っている) 定型的なクエリがメイン presto 分析用クラスタ 0.170 1 coord, 20 worker 5分おきにクエリ…
yahoo multi big data company hadoop rdb nosql object storage さまざまなストレージにあるデータをインタラクティブに分析→presto 広告入稿システム システムサマリー NFSを退役 Goでヤフーの分散オブジェクトストレージを作った話 EOSL問題 ファイルフォ…
概要 AWS Athenaの紹介 + AWSのサービス紹介 + Athenaのベストプラクティス Athena S3のデータに対してSQLを投げるサービス re:Invent 2016 tokyoリージョンではまだ使えない データ分析基盤の進化の流れ 1985 Dataware house 2006 Hadoop clusters 2009 Dec…
1500 users 150000 queries hosting prest as a serviceとしてのtreasure data aws(us-east) aws(tokyo) IDCF マルチテナンシークラスター S3 + PlazmaDB インデックスを貼ってファイルのスキャンを早くする試み storage format: MPC(message pack) 複数タイ…
0.178の変更点 TD おさらい データの抽出や可視化を行うプラットフォーム prestoは抽出周り 分散SQLエンジン スケールしやすい SQL的なインターフェイス コードの書けないデータアナリストが大規模なデータに対して分析を行える データ分析基盤としてTDはPre…
string 系ドキュメント。 6.8. String Functions and Operators — Presto 0.177 Documentation
後でじっくり読む系。なお、PDFはない。似たようなのがあるけどそれはprestoではない。 Presto Documentation — Presto 0.166 Documentation
prestoのDockerから眺めてみた。特に意味はない。 Central Repository: com/facebook/presto
github.com how to useをなぞればよい。 github.com 以下、readmeより。 # Pull the image # docker pull zhicwu/presto:latest Setup scripts # git clone https://github.com/zhicwu/docker-presto.git # cd docker-presto # chmod +x *.sh # Start Presto…
PyHiveを使う。 github.com 使うのも簡単ですね。 from pyhive import presto cursor = presto.connect('localhost').cursor() cursor.execute('SELECT * FROM my_awesome_data LIMIT 10') print cursor.fetchone() print cursor.fetchall()
cliのソースもここに github.com
Presto CLI 0.165 ./presto --help NAME presto - Presto interactive console SYNOPSIS presto [--catalog <catalog>] [--client-request-timeout <client request timeout>] [--debug] [--enable-authentication] [--execute <execute>] [(-f <file> | --file <file>)] [(-h | --help)] [--keystore-password </file></file></execute></client></catalog>
8889。AWSでSGを設定するときはだいたいこんな感じになると思う カスタムTCP TCP 8889 <server ip>/32 Trying out Presto and Airpal on EMR | Overfitted 2.1. Deploying Presto — Presto 0.164 Documentation</server>