From 0433bb6dbd9526911911ef7c7114ca1d63266b80 Mon Sep 17 00:00:00 2001 From: Heidi Han Date: Thu, 2 Jan 2025 15:32:26 -0800 Subject: [PATCH] fix format --- velox/exec/fuzzer/WriterFuzzer.cpp | 32 ++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/velox/exec/fuzzer/WriterFuzzer.cpp b/velox/exec/fuzzer/WriterFuzzer.cpp index 9fd59ece22ea..8b7e59536ee4 100644 --- a/velox/exec/fuzzer/WriterFuzzer.cpp +++ b/velox/exec/fuzzer/WriterFuzzer.cpp @@ -17,8 +17,8 @@ #include -#include #include +#include #include #include "velox/common/base/Fs.h" #include "velox/common/encode/Base64.h" @@ -120,7 +120,7 @@ class WriterFuzzer { // Generates at least one and up to maxNumColumns columns // with a random number of those columns overlapping as bucket by columns. - // Returns the name of the overlapping/gererated columns + // Returns the name of the overlapping/generated columns // and the sort column offset due to overlapping with bucket columns. std::tuple, int> generateSortColumns( int32_t maxNumColumns, @@ -357,7 +357,8 @@ void WriterFuzzer::go() { // 50% of times test ordered write. if (vectorFuzzer_.coinToss(0.5)) { sortColumnOffset = names.size(); - auto [sortColumns, offset] = generateSortColumns(3, names, types, bucketColumns); + auto [sortColumns, offset] = + generateSortColumns(3, names, types, bucketColumns); sortColumnOffset -= offset; sortBy.reserve(sortColumns.size()); for (const auto& sortByColumn : sortColumns) { @@ -423,10 +424,13 @@ std::tuple, int> WriterFuzzer::generateSortColumns( std::vector& names, std::vector& types, std::vector& bucketColumns) { - // A random number of sort columns will overlap as bucket columns, which are already generated - const auto maxOverlapColumns = std::min(maxNumColumns, bucketColumns.size()); + // A random number of sort columns will overlap as bucket columns, which are + // already generated + const auto maxOverlapColumns = + std::min(maxNumColumns, bucketColumns.size()); const auto numOverlapColumns = - boost::random::uniform_int_distribution(0, maxOverlapColumns)(rng_); + boost::random::uniform_int_distribution( + 0, maxOverlapColumns)(rng_); auto overlapOffset = bucketColumns.size() - numOverlapColumns; std::vector columns; @@ -434,12 +438,20 @@ std::tuple, int> WriterFuzzer::generateSortColumns( columns.push_back(bucketColumns[overlapOffset + i]); } - // Remaining columns which do not overlap as bucket by columns are added as new columns with prefix "s" + // Remaining columns which do not overlap as bucket by columns are added as + // new columns with prefix "s" auto remainingColumns = maxNumColumns - numOverlapColumns; if (remainingColumns > 0) { - auto nonOverlapColumns = generateColumns( - remainingColumns, "s", kSupportedSortColumnTypes_, 1, names, types, numOverlapColumns); - columns.insert(columns.end(), nonOverlapColumns.begin(), nonOverlapColumns.end()); + auto nonOverlapColumns = generateColumns( + remainingColumns, + "s", + kSupportedSortColumnTypes_, + 1, + names, + types, + numOverlapColumns); + columns.insert( + columns.end(), nonOverlapColumns.begin(), nonOverlapColumns.end()); } return {columns, numOverlapColumns};