Location>code7788 >text

Trino 436 - Tutorial on how to use it (pro-test, detailed)

Popularity:161 ℃/2024-12-10 16:42:41

Chapter 1Trinosummary

1. Trinosummarize

Trino is a distributed SQL query engine designed to query large data sets distributed across one or more heterogeneous data sources. If one is working with several terabytes or petabytes of data, one is likely to be using a tool that interacts with Hadoop and HDFS.Trino is designed as an alternative to tools that query HDFS using a MapReduce job pipeline (such as Hive or Pig), but Trino is not limited to accessing HDFS.Trino can and has been extended to operate on different types of of data sources, including traditional relational databases and other data sources such as Cassandra.

Trino is designed to handle data warehousing and analytics: data analysis, aggregating large amounts of data and generating reports. These workloads are often categorized as Online Analytical Processing (OLAP).

Description:Don't misunderstand the fact that Trino understands SQL because it provides the functionality of a standard database.Trino is not a general purpose relational database. It is not a replacement for databases such as MySQL, PostgreSQL, or Oracle.Trino is not designed to handle online transaction processing (OLTP). The same is true for many other databases designed and optimized for data warehousing or analytics.

2. Trino Architecture

Trino is a distributed query engine that processes data in parallel across multiple servers.There are two types of Trino servers, coordinators and workers. The following sections describe these servers and other components of the Trino architecture.

A Trino cluster consists of a coordinator and multiple workers. Users connect to the coordinator through SQL tools. The coordinator collaborates with the workers. the coordinator manages the workers. the coordinator and the workers access connected data sources by configuring catalogs.

The execution of each query is a stateful operation and the coordinator orchestrates the workload and it schedules the tasks into workers for parallel execution. Each Trino runs in a JVM instance and further parallelizes the tasks by using threads.

 

The user connects to the coordinator in the cluster using a client-side tool such as a JDBC driver or Trino CLI, and the coordinator then coordinates the access of the worker nodes to the data source.

Coordinator (coordinator) is a class of servers that process user query requests and manage work nodes to perform query work. A worker is a class of servers responsible for performing tasks and processing data.

The coordinator usually runs a node discovery service and the worker joins the cluster by registering to that service. All communication and data transfer between the client, coordinator and worker is done through HTTP/HTTPS based REST services.

 

Chapter IITrino Installation

1. Trino Environment Requirements

Linux operating system: 64-bit

Java Runtime Environment: Jdk21 and above

Python version: 2., 2. or

2. Trino deployment

Trino servers can be installed and deployed on many different server platforms. Users typically deploy by a cluster with a coordinator and multiple worker nodes.Trino supports how it is deployed:

(1) Deployment of Trino

(2) Trino in a Docker Container

(3) Trino on Kubernetes with Helm

(4) RPM package

The following section describes how RPM packages are deployed.

1. Download the RPM package for Trino.

Trino Server 436 download address :.

/maven2/io/trino/trino-server-rpm/436/

Trino Cli 436 Download Address:

/maven2/io/trino/trino-cli/436/

2、Use the command to install the package: rpm

rpm -ivh    --nodeps

3. Starting services

service  trino  start ;

You can use the service command to manage the Trino server after installation:

service  trino  [start|stop|restart|status]

command

movements

start

Starts the server as a daemon and returns its process ID.

stop

Shut down servers beginning with or . Send the SIGTERM signal.

restart

Stop and then start a running server, or start a stopped server, assigning a new process ID.

status

Prints the status line, i.e. "stopped pid" or "running as pid".

4. Verify that the service is normal

(1) Execute service trino status on the server and see Running as XXX indicating that the service has started successfully.

(2) Execute jps on the server, if you see the TrinoServer process, it means that the startup is successful.

(3) In the browser, type: http://ip:8080, if the login page appears, feel free to enter the user root, login can see the following page.

5. Installation of Trino Client

After downloading, you will change to trino-cli and add executable permissions to trino-cli.

mv    trino-cli

chmod +x trino-cli

./trino-cli --server localhost:8080

3. Trino Directory Structure

(1) /usr/lib/trino/lib/: contains the various libraries needed to run the product. Plug-ins are located in the Plug-ins subdirectory.

(2) /etc/trino: Contains general trino configuration files such as , , and . Directory configuration is located in the directory subdirectory.

(3) /etc/trino/: contains the path to the Java installation used by trino and allows configuration of process environment variables, including secrets.

(4) /var/log/trino: Contains log files.

(5) /var/lib/trino/data: location of the data directory where Trino stores logs and other data.

(6) /etc///trino: Contains the service scripts used to control server processes and the launcher configuration for file paths.

 

Chapter IIITrino Connectors

1. MySQL Connector

The MySQL connector allows querying and creating tables in an external MySQL instance. This can be used to connect data between different systems (such as MySQL and Hive) or between two different MySQL instances.

1.1. request

(1) MySQL 5.7, 8.0 or later.

(2) Network access to MySQL from the Trino coordinator and worker threads. Port 3306 is the default port.

1.2. configure

Create a properties file in /etc/trino/catalog.

cd  /etc/trino/catalog

vi  

=mysql

connection-url=jdbc:mysql://192.168.80.131:3306

connection-user=root

connection-password=Root@1234

Here the host should use the IP address, not the host name.

1.3. Login Client

(1) Restart trino service

service trino stop ; service trino start ;

or

service trino restart ;

(2) Login client command

./trino-cli --server localhost:8080

Or you can set the default catalog (some connection instance) and schema (database) when connecting to trino, so that you can query the table directly.

./trino-cli  http://localhost:8080/mysql/test 

Explanation: mysql is configured in catalog, and test is the name of the database you need to connect to.

1.4. Operating MySQL

(1) Show all catalogs (properties file name in the catalog directory)

show catalogs;

(2) View all schemas under mysql (corresponding to databases)

show schemas from mysql;

If the connection fails, you can check the log /var/log/trino/

(3) View all tables in the database

show tables from ;

(4) Query table data

use ;

select * from .tbl001 limit 10;

(5) Insertion of data

insert into tbl001(id,name) values(5,'55555');

select * from .tbl001;

(5) Modification of data

update tbl001 set name = 'xxxxx' where id = 5 ;

select * from .tbl001 ;

(6) Deletion of data

delete from tbl001 where id = 5 ;

select * from .tbl001;

(7) Viewing Table Structure and Table Building Statements

desc tbl001;

show create table tbl001 ;

(8) Exit Client

quit; or exit.

Additional content:

(9) Direct SQL execution via trino-cli (with --execute option)

./trino-cli http://localhost:8080/mysql/test --execute 'select * from .tbl001'

./trino-cli http://localhost:8080 --execute 'use ; select * from .tbl001'

(10) Execution of SQL files via trino-cli (-f option)

vi  mysql_test.sql

use ;

select * from tbl001;

Execute the SQL file: . /trino-cli http://localhost:8080 -f mysql_test.sql

 

2. PostgreSQL Connector

The PostgreSQL connector allows querying and creating tables in an external PostgreSQL database. This can be used to connect data between different systems, such as PostgreSQL and Hive, or between different PostgreSQL instances.

2.1. request

(1) PostgreSQL or later.

(2) Network access to PostgreSQL by the Trino coordinator and workers. The default port is 5432.

2.2. configure

Create a properties file in /etc/trino/catalog.

cd  /etc/trino/catalog

vi  

=postgresql

connection-url=jdbc:postgresql://192.168.80.131:5432/bdc01

connection-user=postgres

connection-password=postgres

Here the host should use the IP address, not the host name.

2.3. Login Client

Restart the trino service:

service trino stop ; service trino start ;

or

service trino restart ;

Login client command:

./trino-cli --server localhost:8080

2.4. Operating PostgreSQL

(1) Show all catalogs (properties file name in the catalog directory)

show catalogs;

(2) View all the schemas (corresponding to databases) under postgresql.

show schemas from postgresql;

If the connection fails, you can check the log /var/log/trino/

(3) View all tables in the database

show tables from ;

(4) Query table data

use ;

select * from .nation_test order by n_nationkey ;

(5) Insertion of data

insert into nation_test(n_nationkey,n_name,n_regionkey) values(99,'XXXXX',3);

select * from nation_test order by n_nationkey ;

(6) Modification of data

update nation_test set n_name = 'YYYYY' where n_nationkey = 99 ;

select * from nation_test order by n_nationkey ;

(7) Deletion of data

delete from nation_test where n_nationkey = 99 ;

select * from nation_test order by n_nationkey ;

(8) Viewing Table Structure and Table Building Statements

desc nation_test; 

or show columns from nation_test ;

show create table nation_test ;

(9) Exit the client

quit; or exit.

 

3. Oracle Connectors

Oracle connectors allow querying and creating tables in an external Oracle database. Connectors allow Trino to connect to data provided by different databases (e.g. Oracle and Hive) or different Oracle database instances.

3.1. request

(1) Oracle 19 or later.

(2) Network access to Oracle for the Trino coordinator and workers. The default port is 1521.

3.2. configure

Create a properties file in /etc/trino/catalog.

cd  /etc/trino/catalog

vi  

=oracle

connection-url=jdbc:oracle:thin:@192.168.80.134:1521/orclpdb1

connection-user=dsjzx

connection-password=Dsjzx123

Here the host should use the IP address, not the host name.

Here the connection uses the service name orclpdb1, not the SID.

3.3. Login Client

Restart the trino service:

service trino stop ; service trino start ;

or

service trino restart ;

Login client command:

./trino-cli --server localhost:8080

3.4. Operating Oracle

(1) Show all catalogs (properties file name in the catalog directory)

show catalogs;

(2) View all the schemas under oracle (corresponding to the user).

show schemas from oracle;

If the connection fails, you can check the log /var/log/trino/

(3) View all tables in the database

show tables from ;

(4) Query table data

use ;

select * from .ora_test01;

Note: When using the Number field type in Oracle, you must specify the precision, i.e. NUMBER(p) or NUMBER(p, s). Otherwise the field is not recognized in Tirno.

(5) Insertion of data

insert into ora_test01(tid,name) values(99,'XXXXX');

select * from ora_test01;

(6) Modification of data

update ora_test01 set name = 'YYYYY' where tid = 99 ;

select * from ora_test01 ;

(7) Deletion of data

delete from ora_test01 where tid = 99 ;

select * from ora_test01 ;

(8) Viewing Table Structure and Table Building Statements

desc ora_test01; 

or show columns from ora_test01 ;

show create table ora_test01;

(9) Exit the client

quit; or exit.

 

4. Kafka Connector

The Kafka connector allows the use of Apache Kafka topics as tables in Trino. Each message is displayed as a row in Trino.

Themes can be real-time, displaying rows as they arrive with data and disappearing as segments of data are discarded. This can lead to strange behavior if the same table is accessed multiple times in a single query (e.g., self-joins).

The Kafka Connector reads and writes message data from Kafka topics in parallel across Workers to achieve significant performance gains. The size of the dataset for this parallelization is configurable, so it can be tuned to specific needs.

4.1. request

(1) Kafka broker version 0.10.0 or later.

(2) Network access from the Trino coordinator and worker nodes to the Kafka node. The default port is 9092.

4.2. configure

Create a properties file in /etc/trino/catalog.

cd  /etc/trino/catalog

vi  

=kafka

-names=mytest

=hadoop01:9092,hadoop02:9092,hadoop03:9092

-description-dir=/etc/trino/kafka

#-internal-columns=false 

Description:

(1) -description-dir=/etc/trino/kafka : The subject file directory of kafka is specified and requires configuration parameters. It contains one or more JSON files (must end in .json) that contain table description files.

(2) -internal-columns=false : Used to show internal column names hidden by Kakfa. The default value is true, which does not show Kafka's hidden internal columns.

4.3. Login Client

Restart the trino service:

service trino stop ; service trino start ;

or

service trino restart ;

Login client command:

./trino-cli --server localhost:8080

4.4. Operating Kafka

(1) Show all catalogs (properties file name in the catalog directory)

show catalogs 

(2) View all schemas under kafka

show schemas from kafka;

(3) View all topics in kafka

show tables from ;

(4) View information about the topic

use ;

desc mytest ;

(5) Query Topic Data

select * from mytest ;

(6) Mapping values in Topic to columns in Trino

Edit the json file of the table information.

vi  /etc/trino/kafka/

{

    "tableName": "mytest",

    "schemaName": "default",

    "topicName": "mytest",

    "message": {

        "dataFormat": "csv",

        "fields": [

            {

                "name": "id",

                "mapping": "0",

                "type": "VARCHAR"

            },

            {

                "name": "name",

                "mapping": "1",

                "type": "VARCHAR"

            }

        ]

    }

 

}

 

Then restart the Trino service.

service trino restart ;

 

Then write data in csv format to the topic via the producer, using commas as separators.

 bin/ --broker-list hadoop01:9092 --topic mytest

Finally query the data in the topic.

Insert data (not validated for now)

insert into mytest(id,name) values('1','tom');

 

5. Hive Connectors

The Hive connector allows queries stored in theApache Hive data in the data warehouse.

Hive is a combination of three components:

(1) Data files in different formats, usually stored in object storage systems such as Hadoop Distributed File System (HDFS) or AmazonS3.

(2) Metadata on how data files are mapped to architectures and tables. This metadata is stored in a database, such as MySQL, and is accessed through the Hive metastore service.

(3) A query language called HiveQL. This query language is executed on a distributed computing framework such as MapReduce or Tez.

Trino uses only the first two components: data and metadata. It does not use HiveQL or any part of the Hive execution environment.

5.1. request

(1) The Hive connector requiresHive Metastore Service (HMS) or a compatible implementation of the Hive metastore, such as theAWS Glue

(2) Support for Apache Hadoop HDFS and.

(3) Data files must be in a supported format: ORC, Parquet, Avro, RCText (RCFile using ColumnarSerDe), RCBinary (RCFile using LazyBinaryColumnarSerDe), SequenceFile, JSON (using ), CSV (using .), TextFile. (using ), CSV (using .), TextFile.

5.2. configure

Create a properties file in /etc/trino/catalog.

cd  /etc/trino/catalog

vi  

=hive

=thrift://192.168.80.131:9083

=/etc/trino/hadoop/,/etc/trino/hadoop/

Here the host should use the IP address, not the host name.

5.3. Hive prepares the data

!connect  jdbc:hive2://192.168.80.131:10000

use default; 

create table tbl001(id  bigint, name string);

insert into tbl001(id,name) values(1,'111111'),(2,'222222'),(3,'333333');

select * from tbl001;

5.4. Login Client

Restart the trino service:

service trino stop ; service trino start ;

or

service trino restart ;

Login client command:

./trino-cli --server localhost:8080

5.5. Operating Hive

(1) Show all catalogs (properties file name in the catalog directory)

show catalogs;

(2) View all schemas under hive (corresponding to databases)

show schemas from hive;

If the connection fails, you can check the log /var/log/trino/

(3) View all tables in the database

show tables from ;

(4) Viewing the table structure

desc .tbl001;

(5) Viewing Table Data

use ;

select * from .tbl001;

(6) Insertion of data

insert into tbl001 values(99,'999999');

select * from tbl001;

(7) Modifying table data

update tbl001  set name = 'XXXXXXX'  where id = 99 ;

Tip Note: Only Hive transaction tables support modifying table rows.

 

Creating a transaction table in Hive and importing data

set = true;

set = true;

set = nonstrict;

set = ;

set = true;

set = 1;

 

create table trans_tbl001(

id bigint,

name string

)

clustered by (id) into 2 buckets

stored as orc

TBLPROPERTIES('transactional'='true');

 

insert into trans_tbl001(id,name) values(1,'111111');

insert into trans_tbl001(id,name) values(2,'222222');

insert into trans_tbl001(id,name) values(3,'333333');

insert into trans_tbl001(id,name) values(99,'999999');

 

Querying data through the trino client

select * from  trans_tbl001 ;

Modifying data via the trino client

update trans_tbl001 set name = 'XXXXXXX' where id = 99 ;

select * from  trans_tbl001 ;

(8) Deleting table data

delete from tbl001 where id = 99 ;

Tip Note: Only Hive transaction tables support modifying table rows.

delete from trans_tbl001 where id = 99 ;

select * from trans_tbl001 ;

(9) Query table building statement

show create table trans_tbl001;

 

6. Hudi Connectors

Hudi Connector Support QueryHudi table, insertion, modification, and deletion operations are not supported for the time being.

6.1. request

(1) Hudi version 0.12.3 or later.

(2) Network access to Hudi storage by Trino coordinator and workers.

(3) Access to the Hive Metastore Service (HMS).

(4) Network access from Trino coordinator (coordinator) to HMS.

(5) Data files stored in Parquet file format in a supported file system.

6.2. configure

Create a properties file in /etc/trino/catalog.

cd  /etc/trino/catalog

vi  

=hudi

=thrift://192.168.80.131:9083

Here the host should use the IP address, not the host name.

6.3. Hudi prepares data

(1) Hudi integration with Spark (omitted)

(2) Starting Spark-sql

spark-sql \

  --conf '=' \

  --conf '.spark_catalog=' \

  --conf '='

(3) Create Hudi table

create  database  hudi_db;

use  hudi_db;

create table hudi_mor_tbl (

  id int,

  name string,

  price double,

  ts bigint

) using hudi

tblproperties (

  type = 'mor',

  primaryKey = 'id',

  preCombineField = 'ts'

);

(4) Importing data

insert  into  hudi_mor_tbl  select 99, 'a99', 20.0, 900;

6.4. Login Client

Restart the trino service:

service trino stop ; service trino start ;

or

service trino restart ;

Login client command:

./trino-cli --server localhost:8080

6.5. Operating Hudi

(1) Show all catalogs (properties file name in the catalog directory)

show catalogs;

(2) View all schemas (corresponding to databases) under hudi.

show schemas from hudi;

If the connection fails, you can view the log /var/log/trino/

(3) View all tables in the database

show tables from hudi.hudi_db;

(10) Viewing the table structure

desc hudi.hudi_db.hudi_mor_tbl;

(11) Viewing Table Data

use hudi.hudi_db;

select * from hudi_mor_tbl;

(12) View metadata table

select * from  "hudi_mor_tbl$timeline" ;

The Hudi connector exposes a metadata table for each Hudi table. The metadata table contains information about the internal structure of the Hudi table. Each metadata table can be queried by appending the metadata table name to the table name: select * from "test_table$timeline".

(13) Hudi connector does not support insert, update, delete operations

 

7. Iceberg Connectors

Apache Iceberg is an open table format for large analytic datasets.The Iceberg connector allows querying of data stored in files written in the Iceberg format, as defined in the Iceberg table specification.

7.1. stake a claim

(1) Network access to distributed object stores by Trino coordinator (coordinator) and workers.

(2) Access the Hive Metastore Service (HMS), AWS Glue catalog, JDBC catalog, REST catalog, or Nessie server.

(3) Data files stored in file format ORC or Parquet (default) on supported file systems.

7.2. configure

Create a properties file in /etc/trino/catalog.

cd  /etc/trino/catalog

vi  

=iceberg

=hive_metastore

=thrift://192.168.80.131:9083

Here the host should use the IP address, not the host name.

7.3. Iceberg prepares data

## Log in to the hive client

hive

## Create a database

create database iceberg_db ;

use iceberg_db;

##Create the Iceberg table

SET .iceberg_hive.type=hive;

SET .iceberg_hive.uri=thrift://192.168.80.131:9083;

SET .iceberg_hive.clients=10;

SET .iceberg_hive.warehouse=hdfs://192.168.80.131:8020/data/warehouse/iceberg-hive;

CREATE TABLE iceberg_test001 (

id    int,

name  string,

birthday  date,

create_time  timestamp

)

PARTITIONED BY(provincial string,ds string)

STORED BY ''

TBLPROPERTIES(''='iceberg_hive');

## Insert data

INSERT INTO iceberg_test001  values

(10001, 'a10001', '2020-01-01', current_timestamp(),'99999999','20240226'),

(10002, 'a10002', '2012-04-18', current_timestamp(),'99999999','20240226'),

(10003, 'a10003', '2015-11-03', current_timestamp(),'99999999','20240226'),

(10004, 'a10004', '2013-08-27', current_timestamp(),'99999999','20240226');

## Query data

 select * from  iceberg_test001 ;

7.4. Login Client

Restart the trino service:

service trino stop ; service trino start ;

or

service trino restart ;

Login client command:

./trino-cli --server localhost:8080

7.5. Operating Iceberg

7.5.1. Trino's self-built table operations

(1) Show all catalogs (properties file name in the catalog directory)

show catalogs;

(2) Create SCHEMA

CREATE  SCHEMA  iceberg.iceberg_hive

WITH (location='hdfs://192.168.80.131:8020/data/warehouse/iceberg-hive/');

(3) Create a table

use iceberg.iceberg_hive ;

CREATE TABLE  example_test01 (

id  INTEGER,

name  VARCHAR,

birthday  DATE,

create_time  TIMESTAMP,

provincial  VARCHAR,

ds  VARCHAR

)

WITH (

    format = 'PARQUET',

    partitioning = ARRAY['provincial', 'ds'],

    sorted_by = ARRAY['id']

);

(4) Insertion of data

insert into example_test01 values

(10001, 'a10001',cast( '2020-01-01' as date), current_timestamp,'99999999','20240226'),

(10002, 'a10002', cast('2012-04-18' as date), current_timestamp,'99999999','20240226'),

(10003, 'a10003',cast( '2015-11-03' as date), current_timestamp,'99999999','20240226'),

(10004, 'a10004',cast( '2013-08-27' as date), current_timestamp,'99999999','20240226');

select * from example_test01 ;

(5) Modification of data

update example_test01 set name = 'XXXXXX' where id = 10004 ;

select * from example_test01 where id = 10004 ;

(6) Deletion of data

delete from example_test01 where id = 10004 ;

select * from example_test01 ;

(7) View all tables

show tables;

(8) Viewing Table Structure and Table Building Statements

desc example_test01 ;

show create table example_test01;

Test to see if the table can be read in hive.

select * from example_test01 ;

As you can see, the table created through Trino is not queried in Hive.

Why?

 

Trino and Hive create Iceberg tables with different serialization rules (ROW FORMAT SERDE) and storage formats (STORED BY).

--Create the generated Iceberg table via Trino:

CREATE EXTERNAL TABLE `example_test01`(

  `id` int,

  `name` string,

  `birthday` date,

  `create_time` timestamp,

  `provincial` string,

  `ds` string)

ROW FORMAT SERDE  '.'

STORED AS INPUTFORMAT  ''

OUTPUTFORMAT  ''

LOCATION  'hdfs://192.168.80.131:8020/data/warehouse/iceberg-hive/example_test01-50b32dc5ec9247498ea7fb35d5f526bb'

TBLPROPERTIES (

  'metadata_location'='hdfs://192.168.80.131:8020/data/warehouse/iceberg-hive/example_test01-50b32dc5ec9247498ea7fb35d5f526bb/metadata/',

  'previous_metadata_location'='hdfs://192.168.80.131:8020/data/warehouse/iceberg-hive/example_test01-50b32dc5ec9247498ea7fb35d5f526bb/metadata/',

  'table_type'='ICEBERG',

  'transient_lastDdlTime'='1709000455');

 

--Iceberg table created via Hive

CREATE TABLE `iceberg_test001`(

  `id` int COMMENT 'from deserializer',

  `name` string COMMENT 'from deserializer',

  `birthday` date COMMENT 'from deserializer',

  `create_time` timestamp COMMENT 'from deserializer',

  `provincial` string COMMENT 'from deserializer',

  `ds` string COMMENT 'from deserializer')

ROW FORMAT SERDE  ''

STORED BY  ''

LOCATION  'hdfs://bdc01/user/hive/warehouse/iceberg_db.db/iceberg_test001'

TBLPROPERTIES (

  'bucketing_version'='2',

  'current-schema'='{"type":"struct","schema-id":0,"fields":[{"id":1,"name":"id","required":false,"type":"int"},{"id":2,"name":"name","required":false,"type":"string"},{"id":3,"name":"birthday","required":false,"type":"date"},{"id":4,"name":"create_time","required":false,"type":"timestamp"},{"id":5,"name":"provincial","required":false,"type":"string"},{"id":6,"name":"ds","required":false,"type":"string"}]}',

  'current-snapshot-id'='2017496957845643908',

  'current-snapshot-summary'='{"added-data-files":"1","added-records":"4","added-files-size":"1953","changed-partition-count":"1","total-records":"4","total-files-size":"1953","total-data-files":"1","total-delete-files":"0","total-position-deletes":"0","total-equality-deletes":"0"}',

  'current-snapshot-timestamp-ms'='1708941864398',

  'default-partition-spec'='{"spec-id":0,"fields":[{"name":"provincial","transform":"identity","source-id":5,"field-id":1000},{"name":"ds","transform":"identity","source-id":6,"field-id":1001}]}',

  ''='true',

  ''='TRUE',

  ''='iceberg_hive',

  'last_modified_by'='root',

  'last_modified_time'='1708941860',

  'metadata_location'='hdfs://bdc01/user/hive/warehouse/iceberg_db.db/iceberg_test001/metadata/',

  'previous_metadata_location'='hdfs://bdc01/user/hive/warehouse/iceberg_db.db/iceberg_test001/metadata/',

  'snapshot-count'='1',

  'table_type'='ICEBERG',

  'transient_lastDdlTime'='1708941860',

  'uuid'='164870ac-489f-4434-a34c-3ed50340ed34')

7.5.2. Operations for which Iceberg tables already exist

(1) View all schemas under iceberg (corresponding to the database)

show schemas from iceberg;

If the connection fails, you can check the log /var/log/trino/

(2) View all tables in the database

show tables from iceberg.iceberg_db;

(3) View the table structure

desc iceberg.iceberg_db.iceberg_test001;

Iceberg table created through Hive is not accessible in Trino. Why?

 

chapFunctional verification

1. cross-source associative computing

./trino-cli --server localhost:8080

--Query table data

select * from .tbl001

select * from .test001 ;

select * from ;

select * from .tbl001;

select * from iceberg.iceberg_hive.example_test01;

 

--MySQL and postgreSQL Associations

select

,

 mysql_name,

 pg_name,

 kafka_name,

  hive_name,

 iceberg_name

from  .tbl001   my

inner join .test001   pg  on   =

inner join    kfk   on   = cast( as bigint)

inner join  .tbl001  hv    on   =

inner join  iceberg.iceberg_hive.example_test01  icbg  on = ;