tpch10gb.td 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. # COPY TO expressions should immediately succeed or fail on their first runs
  10. $ set-max-tries max-tries=1
  11. > CREATE SCHEMA tpch10gb
  12. > CREATE SOURCE tpch10gb.source FROM LOAD GENERATOR TPCH (SCALE FACTOR 10)
  13. > CREATE TABLE customer FROM SOURCE tpch10gb.source (REFERENCE customer);
  14. > CREATE TABLE lineitem FROM SOURCE tpch10gb.source (REFERENCE lineitem);
  15. > CREATE TABLE nation FROM SOURCE tpch10gb.source (REFERENCE nation);
  16. > CREATE TABLE orders FROM SOURCE tpch10gb.source (REFERENCE orders);
  17. > CREATE TABLE part FROM SOURCE tpch10gb.source (REFERENCE part);
  18. > CREATE TABLE partsupp FROM SOURCE tpch10gb.source (REFERENCE partsupp);
  19. > CREATE TABLE region FROM SOURCE tpch10gb.source (REFERENCE region);
  20. > CREATE TABLE supplier FROM SOURCE tpch10gb.source (REFERENCE supplier);
  21. > COPY tpch10gb.customer TO 's3://copytos3/test/tpch10gb/csv/customer'
  22. WITH (
  23. AWS CONNECTION = aws_conn,
  24. MAX FILE SIZE = "100MB",
  25. FORMAT = 'csv'
  26. );
  27. > COPY tpch10gb.lineitem TO 's3://copytos3/test/tpch10gb/csv/lineitem'
  28. WITH (
  29. AWS CONNECTION = aws_conn,
  30. MAX FILE SIZE = "100MB",
  31. FORMAT = 'csv'
  32. );
  33. > COPY tpch10gb.nation TO 's3://copytos3/test/tpch10gb/csv/nation'
  34. WITH (
  35. AWS CONNECTION = aws_conn,
  36. MAX FILE SIZE = "100MB",
  37. FORMAT = 'csv'
  38. );
  39. > COPY tpch10gb.orders TO 's3://copytos3/test/tpch10gb/csv/orders'
  40. WITH (
  41. AWS CONNECTION = aws_conn,
  42. MAX FILE SIZE = "100MB",
  43. FORMAT = 'csv'
  44. );
  45. > COPY tpch10gb.part TO 's3://copytos3/test/tpch10gb/csv/part'
  46. WITH (
  47. AWS CONNECTION = aws_conn,
  48. MAX FILE SIZE = "100MB",
  49. FORMAT = 'csv'
  50. );
  51. > COPY tpch10gb.partsupp TO 's3://copytos3/test/tpch10gb/csv/partsupp'
  52. WITH (
  53. AWS CONNECTION = aws_conn,
  54. MAX FILE SIZE = "100MB",
  55. FORMAT = 'csv'
  56. );
  57. > COPY tpch10gb.region TO 's3://copytos3/test/tpch10gb/csv/region'
  58. WITH (
  59. AWS CONNECTION = aws_conn,
  60. MAX FILE SIZE = "100MB",
  61. FORMAT = 'csv'
  62. );
  63. > COPY tpch10gb.supplier TO 's3://copytos3/test/tpch10gb/csv/supplier'
  64. WITH (
  65. AWS CONNECTION = aws_conn,
  66. MAX FILE SIZE = "100MB",
  67. FORMAT = 'csv'
  68. );
  69. > COPY (SELECT c_custkey, c_name, c_address, c_nationkey, c_phone, c_acctbal::text, c_mktsegment, c_comment FROM tpch10gb.customer) TO 's3://copytos3/test/tpch10gb/parquet/customer'
  70. WITH (
  71. AWS CONNECTION = aws_conn,
  72. MAX FILE SIZE = "10GB",
  73. FORMAT = 'parquet'
  74. );
  75. > COPY (SELECT l_orderkey, l_partkey, l_suppkey, l_linenumber, l_quantity::text, l_extendedprice::text, l_discount::text, l_tax::text, l_returnflag, l_linestatus, l_shipdate, l_commitdate, l_receiptdate, l_shipinstruct, l_shipmode, l_comment FROM tpch10gb.lineitem) TO 's3://copytos3/test/tpch10gb/parquet/lineitem'
  76. WITH (
  77. AWS CONNECTION = aws_conn,
  78. MAX FILE SIZE = "10GB",
  79. FORMAT = 'parquet'
  80. );
  81. > COPY tpch10gb.nation TO 's3://copytos3/test/tpch10gb/parquet/nation'
  82. WITH (
  83. AWS CONNECTION = aws_conn,
  84. MAX FILE SIZE = "10GB",
  85. FORMAT = 'parquet'
  86. );
  87. > COPY (SELECT o_orderkey, o_custkey, o_orderstatus, o_totalprice::text, o_orderdate, o_orderpriority, o_clerk, o_shippriority, o_comment FROM tpch10gb.orders) TO 's3://copytos3/test/tpch10gb/parquet/orders'
  88. WITH (
  89. AWS CONNECTION = aws_conn,
  90. MAX FILE SIZE = "10GB",
  91. FORMAT = 'parquet'
  92. );
  93. > COPY (SELECT p_partkey, p_name, p_mfgr, p_brand, p_type, p_size, p_container, p_retailprice::text, p_comment FROM tpch10gb.part) TO 's3://copytos3/test/tpch10gb/parquet/part'
  94. WITH (
  95. AWS CONNECTION = aws_conn,
  96. MAX FILE SIZE = "10GB",
  97. FORMAT = 'parquet'
  98. );
  99. > COPY (SELECT ps_partkey, ps_suppkey, ps_availqty, ps_supplycost::text, ps_comment FROM tpch10gb.partsupp) TO 's3://copytos3/test/tpch10gb/parquet/partsupp'
  100. WITH (
  101. AWS CONNECTION = aws_conn,
  102. MAX FILE SIZE = "10GB",
  103. FORMAT = 'parquet'
  104. );
  105. > COPY tpch10gb.region TO 's3://copytos3/test/tpch10gb/parquet/region'
  106. WITH (
  107. AWS CONNECTION = aws_conn,
  108. MAX FILE SIZE = "10GB",
  109. FORMAT = 'parquet'
  110. );
  111. > COPY (SELECT s_suppkey, s_name, s_address, s_nationkey, s_phone, s_acctbal::text, s_comment FROM tpch10gb.supplier) TO 's3://copytos3/test/tpch10gb/parquet/supplier'
  112. WITH (
  113. AWS CONNECTION = aws_conn,
  114. MAX FILE SIZE = "10GB",
  115. FORMAT = 'parquet'
  116. );