diff --git a/velox/common/memory/MallocAllocator.cpp b/velox/common/memory/MallocAllocator.cpp index 257df7e31fc0..ff44791763ac 100644 --- a/velox/common/memory/MallocAllocator.cpp +++ b/velox/common/memory/MallocAllocator.cpp @@ -138,10 +138,8 @@ bool MallocAllocator::allocateContiguousImpl( } else { VELOX_CHECK_LE(numPages, maxPages); } - [[maybe_unused]] MachinePageCount numCollateralPages = 0; if (collateral != nullptr) { - numCollateralPages = - freeNonContiguous(*collateral) / AllocationTraits::kPageSize; + freeNonContiguous(*collateral); } auto numContiguousCollateralPages = allocation.numPages(); if (numContiguousCollateralPages > 0) { diff --git a/velox/common/memory/tests/ByteStreamTest.cpp b/velox/common/memory/tests/ByteStreamTest.cpp index 7ea2c57d830b..14d7a6016cf2 100644 --- a/velox/common/memory/tests/ByteStreamTest.cpp +++ b/velox/common/memory/tests/ByteStreamTest.cpp @@ -101,12 +101,10 @@ TEST_F(ByteStreamTest, inputStream) { uint8_t* const kFakeBuffer = reinterpret_cast(this); std::vector byteRanges; size_t totalBytes{0}; - [[maybe_unused]] size_t lastRangeEnd; for (int32_t i = 0; i < 32; ++i) { byteRanges.push_back(ByteRange{kFakeBuffer, 4096 + i, 0}); totalBytes += 4096 + i; } - lastRangeEnd = byteRanges.back().size; ByteInputStream byteStream(std::move(byteRanges)); ASSERT_EQ(byteStream.size(), totalBytes); } diff --git a/velox/dwio/common/tests/utils/BatchMaker.cpp b/velox/dwio/common/tests/utils/BatchMaker.cpp index 14dd39df8fd5..603f363ca820 100644 --- a/velox/dwio/common/tests/utils/BatchMaker.cpp +++ b/velox/dwio/common/tests/utils/BatchMaker.cpp @@ -51,14 +51,11 @@ VectorPtr createScalar( BufferPtr nulls = allocateNulls(size, &pool); auto* nullsPtr = nulls->asMutable(); - size_t nullCount = 0; for (size_t i = 0; i < size; ++i) { auto notNull = isNotNull(gen, i, isNullAt); bits::setNull(nullsPtr, i, !notNull); if (notNull) { valuesPtr[i] = val(); - } else { - nullCount++; } } diff --git a/velox/dwio/common/tests/utils/MapBuilder.h b/velox/dwio/common/tests/utils/MapBuilder.h index e4dd5789b49e..b31e7d0e5d87 100644 --- a/velox/dwio/common/tests/utils/MapBuilder.h +++ b/velox/dwio/common/tests/utils/MapBuilder.h @@ -56,7 +56,6 @@ class MapBuilder { BufferPtr valueNulls = allocateNulls(items, &pool); auto* valueNullsPtr = valueNulls->asMutable(); - size_t valueNullCount = 0; auto i = 0; auto offset = 0; @@ -74,7 +73,6 @@ class MapBuilder { valuesPtr[offset] = *pair.second; bits::clearNull(valueNullsPtr, offset); } else { - valueNullCount++; bits::setNull(valueNullsPtr, offset); } ++offset; diff --git a/velox/dwio/dwrf/test/ReaderTest.cpp b/velox/dwio/dwrf/test/ReaderTest.cpp index 98c669ddfd4b..28f67acd190a 100644 --- a/velox/dwio/dwrf/test/ReaderTest.cpp +++ b/velox/dwio/dwrf/test/ReaderTest.cpp @@ -1926,7 +1926,6 @@ void testFlatmapAsMapFieldLifeCycle( auto child = std::dynamic_pointer_cast(result->as()->childAt(0)); BaseVector* rowPtr = result.get(); - MapVector* childPtr = child.get(); Buffer* rawNulls = child->nulls().get(); BufferPtr sizes = child->sizes(); Buffer* rawOffsets = child->offsets().get(); @@ -1947,7 +1946,6 @@ void testFlatmapAsMapFieldLifeCycle( auto mapKeys = child->mapKeys(); auto rawSizes = child->sizes().get(); - childPtr = child.get(); child.reset(); EXPECT_TRUE(rowReader->next(batchSize, result)); @@ -1959,7 +1957,6 @@ void testFlatmapAsMapFieldLifeCycle( EXPECT_NE(mapKeys, child->mapKeys()); // there is a TODO in FlatMapColumnReader next() (result is not reused) // should be EQ; fix: https://fburl.com/code/wtrq8r5q - // EXPECT_EQ(childPtr, child.get()); EXPECT_EQ(rowPtr, result.get()); EXPECT_TRUE(rowReader->next(batchSize, result)); @@ -1971,7 +1968,6 @@ void testFlatmapAsMapFieldLifeCycle( EXPECT_NE(rawSizes, childCurr->sizes().get()); EXPECT_NE(rawOffsets, childCurr->offsets().get()); EXPECT_NE(keysPtr, childCurr->mapKeys().get()); - // EXPECT_EQ(childPtr, childCurr.get()); EXPECT_EQ(rowPtr, result.get()); } diff --git a/velox/dwio/dwrf/test/TestDecompression.cpp b/velox/dwio/dwrf/test/TestDecompression.cpp index 43033158e53c..fbd2e4815dc3 100644 --- a/velox/dwio/dwrf/test/TestDecompression.cpp +++ b/velox/dwio/dwrf/test/TestDecompression.cpp @@ -1155,8 +1155,6 @@ TEST_F(TestSeek, uncompressedLarge) { return 0; }; // Start and size of last Next as offsets to content (no headers). - int32_t lastReadStart = 0; - int32_t lastReadSize = 0; for (auto& pair : ranges) { uint64_t target = pair.first; @@ -1170,8 +1168,6 @@ TEST_F(TestSeek, uncompressedLarge) { EXPECT_EQ(result, addressForOffset(target + readSize)); EXPECT_EQ( size, readSizeForAddress(reinterpret_cast(result))); - lastReadStart = target + readSize; - lastReadSize = size; readSize += size; } while (readSize < targetSize); } diff --git a/velox/dwio/dwrf/test/TestStatisticsBuilderUtils.cpp b/velox/dwio/dwrf/test/TestStatisticsBuilderUtils.cpp index 2b50fac7247b..6f4afacbd297 100644 --- a/velox/dwio/dwrf/test/TestStatisticsBuilderUtils.cpp +++ b/velox/dwio/dwrf/test/TestStatisticsBuilderUtils.cpp @@ -280,10 +280,8 @@ TEST_F(TestStatisticsBuilderUtils, addBinaryValues) { std::array data; std::memset(data.data(), 'a', 10); - size_t total = 0; for (size_t i = 0; i < size; ++i) { valuesPtr[i] = StringView(data.data(), i + 1); - total += (i + 1); } { diff --git a/velox/dwio/dwrf/test/TestStripeStream.cpp b/velox/dwio/dwrf/test/TestStripeStream.cpp index 4c9e5d9a4233..766b6df0d698 100644 --- a/velox/dwio/dwrf/test/TestStripeStream.cpp +++ b/velox/dwio/dwrf/test/TestStripeStream.cpp @@ -69,7 +69,6 @@ void enqueueReads( auto& metadataCache = readerBase.getMetadataCache(); uint64_t offset = stripeStart; uint64_t length = 0; - uint32_t regions = 0; for (const auto& stream : footer.streams()) { length = stream.length(); // If index cache is available, there is no need to read it @@ -81,7 +80,6 @@ void enqueueReads( selector.shouldReadStream(stream.node(), stream.sequence()) && !inMetaCache) { input.enqueue({offset, length}); - regions++; } offset += length; } diff --git a/velox/dwio/parquet/reader/ParquetTypeWithId.cpp b/velox/dwio/parquet/reader/ParquetTypeWithId.cpp index 97891920ff13..85c92d96f844 100644 --- a/velox/dwio/parquet/reader/ParquetTypeWithId.cpp +++ b/velox/dwio/parquet/reader/ParquetTypeWithId.cpp @@ -103,12 +103,8 @@ LevelMode ParquetTypeWithId::makeLevelInfo(LevelInfo& info) const { bool isMap = type()->kind() == TypeKind::MAP; bool hasList = false; if (isStruct) { - bool isAllLists = true; for (auto i = 0; i < getChildren().size(); ++i) { auto& child = parquetChildAt(i); - if (child.type()->kind() != TypeKind ::ARRAY) { - isAllLists = false; - } hasList |= hasList || containsList(child); } } diff --git a/velox/exec/benchmarks/FilterProjectBenchmark.cpp b/velox/exec/benchmarks/FilterProjectBenchmark.cpp index 30d854e8ce1a..c575ffd83cee 100644 --- a/velox/exec/benchmarks/FilterProjectBenchmark.cpp +++ b/velox/exec/benchmarks/FilterProjectBenchmark.cpp @@ -253,9 +253,7 @@ class FilterProjectBenchmark : public VectorTestBase { int64_t run(std::shared_ptr plan) { auto start = getCurrentTimeMicro(); - int32_t numRows = 0; auto result = exec::test::AssertQueryBuilder(plan).copyResults(pool_.get()); - numRows += result->childAt(0)->as>()->valueAt(0); auto elapsedMicros = getCurrentTimeMicro() - start; return elapsedMicros; } diff --git a/velox/exec/benchmarks/HashTableBenchmark.cpp b/velox/exec/benchmarks/HashTableBenchmark.cpp index 2ac69469f8a2..0a41e0d044ce 100644 --- a/velox/exec/benchmarks/HashTableBenchmark.cpp +++ b/velox/exec/benchmarks/HashTableBenchmark.cpp @@ -321,7 +321,6 @@ class HashTableBenchmark : public VectorTestBase { int32_t mask = powerOfTwo - 1; int32_t position = 0; int32_t delta = 1; - int32_t numInserted = 0; auto nextOffset = rowContainer->nextOffset(); // We insert values in a geometric skip order. 1, 2, 4, 7, @@ -340,7 +339,6 @@ class HashTableBenchmark : public VectorTestBase { if (nextOffset) { *reinterpret_cast(newRow + nextOffset) = nullptr; } - ++numInserted; for (auto i = 0; i < batches[batchIndex]->type()->size(); ++i) { rowContainer->store(decoded[batchIndex][i], rowIndex, newRow, i); } diff --git a/velox/exec/fuzzer/PrestoQueryRunner.cpp b/velox/exec/fuzzer/PrestoQueryRunner.cpp index 7831bf350a7a..9e6de7abdffb 100644 --- a/velox/exec/fuzzer/PrestoQueryRunner.cpp +++ b/velox/exec/fuzzer/PrestoQueryRunner.cpp @@ -611,12 +611,10 @@ std::vector PrestoQueryRunner::execute(const std::string& sql) { auto response = ServerResponse(startQuery(sql)); response.throwIfFailed(); - vector_size_t numResults = 0; std::vector queryResults; for (;;) { for (auto& result : response.queryResults(pool_.get())) { queryResults.push_back(result); - numResults += result->size(); } if (response.queryCompleted()) { diff --git a/velox/exec/tests/HashTableTest.cpp b/velox/exec/tests/HashTableTest.cpp index 7e5199d48f69..73ae6a2bacb2 100644 --- a/velox/exec/tests/HashTableTest.cpp +++ b/velox/exec/tests/HashTableTest.cpp @@ -452,16 +452,12 @@ class HashTableTest : public testing::TestWithParam, const auto mode = topTable_->hashMode(); SelectivityInfo hashTime; SelectivityInfo probeTime; - int32_t numHashed = 0; - int32_t numProbed = 0; - int32_t numHit = 0; auto& hashers = topTable_->hashers(); VectorHasher::ScratchMemory scratchMemory; for (auto batchIndex = 0; batchIndex < batches_.size(); ++batchIndex) { const auto& batch = batches_[batchIndex]; lookup->reset(batch->size()); rows.setAll(); - numHashed += batch->size(); { SelectivityTimer timer(hashTime, 0); for (auto i = 0; i < hashers.size(); ++i) { @@ -496,13 +492,11 @@ class HashTableTest : public testing::TestWithParam, } } else { { - numProbed += lookup->rows.size(); SelectivityTimer timer(probeTime, 0); topTable_->joinProbe(*lookup); } for (auto i = 0; i < lookup->rows.size(); ++i) { const auto key = lookup->rows[i]; - numHit += lookup->hits[key] != nullptr; ASSERT_EQ(rowOfKey_[startOffset + key], lookup->hits[key]); } } diff --git a/velox/experimental/wave/exec/tests/utils/FileFormat.cpp b/velox/experimental/wave/exec/tests/utils/FileFormat.cpp index 353e18ba5677..d92c41a67fc8 100644 --- a/velox/experimental/wave/exec/tests/utils/FileFormat.cpp +++ b/velox/experimental/wave/exec/tests/utils/FileFormat.cpp @@ -250,10 +250,8 @@ StringView StringSet::add(StringView data) { std::unique_ptr StringSet::toColumn() { auto buffer = AlignedBuffer::allocate(totalSize_, pool_); - int64_t fill = 0; for (auto& piece : buffers_) { memcpy(buffer->asMutable(), piece->as(), piece->size()); - fill += piece->size(); } auto column = std::make_unique(); column->kind = TypeKind::VARCHAR; diff --git a/velox/functions/prestosql/aggregates/benchmarks/TwoStringKeys.cpp b/velox/functions/prestosql/aggregates/benchmarks/TwoStringKeys.cpp index a2ae98b9a8bc..8c43c625851e 100644 --- a/velox/functions/prestosql/aggregates/benchmarks/TwoStringKeys.cpp +++ b/velox/functions/prestosql/aggregates/benchmarks/TwoStringKeys.cpp @@ -75,9 +75,8 @@ class TwoStringKeysBenchmark : public HiveConnectorTestBase { auto task = makeTask(plan); - vector_size_t numResultRows = 0; while (auto result = task->next()) { - numResultRows += result->size(); + // no action } LOG(ERROR) << exec::printPlanWithStats(