diff --git a/.github/workflows/build_pyvelox.yml b/.github/workflows/build_pyvelox.yml index 5a397f431580..2cc709875d2e 100644 --- a/.github/workflows/build_pyvelox.yml +++ b/.github/workflows/build_pyvelox.yml @@ -48,7 +48,7 @@ jobs: strategy: fail-fast: false matrix: - os: [8-core-ubuntu, macos-13, macos-14] + os: [8-core-ubuntu, macos-15-intel, macos-15] steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: @@ -83,6 +83,7 @@ jobs: echo "CMAKE_PREFIX_PATH=$INSTALL_PREFIX" >> $GITHUB_ENV echo "INSTALL_PREFIX=$INSTALL_PREFIX" >> $GITHUB_ENV echo "DYLD_LIBRARY_PATH=$INSTALL_PREFIX/lib:$DYLD_LIBRARY_PATH" >> $GITHUB_ENV + echo "$INSTALL_PREFIX/bin" >> "$GITHUB_PATH" source scripts/setup-macos.sh install_build_prerequisites diff --git a/velox/expression/VectorReaders.h b/velox/expression/VectorReaders.h index eb1e683da580..1411bcd33cc2 100644 --- a/velox/expression/VectorReaders.h +++ b/velox/expression/VectorReaders.h @@ -115,7 +115,7 @@ struct ConstantVectorReader { std::optional value; - explicit ConstantVectorReader(ConstantVector& vector) { + explicit ConstantVectorReader(ConstantVector& vector) { if (!vector.isNullAt(0)) { value = *vector.rawValues(); } @@ -160,7 +160,7 @@ struct FlatVectorReader { const exec_in_t* values; FlatVector* vector; - explicit FlatVectorReader(FlatVector& baseVector) + explicit FlatVectorReader(FlatVector& baseVector) : values(baseVector.rawValues()), vector(&baseVector) {} exec_in_t operator[](vector_size_t offset) const { diff --git a/velox/functions/sparksql/tests/ToJsonTest.cpp b/velox/functions/sparksql/tests/ToJsonTest.cpp index 9ce1959cc201..dbcb54c256bc 100644 --- a/velox/functions/sparksql/tests/ToJsonTest.cpp +++ b/velox/functions/sparksql/tests/ToJsonTest.cpp @@ -14,6 +14,7 @@ * limitations under the License. */ #include "velox/common/base/tests/GTestUtils.h" +#include "velox/common/testutil/OptionalEmpty.h" #include "velox/functions/sparksql/tests/JsonTestUtil.h" using namespace facebook::velox::test; @@ -53,9 +54,9 @@ TEST_F(ToJsonTest, basicStruct) { TEST_F(ToJsonTest, basicArray) { auto input = makeNullableArrayVector( - {{{1}}, - {{2, std::nullopt, 3}}, - {std::vector>{}}, + {std::vector>{1}, + std::vector>{2, std::nullopt, 3}, + common::testutil::optionalEmpty, std::nullopt}); auto expected = makeNullableFlatVector( {R"([1])", R"([2,null,3])", R"([])", std::nullopt}); @@ -65,20 +66,24 @@ TEST_F(ToJsonTest, basicArray) { TEST_F(ToJsonTest, basicMap) { // MAP(VARCHAR, BIGINT) auto input = makeNullableMapVector( - {{{{"a", 1}, {"b", 2}, {"c", 3}}}, + {std::vector>>{ + {"a", 1}, {"b", 2}, {"c", 3}}, std::nullopt, - {std::vector>>{}}, - {{{"a", 1}, {"b", std::nullopt}}}}); + common::testutil::optionalEmpty, + std::vector>>{ + {"a", 1}, {"b", std::nullopt}}}); auto expected = makeNullableFlatVector( {R"({"a":1,"b":2,"c":3})", std::nullopt, R"({})", R"({"a":1,"b":null})"}); testToJson(input, expected); // MAP(BIGINT, VARCHAR) input = makeNullableMapVector( - {{{{1, "a"}, {2, "b"}, {3, "c"}}}, + {std::vector>>{ + {1, "a"}, {2, "b"}, {3, "c"}}, std::nullopt, - {std::vector>>{}}, - {{{1, "a"}, {2, std::nullopt}}}}); + common::testutil::optionalEmpty, + std::vector>>{ + {1, "a"}, {2, std::nullopt}}}); expected = makeNullableFlatVector( {R"({"1":"a","2":"b","3":"c"})", std::nullopt, @@ -284,10 +289,10 @@ TEST_F(ToJsonTest, nestedMap) { auto data1 = makeNullableFlatVector( {0, 18321, -25567, 2932896, std::nullopt}, DateType::get()); auto data2 = makeNullableArrayVector( - {{{"a", "b", std::nullopt}}, - {std::vector>{}}, - {{"d", "e"}}, - {{"f", std::nullopt, "h"}}, + {std::vector>{"a", "b", std::nullopt}, + common::testutil::optionalEmpty, + std::vector>{"d", "e"}, + std::vector>{"f", std::nullopt, "h"}, std::nullopt}); auto data3 = makeNullableFlatVector( {1.0, kNaNDouble, kInfDouble, -kInfDouble, std::nullopt}); diff --git a/velox/vector/tests/FlatMapVectorTest.cpp b/velox/vector/tests/FlatMapVectorTest.cpp index 651834074d3e..bfe88b62da8f 100644 --- a/velox/vector/tests/FlatMapVectorTest.cpp +++ b/velox/vector/tests/FlatMapVectorTest.cpp @@ -17,9 +17,9 @@ #include #include -#include "velox/common/base/VeloxException.h" #include "velox/common/base/tests/GTestUtils.h" #include "velox/common/memory/Memory.h" +#include "velox/common/testutil/OptionalEmpty.h" #include "velox/vector/tests/utils/VectorMaker.h" #include "velox/vector/tests/utils/VectorTestBase.h" @@ -443,17 +443,14 @@ TEST_F(FlatMapVectorTest, sortedKeyIndices) { } TEST_F(FlatMapVectorTest, toString) { - auto vector = maker_.flatMapVectorNullable({ - std::optional{std::vector>>{}}, - std::optional>>>{ - std::nullopt}, - std::optional>>>{ - {{1, {0}}}}, - std::optional>>>{ - {{1, {1}}, {2, {std::nullopt}}}}, - std::optional>>>{ - {{0, {0}}, {1, {1}}, {2, {2}}, {3, {3}}, {4, {4}}, {5, {5}}}}, - }); + auto vector = maker_.flatMapVectorNullable( + {common::testutil::optionalEmpty, + std::nullopt, + std::vector>>{{1, 0}}, + std::vector>>{ + {1, 1}, {2, std::nullopt}}, + std::vector>>{ + {0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}}}); EXPECT_EQ( vector->toString(), "[FLAT_MAP MAP: 5 elements, 1 nulls]");