Welcome to my personal place for love, peace and happiness❣️

Загрузка данных iceberg в Trino

Создание схем

CREATE SCHEMA delta.my_schema_d
WITH (location = ‘s3a://test/delta_p’);

CREATE SCHEMA hive.my_schema_h
WITH (location = ‘s3a://test/hive_p’);

CREATE SCHEMA iceberg.my_schema_i
WITH (location = ‘s3a://test/iceberg_p’);

Создание таблицы на базе CSV

create table hive.my_schema_h.taxi_p (
VendorID bigint,
tpep_pickup_datetime varchar,
tpep_dropoff_datetime varchar,
passenger_count bigint,
trip_distance decimal(20,2),
RatecodeID bigint,
store_and_fwd_flag varchar,
PULocationID bigint,
DOLocationID bigint,
payment_type bigint,
fare_amount decimal(20,2),
extra decimal(20,2),
mta_tax decimal(20,2),
tip_amount decimal(20,2),
tolls_amount decimal(20,2),
improvement_surcharge decimal(20,2),
total_amount decimal(20,2))
WITH (
format = ‘TEXTFILE’,
textfile_field_separator = ‘,’,
skip_header_line_count=1
);

Создание таблицы iceberg

create table iceberg.my_schema_i.taxi_i (
VendorID bigint,
tpep_pickup_datetime varchar,
tpep_dropoff_datetime varchar,
passenger_count bigint,
trip_distance decimal(20,2),
RatecodeID bigint,
store_and_fwd_flag varchar,
PULocationID bigint,
DOLocationID bigint,
payment_type bigint,
fare_amount decimal(20,2),
extra decimal(20,2),
mta_tax decimal(20,2),
tip_amount decimal(20,2),
tolls_amount decimal(20,2),
improvement_surcharge decimal(20,2),
total_amount decimal(20,2))

Запись таблицы iceberg

insert into iceberg.my_schema_i.taxi_i select * from hive.my_schema_h.taxi_p

Follow this blog
Send
Share
2023   SQL