From de1b2ae843a11b61ed4c6cedf70ff7998982e9b1 Mon Sep 17 00:00:00 2001 From: Richard Barnes Date: Wed, 16 Oct 2024 12:21:31 -0700 Subject: [PATCH] Remove unused-variable in velox/dwio/dwrf/reader/SelectiveStringDictionaryColumnReader.cpp (#11274) Summary: Pull Request resolved: https://github.com/facebookincubator/velox/pull/11274 LLVM-15 has a warning `-Wunused-variable` which we treat as an error because it's so often diagnostic of a code issue. Unused variables can compromise readability or, worse, performance. This diff either (a) removes an unused variable and, possibly, it's associated code or (b) qualifies the variable with `[[maybe_unused]]`. - If you approve of this diff, please use the "Accept & Ship" button :-) Reviewed By: meyering Differential Revision: D64279128 fbshipit-source-id: d0ce7f111be62ac3a6a06ea2c4d7025b4ba5257d --- .../dwio/dwrf/reader/SelectiveStringDictionaryColumnReader.cpp | 1 - velox/exec/GroupingSet.cpp | 1 - velox/exec/HashBuild.cpp | 2 -- velox/functions/prestosql/Probability.h | 1 - 4 files changed, 5 deletions(-) diff --git a/velox/dwio/dwrf/reader/SelectiveStringDictionaryColumnReader.cpp b/velox/dwio/dwrf/reader/SelectiveStringDictionaryColumnReader.cpp index df25566c5bab..ccbaec8429ac 100644 --- a/velox/dwio/dwrf/reader/SelectiveStringDictionaryColumnReader.cpp +++ b/velox/dwio/dwrf/reader/SelectiveStringDictionaryColumnReader.cpp @@ -203,7 +203,6 @@ void SelectiveStringDictionaryColumnReader::read( const RowSet& rows, const uint64_t* incomingNulls) { prepareRead(offset, rows, incomingNulls); - bool isDense = rows.back() == rows.size() - 1; const auto* nullsPtr = nullsInReadRange_ ? nullsInReadRange_->as() : nullptr; // lazy loading dictionary data when first hit diff --git a/velox/exec/GroupingSet.cpp b/velox/exec/GroupingSet.cpp index 5f2970213f68..9a015bb2dc22 100644 --- a/velox/exec/GroupingSet.cpp +++ b/velox/exec/GroupingSet.cpp @@ -846,7 +846,6 @@ void GroupingSet::ensureInputFits(const RowVectorPtr& input) { auto [freeRows, outOfLineFreeBytes] = rows->freeSpace(); const auto outOfLineBytes = rows->stringAllocator().retainedSize() - outOfLineFreeBytes; - const auto outOfLineBytesPerRow = outOfLineBytes / numDistinct; const int64_t flatBytes = input->estimateFlatSize(); // Test-only spill path. diff --git a/velox/exec/HashBuild.cpp b/velox/exec/HashBuild.cpp index e5f5ae639025..498f4569c627 100644 --- a/velox/exec/HashBuild.cpp +++ b/velox/exec/HashBuild.cpp @@ -444,8 +444,6 @@ void HashBuild::ensureInputFits(RowVectorPtr& input) { auto [freeRows, outOfLineFreeBytes] = rows->freeSpace(); const auto outOfLineBytes = rows->stringAllocator().retainedSize() - outOfLineFreeBytes; - const auto outOfLineBytesPerRow = - std::max(1, numRows == 0 ? 0 : outOfLineBytes / numRows); const auto currentUsage = pool()->usedBytes(); if (numRows != 0) { diff --git a/velox/functions/prestosql/Probability.h b/velox/functions/prestosql/Probability.h index f0f92cf4e09b..b80fc9dc7efb 100644 --- a/velox/functions/prestosql/Probability.h +++ b/velox/functions/prestosql/Probability.h @@ -291,7 +291,6 @@ struct InverseCauchyCDFFunction { FOLLY_ALWAYS_INLINE void call(double& result, double median, double scale, double p) { static constexpr double kInf = std::numeric_limits::infinity(); - static constexpr double kDoubleMax = std::numeric_limits::max(); static constexpr double kNan = std::numeric_limits::quiet_NaN(); VELOX_USER_CHECK(p >= 0 && p <= 1, "p must be in the interval [0, 1]");