Skip to Content
Presto实战
book

Presto实战

by Matt Fuller, Manfred Moser, Martin Traverso
March 2021
Intermediate to advanced
265 pages
6h 50m
Chinese
Posts & Telecom Press
Content preview from Presto实战
Presto
中使用
SQL
141
Presto
可以使用隐式
CrossJoin
:用一个以逗号分隔表名的列表定义
Join
在一起的表,并用
WHERE
子句来定义
Join
条件。
SELECT custkey, mktsegment, nation.name AS nation
FROM tpch.tiny.nation, tpch.tiny.customer
WHERE nation.nationkey = customer.nationkey;
custkey | mktsegment | name
---------+------------+-----------
108 | BUILDING | ETHIOPIA
106 | MACHINERY | ARGENTINA
101 | MACHINERY | BRAZIL
Join
是查询处理中开销最大的操作之一。当一个查询中存在多个
Join
时,可以以不同的顺
序处理这些
Join
TPCH
基准中的
Q09
查询就是一个很好的复杂查询示例:
SELECT
nation,
o_year,
sum(amount) AS sum_profit
FROM (
SELECT
N.name AS nation,
extract(YEAR FROM o.orderdate)AS o_year,
l.extendedprice * (1 - l.discount) - ps.supplycost * l.quantity AS amount ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
Google系统架构解密: 构建安全可靠的系统

Google系统架构解密: 构建安全可靠的系统

Heather Adkins, Betsy Beyer, Paul Blankinship, Piotr Lewandowski, Ana Oprea, Adam Stubblefield

Publisher Resources

ISBN: 9787115560056