Skip to Content
Trino 权威指南:原书第2版
book

Trino 权威指南:原书第2版

by Matt Fuller, Manfred Moser, Martin Traverso
July 2023
Intermediate to advanced
278 pages
5h 40m
Chinese
China Machine Press
Content preview from Trino 权威指南:原书第2版
72
|
4
运行
CREATE
TABLE
AS
INSERT
SELECT
查询时,
Trino
可以在写入数据到存储(如
HDFS
S3
)时收集统计信息,然后将这些信息存储到
Hive metastore
中。
这是一个非常有用的功能,因为不再需要手动执行
ANALYZE
命令的步骤。这些统计信
息永远不会过期。但是为了让该功能可以按照预期正常工作,表中的数据必须总是由
Trino
进行写入。
这一过程的开销已进行了广泛的基准测试,它对性能的影响可忽略不计。要开启该特
性,在使用
Hive
连接器时,需要在
catalog
配置文件中添加以下属性:
hive.collect-column-statistics-on-write=true
4.9.3 Hive
ANALYZE
命令
Trino
之外,你仍然可以使用
Hive
ANALYZE
命令来为
Trino
收集统计信息。此时,
统计信息的计算不是由
Trino
执行引擎来进行的,而是由
Hive
执行引擎进行,因此计算
结果可能不同。此外,相比使用自己生成的统计信息,当
Trino
使用
Hive
生成的统计信
息时,总有产生不同行为的风险。因此通常推荐使用
Trino
自己来收集统计信息,但有
时可能由于一些原因需要使用
Hive
,比如数据作为一个更复杂的流水线的一部分并与其
他可能使用统计信息的工具共享。要使用
Hive
收集统计信息,可以执行以下命令:
hive> ANALYZE TABLE datalake.ontime.flights COMPUTE STATISTICS;
hive> ANALYZE ...
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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

What Successful Brick-and-Mortar Retailers Get Right

What Successful Brick-and-Mortar Retailers Get Right

Rob Angell
Three Essentials for Agentic AI Security

Three Essentials for Agentic AI Security

Paolo Dal Cin, Daniel Kendzior, Yusof Seedat, Renato Marinho
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer

Publisher Resources

ISBN: 9787111731603