diff --git a/presto-native-execution/presto_cpp/main/operators/LocalPersistentShuffle.cpp b/presto-native-execution/presto_cpp/main/operators/LocalPersistentShuffle.cpp index 4200ff9cd95ea..519722b2c8e22 100644 --- a/presto-native-execution/presto_cpp/main/operators/LocalPersistentShuffle.cpp +++ b/presto-native-execution/presto_cpp/main/operators/LocalPersistentShuffle.cpp @@ -158,7 +158,7 @@ void LocalPersistentShuffle::noMoreData(bool success) { readyToRead->close(); } -bool LocalPersistentShuffle::hasNext(int32_t partition) const { +bool LocalPersistentShuffle::hasNext(int32_t partition) { while (!readyForRead()) { // This sleep is only for testing purposes. // For the test cases in which the shuffle reader tasks run before shuffle diff --git a/presto-native-execution/presto_cpp/main/operators/LocalPersistentShuffle.h b/presto-native-execution/presto_cpp/main/operators/LocalPersistentShuffle.h index f51ae628a5df8..11e93652cc3e6 100644 --- a/presto-native-execution/presto_cpp/main/operators/LocalPersistentShuffle.h +++ b/presto-native-execution/presto_cpp/main/operators/LocalPersistentShuffle.h @@ -60,7 +60,7 @@ class LocalPersistentShuffle : public ShuffleReader, public ShuffleWriter { void noMoreData(bool success) override; - bool hasNext(int32_t partition) const override; + bool hasNext(int32_t partition) override; velox::BufferPtr next(int32_t partition, bool success) override; diff --git a/presto-native-execution/presto_cpp/main/operators/ShuffleInterface.h b/presto-native-execution/presto_cpp/main/operators/ShuffleInterface.h index 30e58def2e651..86dd59f928058 100644 --- a/presto-native-execution/presto_cpp/main/operators/ShuffleInterface.h +++ b/presto-native-execution/presto_cpp/main/operators/ShuffleInterface.h @@ -36,7 +36,7 @@ class ShuffleReader { /// Check by the reader to see if more blocks are available for this /// partition. - virtual bool hasNext(int32_t partition) const = 0; + virtual bool hasNext(int32_t partition) = 0; /// Read the next block of data for this partition. /// @param success set to false to indicate aborted client. diff --git a/presto-native-execution/presto_cpp/main/operators/tests/UnsaferowShuffleTest.cpp b/presto-native-execution/presto_cpp/main/operators/tests/UnsaferowShuffleTest.cpp index ac319bba23223..cf6f39108e645 100644 --- a/presto-native-execution/presto_cpp/main/operators/tests/UnsaferowShuffleTest.cpp +++ b/presto-native-execution/presto_cpp/main/operators/tests/UnsaferowShuffleTest.cpp @@ -115,7 +115,7 @@ class TestShuffle : public ShuffleReader, public ShuffleWriter { } } - bool hasNext(int32_t partition) const { + bool hasNext(int32_t partition) { return !readyPartitions_[partition].empty(); }