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版
86
6
连接器
在第
3
章中,你配置了一个数据源目录,使用连接器来访问
Trino
中的数据源(尤其是
TPC-H
基准测试数据),然后学习了一些如何使用
SQL
查询这些数据的知识。
数据源目录是使用
Trino
的一个重要部分。它们定义了与底层数据源和存储系统的连接,
并使用了连接器、
schema
和表等概念。第
4
章介绍了这些基本概念,第
8
章将详细讨论
它们如何与
SQL
一起使用。
连接器将底层数据源(如
RDBMS
、对象存储或键值存储)的查询、存储概念翻译成
SQL
Trino
中的表、列、行、数据类型概念。它们可以是简单的
SQL
SQL
之间的
转换和映射,也可以是更复杂的
SQL
到对象存储或
NoSQL
系统的转换,还可以是用户
定义的。
可以像看待数据库的驱动程序一样看待连接器。它将用户的输入转化为底层数据库可以
执行的操作。每个连接器都实现了
Trino
服务提供者接口(
Service Provider Interface
SPI
)中与连接器相关的部分。这使
Trino
可以用同一个
SQL
工具操作连接器暴露的任
意底层数据源,从而使
Trino
成为一个
SQL-on-Anything
系统。
查询性能也受到连接器实现的影响。最基本的连接器与数据源之间建立单条连接,并将
数据提供给
Trino
。然而,更高级的连接器可以将一条语句分解成多条连接,然后并行
执行操作,从而实现更好的性能。连接器的另一个高级特性是提供表统计信息,它们可
以被基于代价的优化器用来创建高性能的查询计划。然而,这样的连接器实现起来会更
加复杂。
Trino
提供了许多连接器: ...
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