iChauster commented on code in PR #13426: URL: https://github.com/apache/arrow/pull/13426#discussion_r919318904
########## cpp/src/arrow/compute/exec/asof_join_benchmark.cc: ########## @@ -0,0 +1,568 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#include <boost/process.hpp> +#include <string> + +#include "benchmark/benchmark.h" + +#include "arrow/compute/exec/test_util.h" +#include "arrow/csv/writer.h" +#include "arrow/dataset/file_parquet.h" +#include "arrow/filesystem/api.h" +#include "arrow/ipc/api.h" +#include "arrow/table.h" +#include "arrow/testing/future_util.h" + +namespace arrow { +namespace compute { + +static const char* time_col = "time"; +static const char* key_col = "id"; +static bool createdBenchmarkFiles = false; +// static std::shared_ptr<arrow::internal::TemporaryDir> temp_dir = +// arrow::internal::TemporaryDir::Make("./benchmark_data/").ValueOrDie(); + +struct ReaderNodeTableProperties { + ExecNode* execNode; + size_t total_rows; + size_t total_bytes; +}; + +// requires export PYTHONPATH=/path/to/benchmark_scripts/table_generation +// calls generate_benchmark_files to create tables (feather files) varying in frequency, +// width, key density for benchmarks. places generated files in benchmark/data. This +// operation runs once at the beginning of benchmarking. +static void DoSetup() { + if (!createdBenchmarkFiles) { + boost::process::system("mkdir benchmark_data/"); + std::error_code err; + boost::process::system("python3 -m generate_benchmark_files ./benchmark_data/", err); + if (err) { Review Comment: Also, is there an elegant way to access the path to `benchmark_scripts/table_generation`? Thinking about injecting this into the PYTHONPATH (passing in the environment to boost::process). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org