cd /root/trino/trino-server-363/
./trino --server 10.201.0.125:8080 --catalog hive --schema tpcds -f /root/trino/tpcds-kit/TpcdsData/script/insert_data.sql
【重要说明】
- --server:修改为自己的IP地址
- --schema:数据库名称
- insert_data.sql:改为自己存放如下SQL脚本的文件名称与路径
SQL脚本:
select now(); insert into postgresql.public.call_center select * from hive.tpcds.call_center; select now(); insert into postgresql.public.catalog_page select * from hive.tpcds.catalog_page; select now(); insert into postgresql.public.catalog_returns select * from hive.tpcds.catalog_returns; select now(); insert into postgresql.public.catalog_sales select * from hive.tpcds.catalog_sales; select now(); insert into postgresql.public.customer_address select * from hive.tpcds.customer_address; select now(); insert into postgresql.public.customer select * from hive.tpcds.customer; select now(); insert into postgresql.public.customer_demographics select * from hive.tpcds.customer_demographics; select now(); insert into postgresql.public.date_dim select * from hive.tpcds.date_dim; select now(); insert into postgresql.public.household_demographics select * from hive.tpcds.household_demographics; select now(); insert into postgresql.public.income_band select * from hive.tpcds.income_band; select now(); insert into postgresql.public.inventory select * from hive.tpcds.inventory; select now(); insert into postgresql.public.item select * from hive.tpcds.item; select now(); insert into postgresql.public.promotion select * from hive.tpcds.promotion; select now(); insert into postgresql.public.reason select * from hive.tpcds.reason; select now(); insert into postgresql.public.ship_mode select * from hive.tpcds.ship_mode; select now(); insert into postgresql.public.store select * from hive.tpcds.store; select now(); insert into postgresql.public.store_returns select * from hive.tpcds.store_returns; select now(); insert into postgresql.public.store_sales select * from hive.tpcds.store_sales; select now(); insert into postgresql.public.time_dim select * from hive.tpcds.time_dim; select now(); insert into postgresql.public.warehouse select * from hive.tpcds.warehouse; select now(); insert into postgresql.public.web_page select * from hive.tpcds.web_page; select now(); insert into postgresql.public.web_returns select * from hive.tpcds.web_returns; select now(); insert into postgresql.public.web_sales select * from hive.tpcds.web_sales; select now(); insert into postgresql.public.web_site select * from hive.tpcds.web_site; select now();
【重要说明】
insert每插入一条SQL要记录它的插入时间,因此添加select now();执行后的示例如下所示: