trino README

The project's README from github.com/trinodb/trino. As one markdown file: README.md.

Trino Logo

Trino is a fast distributed SQL query engine for big data analytics.

See the User Manual for deployment instructions and end user documentation.

Trino download Reproducible builds supported Trino Slack Trino: The Definitive Guide book download

Development

See DEVELOPMENT for information about development and release process, code style and guidelines for implementors of Trino plugins.

See CONTRIBUTING for contribution requirements.

Security

See the project security policy for information about reporting vulnerabilities.

Trino supports reproducible builds as of version 449.

Build requirements

Building Trino

Trino is a standard Maven project. Simply run the following command from the project root directory:

./mvnw clean install -DskipTests

On the first build, Maven downloads all the dependencies from the internet and caches them in the local repository (~/.m2/repository), which can take a while, depending on your connection speed. Subsequent builds are faster.

Trino has a comprehensive set of tests that take a considerable amount of time to run, and are thus disabled by the above command. These tests are run by the CI system when you submit a pull request. We recommend only running tests locally for the areas of code that you change.

Running Trino in your IDE

Overview

After building Trino for the first time, you can load the project into your IDE and run the server. We recommend using IntelliJ IDEA. Because Trino is a standard Maven project, you can easily import it into your IDE. In IntelliJ, choose Open Project from the Quick Start box or choose Open from the File menu and select the root pom.xml file.

After opening the project in IntelliJ, double-check that the Java SDK is properly configured for the project:

Running a testing server

The simplest way to run Trino for development is to run the TpchQueryRunner class. It will start a development version of the server that is configured with the TPCH connector. You can then use the CLI to execute queries against this server. Many other connectors have their own *QueryRunner class that you can use when working on a specific connector. The VM option generally required here is --add-modules jdk.incubator.vector, but various *QueryRunner classes might require additional options (if necessary, check the air.test.jvm.additional-arguments property in the pom.xml file of the module from which the runner comes).

Running tests from the IDE

When running individual test classes directly from IntelliJ, you need to configure the JUnit run configuration template. Go to Run/Debug Configurations > Edit Configuration Templates > JUnit > VM options and set the value to -ea --add-modules=jdk.incubator.vector. Some tests may rely on JVM options provided by airbase (e.g. -XX:-OmitStackTraceInFastThrow), so check for that too.

Running the full server

Trino comes with sample configuration that should work out-of-the-box for development. Use the following options to create a run configuration:

The working directory should be the trino-server-dev subdirectory. In IntelliJ, using $MODULE_DIR$ accomplishes this automatically.

If VM options doesn't exist in the dialog, you need to select Modify options and enable Add VM options.

To adjust which plugins are enabled for the development server, adjust the value of plugin.bundles in config.properties. Each entry in this list must represent a plugin specified by one of the following options:

If you want to use a plugin in a catalog, you must add a corresponding <catalog_name>.properties file to testing/trino-server-dev/etc/catalog.

Running the CLI

Start the CLI to connect to the server and run SQL queries:

client/trino-cli/target/trino-cli-*-executable.jar

Run a query to see the nodes in the cluster:

SELECT * FROM system.runtime.nodes;

Run a query against the TPCH connector:

SELECT * FROM tpch.tiny.region;

trino (trinodb/trino)

Searching Database…

13.3K ·GitHub
Что это такое?Trino — это быстрый распределённый SQL-движок для анализа больших данных: вы запускаете его как сервер (или кластер) и делаете запросы к большим наборам данных на обычном SQL. Раньше он назывался PrestoSQL.
Это программа, которую я ставлю себе на ноутбук, или сервер, который разворачивают и к которому подключаются?Это сервер, а не настольное приложение: вы разворачиваете движок Trino и подключаетесь к нему через идущий в комплекте trino-cli JAR или любой JDBC-клиент, чтобы выполнять запросы. Документация для пользователей и по развёртыванию находится на trino.io.
Как запустить проект из этого репозитория?Это обычный Maven-проект: выполните ./mvnw clean install -DskipTests из корня репозитория, затем откройте его в IntelliJ IDEA и запустите DevelopmentServer или TpchQueryRunner — получится дев-сервер с примером конфигурации.
Что должно быть установлено, чтобы собрать проект?Компьютер с Mac или Linux, 64-битная Java 25.0.1+ и Docker. На Apple Silicon дополнительно нужен Rosetta 2, потому что некоторые npm-пакеты, используемые при сборке веб-интерфейса, существуют только под x86.
Есть ли подводные камни при локальной сборке и тестировании?Отключите SELinux и всё остальное, что блокирует запись в каталог с проектом, иначе контейнерам не удастся смонтировать исходники. Полный набор тестов работает медленно, поэтому -DskipTests оставляет их CI на этапе pull request'ов.
Он будет работать на Windows или только на Mac и Linux?В требованиях к сборке указаны только Mac OS X и Linux; Windows не упоминается. Так как это чистая Java, скорее всего, он запустится и на других системах, но README подтверждает только эти две.
В чём история с названием PrestoSQL?Trino — это бывший PrestoSQL: движок переименовали, а теги 'presto' и 'prestodb' по-прежнему есть среди тем репозитория, поэтому материалы под старыми названиями по-прежнему ведут к этому проекту.
Даёт ли Trino воспроизводимые сборки?Да — начиная с версии 449 Trino поддерживает воспроизводимые сборки, так что выпущенные артефакты можно сверить с опубликованным исходным кодом.
Как посмотреть, чем занят мой кластер?Подключитесь через CLI и сделайте запрос к системным таблицам: SELECT * FROM system.runtime.nodes выводит список узлов кластера, а идущая в комплекте схема tpch.tiny удобна для первого пробного запроса.
What are similar projects?starrocks, doris, druid, presto, spark, ClickHouse, duckdb, predictionio
Creator
trinodb
Size
319.6 MB
Stars
13.3K
Age
7y
Commits · 90 Days