• 【TPCDS】trino+S3+hive+postgresql性能测试脚本批量插入数据的方式(七)


    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();执行后的示例如下所示:
     

    1.作者:Syw
    2.出处:http://www.cnblogs.com/syw20170419/
    3.本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
    4.如果文中有什么错误,欢迎指出。以免更多的人被误导。
  • 相关阅读:
    命名规范
    操作文件和目录
    使用本地shadow socks代理
    发送邮件
    sql参数化
    定义常量
    获取嵌套字典值的方法
    通过字符串调用函数
    用字典优化过长的if 语句
    操作文件和目录
  • 原文地址:https://www.cnblogs.com/syw20170419/p/15593685.html
Copyright © 2020-2023  润新知