From fa6463489329da2865f00b3328c0b8689008e776 Mon Sep 17 00:00:00 2001 From: yangchuan Date: Thu, 9 Nov 2023 10:19:25 +0800 Subject: [PATCH] fix --- cpp/core/CMakeLists.txt | 2 +- cpp/core/benchmarks/CompressionBenchmark.cc | 23 +++++++------- cpp/core/compute/Runtime.h | 2 ++ cpp/core/jni/JniCommon.h | 12 +++---- cpp/core/jni/JniWrapper.cc | 3 +- cpp/core/tests/RoundRobinPartitionerTest.cc | 10 +++--- cpp/core/utils/ObjectStore.cc | 3 +- cpp/core/utils/macros.h | 1 + .../benchmarks/ColumnarToRowBenchmark.cc | 12 +++---- cpp/velox/benchmarks/GenericBenchmark.cc | 31 +++++++++---------- cpp/velox/benchmarks/ParquetWriteBenchmark.cc | 18 +++++------ cpp/velox/benchmarks/QueryBenchmark.cc | 2 +- cpp/velox/benchmarks/ShuffleSplitBenchmark.cc | 14 ++++----- cpp/velox/benchmarks/common/BenchmarkUtils.cc | 4 +-- cpp/velox/benchmarks/common/BenchmarkUtils.h | 2 ++ .../benchmarks/common/ParquetReaderIterator.h | 2 +- .../SubstraitToVeloxPlanValidator.cc | 3 +- cpp/velox/udf/examples/MyUDF.cpp | 2 +- 18 files changed, 76 insertions(+), 70 deletions(-) diff --git a/cpp/core/CMakeLists.txt b/cpp/core/CMakeLists.txt index fb7c714a3ef89..73330ade181a1 100644 --- a/cpp/core/CMakeLists.txt +++ b/cpp/core/CMakeLists.txt @@ -325,7 +325,7 @@ else() endif() target_link_libraries(gluten - PUBLIC Arrow::arrow Arrow::parquet) + PUBLIC Arrow::arrow Arrow::parquet glog::glog) install(TARGETS gluten DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/cpp/core/benchmarks/CompressionBenchmark.cc b/cpp/core/benchmarks/CompressionBenchmark.cc index 3e2396818235c..1966c8ef1c189 100644 --- a/cpp/core/benchmarks/CompressionBenchmark.cc +++ b/cpp/core/benchmarks/CompressionBenchmark.cc @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -126,7 +127,7 @@ class BenchmarkCompression { } case gluten::kQatZstd: { ipcWriteOptions.codec = createArrowIpcCodec(arrow::Compression::ZSTD, CodecBackend::QAT); - std::cout << "load qatzstd" << std::endl; + LOG(INFO) << "load qatzstd"; break; } #endif @@ -163,7 +164,7 @@ class BenchmarkCompression { state); auto endTime = std::chrono::steady_clock::now(); auto totalTime = (endTime - startTime).count(); - std::cout << "Thread " << state.thread_index() << " took " << (1.0 * totalTime / 1e9) << "s" << std::endl; + LOG(INFO) << "Thread " << state.thread_index() << " took " << (1.0 * totalTime / 1e9) << "s"; state.counters["rowgroups"] = benchmark::Counter(rowGroupIndices_.size(), benchmark::Counter::kAvgThreads, benchmark::Counter::OneK::kIs1000); @@ -301,8 +302,8 @@ class BenchmarkCompressionCacheScanBenchmark final : public BenchmarkCompression } } while (recordBatch); - std::cout << "parquet parse done elapsed time " << elapseRead / 1e6 << " ms " << std::endl; - std::cout << "batches = " << numBatches << " rows = " << numRows << std::endl; + LOG(INFO) << "parquet parse done elapsed time " << elapseRead / 1e6 << " ms "; + LOG(INFO) << "batches = " << numBatches << " rows = " << numRows; std::vector> payloads(batches.size()); std::vector> uncompressedBufferSize(batches.size()); @@ -418,16 +419,16 @@ int main(int argc, char** argv) { } else if (strcmp(argv[i], "--file") == 0) { datafile = argv[i + 1]; } else if (strcmp(argv[i], "--qat-gzip") == 0) { - std::cout << "QAT gzip is used as codec" << std::endl; + LOG(INFO) << "QAT gzip is used as codec"; codec = gluten::kQatGzip; } else if (strcmp(argv[i], "--qat-zstd") == 0) { - std::cout << "QAT zstd is used as codec" << std::endl; + LOG(INFO) << "QAT zstd is used as codec"; codec = gluten::kQatZstd; } else if (strcmp(argv[i], "--qpl-gzip") == 0) { - std::cout << "QPL gzip is used as codec" << std::endl; + LOG(INFO) << "QPL gzip is used as codec"; codec = gluten::kQplGzip; } else if (strcmp(argv[i], "--zstd") == 0) { - std::cout << "CPU zstd is used as codec" << std::endl; + LOG(INFO) << "CPU zstd is used as codec"; codec = gluten::kZstd; } else if (strcmp(argv[i], "--buffer-size") == 0) { compressBufferSize = atol(argv[i + 1]); @@ -435,9 +436,9 @@ int main(int argc, char** argv) { cpuOffset = atol(argv[i + 1]); } } - std::cout << "iterations = " << iterations << std::endl; - std::cout << "threads = " << threads << std::endl; - std::cout << "datafile = " << datafile << std::endl; + LOG(INFO) << "iterations = " << iterations; + LOG(INFO) << "threads = " << threads; + LOG(INFO) << "datafile = " << datafile; gluten::BenchmarkCompressionIterateScanBenchmark bmIterateScan(datafile, compressBufferSize); gluten::BenchmarkCompressionCacheScanBenchmark bmCacheScan(datafile, compressBufferSize); diff --git a/cpp/core/compute/Runtime.h b/cpp/core/compute/Runtime.h index beb9bb9cc1ef3..62281304e9e8f 100644 --- a/cpp/core/compute/Runtime.h +++ b/cpp/core/compute/Runtime.h @@ -17,6 +17,8 @@ #pragma once +#include + #include "compute/ProtobufUtils.h" #include "compute/ResultIterator.h" #include "memory/ArrowMemoryPool.h" diff --git a/cpp/core/jni/JniCommon.h b/cpp/core/jni/JniCommon.h index 4d4bf5e3fe564..fd953992781bd 100644 --- a/cpp/core/jni/JniCommon.h +++ b/cpp/core/jni/JniCommon.h @@ -52,7 +52,7 @@ static inline void checkException(JNIEnv* env) { std::string description = jStringToCString(env, (jstring)env->CallStaticObjectMethod(describerClass, describeMethod, t)); if (env->ExceptionCheck()) { - std::cerr << "Fatal: Uncaught Java exception during calling the Java exception describer method! " << std::endl; + LOG(WARNING) << "Fatal: Uncaught Java exception during calling the Java exception describer method! "; } throw gluten::GlutenException("Error during calling Java code from native code: " + description); } @@ -161,7 +161,7 @@ static inline void backtrace() { auto size = backtrace(array, 1024); char** strings = backtrace_symbols(array, size); for (size_t i = 0; i < size; ++i) { - std::cout << strings[i] << std::endl; + LOG(INFO) << strings[i]; } free(strings); } @@ -232,8 +232,8 @@ class SparkAllocationListener final : public gluten::AllocationListener { ~SparkAllocationListener() override { JNIEnv* env; if (vm_->GetEnv(reinterpret_cast(&env), jniVersion) != JNI_OK) { - std::cerr << "SparkAllocationListener#~SparkAllocationListener(): " - << "JNIEnv was not attached to current thread" << std::endl; + LOG(WARNING) << "SparkAllocationListener#~SparkAllocationListener(): " + << "JNIEnv was not attached to current thread"; return; } env->DeleteGlobalRef(jListenerGlobalRef_); @@ -332,8 +332,8 @@ class CelebornClient : public RssClient { ~CelebornClient() { JNIEnv* env; if (vm_->GetEnv(reinterpret_cast(&env), jniVersion) != JNI_OK) { - std::cerr << "CelebornClient#~CelebornClient(): " - << "JNIEnv was not attached to current thread" << std::endl; + LOG(WARNING) << "CelebornClient#~CelebornClient(): " + << "JNIEnv was not attached to current thread"; return; } env->DeleteGlobalRef(javaCelebornShuffleWriter_); diff --git a/cpp/core/jni/JniWrapper.cc b/cpp/core/jni/JniWrapper.cc index e311da0d61776..1bb496ef108d6 100644 --- a/cpp/core/jni/JniWrapper.cc +++ b/cpp/core/jni/JniWrapper.cc @@ -18,7 +18,6 @@ #include #include -#include #include "compute/ProtobufUtils.h" #include "compute/Runtime.h" #include "config/GlutenConfig.h" @@ -798,7 +797,7 @@ JNIEXPORT jlong JNICALL Java_io_glutenproject_vectorized_ShuffleWriterJniWrapper jobject thread = env->CallStaticObjectMethod(cls, mid); checkException(env); if (thread == NULL) { - std::cerr << "Thread.currentThread() return NULL" << std::endl; + LOG(WARNING) << "Thread.currentThread() return NULL"; } else { jmethodID midGetid = getMethodIdOrError(env, cls, "getId", "()J"); jlong sid = env->CallLongMethod(thread, midGetid); diff --git a/cpp/core/tests/RoundRobinPartitionerTest.cc b/cpp/core/tests/RoundRobinPartitionerTest.cc index 5fb3e00feb191..c500c025a8995 100644 --- a/cpp/core/tests/RoundRobinPartitionerTest.cc +++ b/cpp/core/tests/RoundRobinPartitionerTest.cc @@ -15,6 +15,7 @@ * limitations under the License. */ #include "shuffle/RoundRobinPartitioner.h" +#include #include #include @@ -46,10 +47,11 @@ class RoundRobinPartitionerTest : public ::testing::Test { template void toString(const std::vector& vec, const std::string& name) const { - std::cout << name << " = ["; - std::copy(vec.cbegin(), vec.cend(), std::ostream_iterator(std::cout, ",")); - std::cout << " ]"; - std::cout << std::endl; + std::stringstream ss; + ss << name << " = ["; + std::copy(vec.cbegin(), vec.cend(), std::ostream_iterator(ss, ",")); + ss << " ]"; + LOG(INFO) << ss.str(); } int32_t getPidSelection() const { diff --git a/cpp/core/utils/ObjectStore.cc b/cpp/core/utils/ObjectStore.cc index 4a8e7c7ea2f44..5dc9c7843a73a 100644 --- a/cpp/core/utils/ObjectStore.cc +++ b/cpp/core/utils/ObjectStore.cc @@ -16,6 +16,7 @@ */ #include "ObjectStore.h" +#include #include gluten::ObjectStore::~ObjectStore() { @@ -24,7 +25,7 @@ gluten::ObjectStore::~ObjectStore() { for (auto itr = aliveObjectHandles_.rbegin(); itr != aliveObjectHandles_.rend(); itr++) { ResourceHandle handle = *itr; if (store_.lookup(handle) == nullptr) { - std::cerr << "Fatal: resource handle " + std::to_string(handle) + " not found in store." << std::endl; + LOG(WARNING) << "Fatal: resource handle " + std::to_string(handle) + " not found in store."; } store_.erase(handle); } diff --git a/cpp/core/utils/macros.h b/cpp/core/utils/macros.h index 6fd0f15c04542..fef8ae1e75de9 100644 --- a/cpp/core/utils/macros.h +++ b/cpp/core/utils/macros.h @@ -20,6 +20,7 @@ #include #include +#include #include #include "utils/exception.h" diff --git a/cpp/velox/benchmarks/ColumnarToRowBenchmark.cc b/cpp/velox/benchmarks/ColumnarToRowBenchmark.cc index 0951b08bf7fc9..73af9b04eeee5 100644 --- a/cpp/velox/benchmarks/ColumnarToRowBenchmark.cc +++ b/cpp/velox/benchmarks/ColumnarToRowBenchmark.cc @@ -129,7 +129,7 @@ class GoogleBenchmarkColumnarToRowCacheScanBenchmark : public GoogleBenchmarkCol localSchema = std::make_shared(*schema_.get()); if (state.thread_index() == 0) - std::cout << localSchema->ToString() << std::endl; + LOG(INFO) << localSchema->ToString(); std::unique_ptr<::parquet::arrow::FileReader> parquetReader; std::shared_ptr recordBatchReader; @@ -148,7 +148,7 @@ class GoogleBenchmarkColumnarToRowCacheScanBenchmark : public GoogleBenchmarkCol } } while (recordBatch); - std::cout << " parquet parse done elapsed time = " << elapseRead / 1000000 << " rows = " << numRows << std::endl; + LOG(INFO) << " parquet parse done elapsed time = " << elapseRead / 1000000 << " rows = " << numRows; // reuse the columnarToRowConverter for batches caused system % increase a lot auto ctxPool = defaultLeafVeloxMemoryPool(); @@ -261,10 +261,10 @@ int main(int argc, char** argv) { cpu = atol(argv[i + 1]); } } - std::cout << "iterations = " << iterations << std::endl; - std::cout << "threads = " << threads << std::endl; - std::cout << "datafile = " << datafile << std::endl; - std::cout << "cpu = " << cpu << std::endl; + LOG(INFO) << "iterations = " << iterations; + LOG(INFO) << "threads = " << threads; + LOG(INFO) << "datafile = " << datafile; + LOG(INFO) << "cpu = " << cpu; gluten::GoogleBenchmarkColumnarToRowCacheScanBenchmark bck(datafile); diff --git a/cpp/velox/benchmarks/GenericBenchmark.cc b/cpp/velox/benchmarks/GenericBenchmark.cc index 02f6a98d34e06..24c066c135c06 100644 --- a/cpp/velox/benchmarks/GenericBenchmark.cc +++ b/cpp/velox/benchmarks/GenericBenchmark.cc @@ -183,7 +183,7 @@ auto BM_Generic = [](::benchmark::State& state, return; } if (FLAGS_print_result) { - std::cout << maybeBatch.ValueOrDie()->ToString() << std::endl; + LOG(INFO) << maybeBatch.ValueOrDie()->ToString(); } } @@ -203,7 +203,7 @@ auto BM_Generic = [](::benchmark::State& state, const auto& task = rawIter->task_; const auto& planNode = rawIter->veloxPlan_; auto statsStr = facebook::velox::exec::printPlanWithStats(*planNode, task->taskStats(), true); - std::cout << statsStr << std::endl; + LOG(INFO) << statsStr; } Runtime::release(runtime); @@ -237,10 +237,9 @@ int main(int argc, char** argv) { try { if (argc < 2) { - std::cout << "No input args. Usage: " << std::endl - << "./generic_benchmark /path/to/substrait_json_file /path/to/data_file_1 /path/to/data_file_2 ..." - << std::endl; - std::cout << "Running example..." << std::endl; + LOG(INFO) << "No input args. Usage: " << std::endl + << "./generic_benchmark /path/to/substrait_json_file /path/to/data_file_1 /path/to/data_file_2 ..."; + LOG(INFO) << "Running example..."; inputFiles.resize(2); substraitJsonFile = getGeneratedFilePath("example.json"); inputFiles[0] = getGeneratedFilePath("example_orders"); @@ -248,16 +247,16 @@ int main(int argc, char** argv) { } else { substraitJsonFile = argv[1]; abortIfFileNotExists(substraitJsonFile); - std::cout << "Using substrait json file: " << std::endl << substraitJsonFile << std::endl; - std::cout << "Using " << argc - 2 << " input data file(s): " << std::endl; + LOG(INFO) << "Using substrait json file: " << std::endl << substraitJsonFile; + LOG(INFO) << "Using " << argc - 2 << " input data file(s): "; for (auto i = 2; i < argc; ++i) { inputFiles.emplace_back(argv[i]); abortIfFileNotExists(inputFiles.back()); - std::cout << inputFiles.back() << std::endl; + LOG(INFO) << inputFiles.back(); } } } catch (const std::exception& e) { - std::cout << "Failed to run benchmark: " << e.what() << std::endl; + LOG(INFO) << "Failed to run benchmark: " << e.what(); ::benchmark::Shutdown(); std::exit(EXIT_FAILURE); } @@ -278,12 +277,12 @@ int main(int argc, char** argv) { } while (0) #if 0 - std::cout << "FLAGS_threads:" << FLAGS_threads << std::endl; - std::cout << "FLAGS_iterations:" << FLAGS_iterations << std::endl; - std::cout << "FLAGS_cpu:" << FLAGS_cpu << std::endl; - std::cout << "FLAGS_print_result:" << FLAGS_print_result << std::endl; - std::cout << "FLAGS_write_file:" << FLAGS_write_file << std::endl; - std::cout << "FLAGS_batch_size:" << FLAGS_batch_size << std::endl; + LOG(INFO) << "FLAGS_threads:" << FLAGS_threads ; + LOG(INFO) << "FLAGS_iterations:" << FLAGS_iterations ; + LOG(INFO) << "FLAGS_cpu:" << FLAGS_cpu ; + LOG(INFO) << "FLAGS_print_result:" << FLAGS_print_result ; + LOG(INFO) << "FLAGS_write_file:" << FLAGS_write_file ; + LOG(INFO) << "FLAGS_batch_size:" << FLAGS_batch_size ; #endif if (FLAGS_skip_input) { diff --git a/cpp/velox/benchmarks/ParquetWriteBenchmark.cc b/cpp/velox/benchmarks/ParquetWriteBenchmark.cc index 3f0fb2fce0db3..42445f93a346f 100644 --- a/cpp/velox/benchmarks/ParquetWriteBenchmark.cc +++ b/cpp/velox/benchmarks/ParquetWriteBenchmark.cc @@ -139,7 +139,7 @@ class GoogleBenchmarkArrowParquetWriteCacheScanBenchmark : public GoogleBenchmar localSchema = std::make_shared(*schema_.get()); if (state.thread_index() == 0) - std::cout << localSchema->ToString() << std::endl; + LOG(INFO) << localSchema->ToString(); std::unique_ptr<::parquet::arrow::FileReader> parquetReader; std::shared_ptr recordBatchReader; @@ -158,7 +158,7 @@ class GoogleBenchmarkArrowParquetWriteCacheScanBenchmark : public GoogleBenchmar } } while (recordBatch); - std::cout << " parquet parse done elapsed time = " << elapseRead / 1000000 << " rows = " << numRows << std::endl; + LOG(INFO) << " parquet parse done elapsed time = " << elapseRead / 1000000 << " rows = " << numRows; // reuse the ParquetWriteConverter for batches caused system % increase a lot auto fileName = "arrow_parquet_write.parquet"; @@ -232,7 +232,7 @@ class GoogleBenchmarkVeloxParquetWriteCacheScanBenchmark : public GoogleBenchmar localSchema = std::make_shared(*schema_.get()); if (state.thread_index() == 0) - std::cout << localSchema->ToString() << std::endl; + LOG(INFO) << localSchema->ToString(); std::unique_ptr<::parquet::arrow::FileReader> parquetReader; std::shared_ptr recordBatchReader; @@ -251,7 +251,7 @@ class GoogleBenchmarkVeloxParquetWriteCacheScanBenchmark : public GoogleBenchmar } } while (recordBatch); - std::cout << " parquet parse done elapsed time = " << elapseRead / 1000000 << " rows = " << numRows << std::endl; + LOG(INFO) << " parquet parse done elapsed time = " << elapseRead / 1000000 << " rows = " << numRows; // reuse the ParquetWriteConverter for batches caused system % increase a lot auto fileName = "velox_parquet_write.parquet"; @@ -323,11 +323,11 @@ int main(int argc, char** argv) { output = (argv[i + 1]); } } - std::cout << "iterations = " << iterations << std::endl; - std::cout << "threads = " << threads << std::endl; - std::cout << "datafile = " << datafile << std::endl; - std::cout << "cpu = " << cpu << std::endl; - std::cout << "output = " << output << std::endl; + LOG(INFO) << "iterations = " << iterations; + LOG(INFO) << "threads = " << threads; + LOG(INFO) << "datafile = " << datafile; + LOG(INFO) << "cpu = " << cpu; + LOG(INFO) << "output = " << output; gluten::GoogleBenchmarkVeloxParquetWriteCacheScanBenchmark bck(datafile, output); diff --git a/cpp/velox/benchmarks/QueryBenchmark.cc b/cpp/velox/benchmarks/QueryBenchmark.cc index 9c29edd815caa..021981ab1124e 100644 --- a/cpp/velox/benchmarks/QueryBenchmark.cc +++ b/cpp/velox/benchmarks/QueryBenchmark.cc @@ -101,7 +101,7 @@ auto BM = [](::benchmark::State& state, state.SkipWithError(maybeBatch.status().message().c_str()); return; } - std::cout << maybeBatch.ValueOrDie()->ToString() << std::endl; + LOG(INFO) << maybeBatch.ValueOrDie()->ToString(); } } Runtime::release(runtime); diff --git a/cpp/velox/benchmarks/ShuffleSplitBenchmark.cc b/cpp/velox/benchmarks/ShuffleSplitBenchmark.cc index c4aec9650e1b7..a1e5eb9066502 100644 --- a/cpp/velox/benchmarks/ShuffleSplitBenchmark.cc +++ b/cpp/velox/benchmarks/ShuffleSplitBenchmark.cc @@ -254,7 +254,7 @@ class BenchmarkShuffleSplitCacheScanBenchmark : public BenchmarkShuffleSplit { localSchema = std::make_shared(fields); if (state.thread_index() == 0) - std::cout << localSchema->ToString() << std::endl; + LOG(INFO) << localSchema->ToString(); auto pool = options.memory_pool; GLUTEN_ASSIGN_OR_THROW( @@ -279,8 +279,8 @@ class BenchmarkShuffleSplitCacheScanBenchmark : public BenchmarkShuffleSplit { numRows += recordBatch->num_rows(); } } while (recordBatch); - std::cout << "parquet parse done elapsed time " << elapseRead / 1000000 << " ms " << std::endl; - std::cout << "batches = " << numBatches << " rows = " << numRows << std::endl; + LOG(INFO) << "parquet parse done elapsed time " << elapseRead / 1000000 << " ms "; + LOG(INFO) << "batches = " << numBatches << " rows = " << numRows; for (auto _ : state) { for_each( @@ -291,8 +291,8 @@ class BenchmarkShuffleSplitCacheScanBenchmark : public BenchmarkShuffleSplit { ARROW_ASSIGN_OR_THROW(cb, recordBatch2VeloxColumnarBatch(*recordBatch)); TIME_NANO_OR_THROW(splitTime, shuffleWriter->split(cb, ShuffleWriter::kMinMemLimit)); }); - // std::cout << " split done memory allocated = " << - // options.memory_pool->bytes_allocated() << std::endl; + // LOG(INFO) << " split done memory allocated = " << + // options.memory_pool->bytes_allocated() ; } TIME_NANO_OR_THROW(splitTime, shuffleWriter->stop()); @@ -315,7 +315,7 @@ class BenchmarkShuffleSplitIterateScanBenchmark : public BenchmarkShuffleSplit { ShuffleWriterOptions options, benchmark::State& state) { if (state.thread_index() == 0) - std::cout << schema_->ToString() << std::endl; + LOG(INFO) << schema_->ToString(); GLUTEN_ASSIGN_OR_THROW( shuffleWriter, @@ -353,7 +353,7 @@ int main(int argc, char** argv) { gflags::ParseCommandLineFlags(&argc, &argv, true); if (FLAGS_file.size() == 0) { - std::cerr << "No input data file. Please specify via argument --file" << std::endl; + LOG(WARNING) << "No input data file. Please specify via argument --file"; } if (FLAGS_partitions == -1) { diff --git a/cpp/velox/benchmarks/common/BenchmarkUtils.cc b/cpp/velox/benchmarks/common/BenchmarkUtils.cc index 00dc804389fe4..f7e0a6ec4c2dc 100644 --- a/cpp/velox/benchmarks/common/BenchmarkUtils.cc +++ b/cpp/velox/benchmarks/common/BenchmarkUtils.cc @@ -117,7 +117,7 @@ bool checkPathExists(const std::string& filepath) { void abortIfFileNotExists(const std::string& filepath) { if (!checkPathExists(filepath)) { - std::cerr << "File path does not exist: " << filepath << std::endl; + LOG(WARNING) << "File path does not exist: " << filepath; ::benchmark::Shutdown(); std::exit(EXIT_FAILURE); } @@ -148,7 +148,7 @@ void setCpu(uint32_t cpuindex) { CPU_ZERO(&cs); CPU_SET(cpuindex, &cs); if (sched_setaffinity(0, sizeof(cs), &cs) == -1) { - std::cerr << "Error binding CPU " << std::to_string(cpuindex) << std::endl; + LOG(WARNING) << "Error binding CPU " << std::to_string(cpuindex); exit(EXIT_FAILURE); } } diff --git a/cpp/velox/benchmarks/common/BenchmarkUtils.h b/cpp/velox/benchmarks/common/BenchmarkUtils.h index 16a22cdb1d50f..dc1221e994ed4 100644 --- a/cpp/velox/benchmarks/common/BenchmarkUtils.h +++ b/cpp/velox/benchmarks/common/BenchmarkUtils.h @@ -18,11 +18,13 @@ #pragma once #include +#include #include #include #include #include #include + #include "benchmark/benchmark.h" #include "substrait/SubstraitToVeloxPlan.h" diff --git a/cpp/velox/benchmarks/common/ParquetReaderIterator.h b/cpp/velox/benchmarks/common/ParquetReaderIterator.h index f6621719786a9..b315aff3e6266 100644 --- a/cpp/velox/benchmarks/common/ParquetReaderIterator.h +++ b/cpp/velox/benchmarks/common/ParquetReaderIterator.h @@ -34,7 +34,7 @@ class ParquetReaderIterator : public FileReaderIterator { fileReader_->GetRecordBatchReader(arrow::internal::Iota(fileReader_->num_row_groups()), &recordBatchReader_)); auto schema = recordBatchReader_->schema(); - std::cout << "schema:\n" << schema->ToString() << std::endl; + LOG(INFO) << "schema:\n" << schema->ToString(); } std::shared_ptr getSchema() override { diff --git a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc index 2b0e85522836c..110a871a09c5f 100644 --- a/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc +++ b/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc @@ -69,8 +69,7 @@ bool validateColNames(const ::substrait::NamedStruct& schema) { for (auto i = 0; i < name.size(); i++) { auto c = name[i]; if (!isUnquotedPathCharacter(c)) { - std::cout << "native validation failed due to: Illegal column charactor " << c << "in column " << name - << std::endl; + LOG(WARNING) << "native validation failed due to: Illegal column charactor " << c << "in column " << name; return false; } } diff --git a/cpp/velox/udf/examples/MyUDF.cpp b/cpp/velox/udf/examples/MyUDF.cpp index 91ae9f753146c..91d9e295d485d 100644 --- a/cpp/velox/udf/examples/MyUDF.cpp +++ b/cpp/velox/udf/examples/MyUDF.cpp @@ -92,5 +92,5 @@ DEFINE_REGISTER_UDF { "myudf1", integerSignatures(), std::make_unique>(5)); facebook::velox::exec::registerVectorFunction( "myudf2", bigintSignatures(), std::make_unique>(5)); - std::cout << "registered myudf1, myudf2" << std::endl; + LOG(INFO) << "registered myudf1, myudf2"; }