Skip to content

Commit

Permalink
Add ps_suppkey col
Browse files Browse the repository at this point in the history
  • Loading branch information
JayjeetAtGithub committed Jul 18, 2024
1 parent 446e582 commit 39cf97c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions cpp/benchmarks/common/cudf_datagen/dbgen.cu
Original file line number Diff line number Diff line change
Expand Up @@ -397,32 +397,32 @@ void generate_partsupp(int64_t const& scale_factor,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource())
{
cudf::size_type num_rows_part = 200000 * scale_factor;
cudf::size_type num_rows = 800000 * scale_factor;
cudf::size_type const num_rows_part = 200000 * scale_factor;
cudf::size_type const num_rows = 800000 * scale_factor;

// Generate the `ps_partkey` column
auto p_partkey = gen_primary_key_col(1, num_rows_part);
auto rep_freq_empty = cudf::make_numeric_column(cudf::data_type{cudf::type_id::INT64},
num_rows_part,
cudf::mask_state::UNALLOCATED,
cudf::get_default_stream());
auto rep_freq =
auto const p_partkey = gen_primary_key_col(1, num_rows_part);
auto const rep_freq_empty = cudf::make_numeric_column(cudf::data_type{cudf::type_id::INT64},
num_rows_part,
cudf::mask_state::UNALLOCATED,
cudf::get_default_stream());
auto const rep_freq =
cudf::fill(rep_freq_empty->view(), 0, num_rows_part, cudf::numeric_scalar<int64_t>(4));
auto rep_table = cudf::repeat(cudf::table_view({p_partkey->view()}), rep_freq->view());
auto ps_partkey = rep_table->get_column(0);
auto const rep_table = cudf::repeat(cudf::table_view({p_partkey->view()}), rep_freq->view());
auto const ps_partkey = rep_table->get_column(0);

// Generate the `ps_suppkey` column
auto ps_suppkey = calc_ps_suppkey(ps_partkey.view(), scale_factor, num_rows);
auto const ps_suppkey = calc_ps_suppkey(ps_partkey.view(), scale_factor, num_rows);

// Generate the `p_availqty` column
auto ps_availqty = gen_rand_num_col<int64_t>(1, 9999, num_rows);
auto const ps_availqty = gen_rand_num_col<int64_t>(1, 9999, num_rows);

// Generate the `p_supplycost` column
auto ps_supplycost = gen_rand_num_col<double>(1.00, 1000.00, num_rows);
auto const ps_supplycost = gen_rand_num_col<double>(1.00, 1000.00, num_rows);

// Generate the `p_comment` column
// NOTE: This column is not compliant with clause 4.2.2.10 of the TPC-H specification
auto ps_comment = gen_rand_str_col(49, 198, num_rows);
auto const ps_comment = gen_rand_str_col(49, 198, num_rows);

auto partsupp = cudf::table_view({ps_partkey.view(),
ps_suppkey->view(),
Expand Down

0 comments on commit 39cf97c

Please sign in to comment.