From f67f8611b1fcb25ede7d2c10647b7e01a0b563f8 Mon Sep 17 00:00:00 2001 From: Wei He Date: Tue, 17 Dec 2024 10:02:33 -0800 Subject: [PATCH] fix: Fix CopyPreserveEncodingsTest.lazyNoNulls (#11887) Summary: https://github.com/facebookincubator/velox/pull/11855 updated LazyVector:: copyPreserveEncodings() but didn't update the unit test. This diff fixes the failing test. Reviewed By: Yuhta Differential Revision: D67318403 --- velox/vector/tests/CopyPreserveEncodingsTest.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/velox/vector/tests/CopyPreserveEncodingsTest.cpp b/velox/vector/tests/CopyPreserveEncodingsTest.cpp index 83e71e76c74a..f6f734946a34 100644 --- a/velox/vector/tests/CopyPreserveEncodingsTest.cpp +++ b/velox/vector/tests/CopyPreserveEncodingsTest.cpp @@ -327,10 +327,12 @@ TEST_F(CopyPreserveEncodingsTest, flatNoNulls) { TEST_F(CopyPreserveEncodingsTest, lazyNoNulls) { auto lazyVector = vectorMaker_.lazyFlatVector( 10, [](vector_size_t row) { return row; }); + VELOX_ASSERT_THROW(lazyVector->copyPreserveEncodings(), ""); - VELOX_ASSERT_THROW( - lazyVector->copyPreserveEncodings(), - "copyPreserveEncodings not defined for LazyVector"); + auto copy = lazyVector->loadedVector()->copyPreserveEncodings(); + assertEqualVectors(lazyVector, copy); + ASSERT_EQ(copy->encoding(), VectorEncoding::Simple::FLAT); + ASSERT_EQ(copy->nulls(), nullptr); } TEST_F(CopyPreserveEncodingsTest, sequenceHasNulls) {