diff --git a/velox/exec/tests/SpillTest.cpp b/velox/exec/tests/SpillTest.cpp index 02a2108c6c97..365f48ff7386 100644 --- a/velox/exec/tests/SpillTest.cpp +++ b/velox/exec/tests/SpillTest.cpp @@ -13,16 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "velox/exec/Spill.h" + #include #include #include + #include "velox/common/base/RuntimeMetrics.h" #include "velox/common/base/tests/GTestUtils.h" #include "velox/common/file/FileSystems.h" #include "velox/exec/OperatorUtils.h" +#include "velox/exec/Spill.h" #include "velox/exec/tests/utils/TempDirectoryPath.h" #include "velox/serializers/PrestoSerializer.h" +#include "velox/type/Timestamp.h" #include "velox/vector/tests/utils/VectorTestBase.h" using namespace facebook::velox; @@ -424,7 +427,9 @@ TEST_P(SpillTest, spillTimestamp) { Timestamp{12, 0}, Timestamp{0, 17'123'456}, Timestamp{1, 17'123'456}, - Timestamp{-1, 17'123'456}}; + Timestamp{-1, 17'123'456}, + Timestamp{Timestamp::kMaxSeconds, Timestamp::kMaxNanos}, + Timestamp{Timestamp::kMinSeconds, 0}}; SpillState state( spillPath, diff --git a/velox/serializers/PrestoSerializer.cpp b/velox/serializers/PrestoSerializer.cpp index a55202aacc96..fc576fef13f9 100644 --- a/velox/serializers/PrestoSerializer.cpp +++ b/velox/serializers/PrestoSerializer.cpp @@ -226,8 +226,9 @@ void readValues( } Timestamp readLosslessTimestamp(ByteStream* source) { - int64_t nanos = source->read(); - return Timestamp::fromNanos(nanos); + int64_t seconds = source->read(); + uint64_t nanos = source->read(); + return Timestamp(seconds, nanos); } void readLosslessTimestampValues( @@ -1014,7 +1015,8 @@ template <> void VectorStream::append(folly::Range values) { if (useLosslessTimestamp_) { for (auto& value : values) { - appendOne(value.toNanos()); + appendOne(value.getSeconds()); + appendOne(value.getNanos()); } } else { for (auto& value : values) {