- Print
- PDF
Using Trino
- Print
- PDF
Available in VPC
Trino is a distributed SQL query engine for big data analysis. With the rebranding of Presto SQL to Trino, the name for the Presto app, which was provided based on Presto SQL, has been changed to the Trino app. The Trino app supports each user to configure an independent Trino server environment in the same way as the Presto app currently provided by Data Forest.
- For more information about Trino, refer to Trino.
- Data Forest provides the Trino engine in the Trino 367 version. Because the Log4j that was included in the Elasticsearch connector has been removed from the Trino 366 version and later, it can be used safely from the Log4j vulnerability (CVE-2021-44228). For more information, refer to the official document.
- The Trino app provides the Trino server, Trino CLI and supervisor features together.
- The custom configuration feature in the Trino app is currently under preparation.
Check Trino app details
When the app creation is completed, you can view the details. When the Status is Stable under the app's details, it means the app is running normally.
The following describes how to check the app details.
- From the NAVER Cloud Platform console, click the Services > Big Data & Analytics > Data Forest > App menus, in that order.
- Select the account that owns the app.
- Click the app whose details you want to view.
- View the app details.
- Quick links
- AppMaster: URL where the container log can be viewed When creating apps, all apps are submitted to the YARN queue. YARN provides a web UI where each app's details can be viewed.
- Trino Coordinator: You can access the Trino coordinator web UI. Log in with the user account name and password.
- Trino CLI web: You can use the web-based CLI through the browser. Log in with the user account name and password.
- Supervisor: Provides the Supervisor that can monitor and manage the app processes of containers. You can manage processes through the supervisor web UI.
- Component: The value specified by default is the recommended resource.
- coordinator: component that plays the role of coordinator
- worker: component that will play the role of worker
- Quick links
Refer to Access quick links for information on how to log in to the AppMaster UI and view the logs of each container.
Example
- Trino Coordinator screen after connection
- Trino CLI web screen after connection
- Supervisor screen after connection
Check catalog and schema
The Trino servers created in this app have the Hive connector set by default, which enables to access Hive Warehouse.
You can find hive and system catalogs as shown below. system catalog
provides the information and indicators for clusters.
Password:
trino> show catalogs;
Catalog
---------
hive
system
(2 rows)
Query 20220208_050852_00000_4xb62, FINISHED, 3 nodes
Splits: 53 total, 53 done (100.00%)
1. 23 [0 rows, 0B] [0 rows/s, 0B/s]
You can view information about the tables under system catalog
and nodes that make up the Presto cluster.
trino> SHOW SCHEMAS FROM system;
Schema
--------------------
information_schema
jdbc
metadata
runtime
(4 rows)
Query 20220208_051532_00001_4xb62, FINISHED, 4 nodes
Splits: 53 total, 53 done (100.00%)
0. 28 [4 rows, 57B] [14 rows/s, 201B/s]
trino> SHOW TABLES FROM system.runtime;
Table
----------------------
nodes
optimizer_rule_stats
queries
tasks
transactions
(5 rows)
Query 20220208_051549_00002_4xb62, FINISHED, 4 nodes
Splits: 53 total, 53 done (100.00%)
0. 32 [5 rows, 134B] [15 rows/s, 425B/s]
trino> SELECT * FROM system.runtime.nodes;
node_id | http_uri | node_version | coordinator | state
-------------------------------------------------------------------+----------------------------+--------------+-------------+--------
test-01-worker-0-container_e814_1643186470613_0056_01_000003 | http://10.250.31.228:10292 | 367 | false | active
test-01-coordinator-0-container_e814_1643186470613_0056_01_000002 | http://10.250.31.224:10302 | 367 | true | active
test-01-worker-1-container_e814_1643186470613_0056_01_000004 | http://10.250.31.225:10292 | 367 | false | active
test-01-worker-2-container_e814_1643186470613_0056_01_000005 | http://10.250.31.227:10292 | 367 | false | active
(4 rows)
Query 20220208_051555_00003_4xb62, FINISHED, 2 nodes
Splits: 17 total, 17 done (100.00%)
0. 23 [4 rows, 389B] [17 rows/s, 1.65KB/s]
trino>
You can view hive catalog
. You can use Trino to send queries to the data saved under Hive Metastore.
trino> SHOW SCHEMAS FROM hive;
Schema
--------------------------
default
df_test__db_foo
information_schema
(3 rows)
Query 20220208_054001_00004_4xb62, FINISHED, 4 nodes
Splits: 53 total, 53 done (100.00%)
0. 92 [7 rows, 141B] [7 rows/s, 153B/s]
Change the number of workers
You can change the number of workers while using the app.
The following describes how to change the number of workers.
- From the NAVER Cloud Platform console, click the Services > Big Data & Analytics > Data Forest > App menus, in that order.
- Select an account, select the app, and then click the [Flex] button.
- When the Flex change window appears, modify the number of workers, and then click the [Modify] button.
Reducing the number of workers using the Flex feature will stop those with the larger {{COMPONENT_ID}} first. If there are 5 workers, then the exclusion order is worker-4, worker-3, worker-2, and so on.