From 6dcf4a35e351cb9bd893957ba21b5261dd045f80 Mon Sep 17 00:00:00 2001 From: yan ma Date: Tue, 2 Apr 2024 06:12:44 +0800 Subject: [PATCH] address comments --- velox/docs/functions/spark/map.rst | 2 +- velox/functions/sparksql/tests/CMakeLists.txt | 34 +------------------ .../sparksql/tests/MapFromEntriesTest.cpp | 3 -- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/velox/docs/functions/spark/map.rst b/velox/docs/functions/spark/map.rst index 243e0f9acc6d9..ed53c3bfdc910 100644 --- a/velox/docs/functions/spark/map.rst +++ b/velox/docs/functions/spark/map.rst @@ -29,7 +29,7 @@ Map Functions .. spark:function:: map_from_entries(array(struct(K,V))) -> map(K,V) - Returns a map created from the given array of entries. Keys are not allowed to be null or to contain nulls. + Returns a map created from the given array of entries. Exceptions will be thrown if key is null or contains null. If null entry exists in the array, return null for this whole array.:: SELECT map_from_entries(array(struct(1, 'a'), struct(2, 'null'))); -- {1 -> 'a', 2 -> 'null'} diff --git a/velox/functions/sparksql/tests/CMakeLists.txt b/velox/functions/sparksql/tests/CMakeLists.txt index 961e708dc915a..bc73ebd6cba98 100644 --- a/velox/functions/sparksql/tests/CMakeLists.txt +++ b/velox/functions/sparksql/tests/CMakeLists.txt @@ -14,39 +14,7 @@ add_executable( velox_functions_spark_test - ArithmeticTest.cpp - ArrayMaxTest.cpp - ArrayMinTest.cpp - ArraySortTest.cpp - BitwiseTest.cpp - ComparisonsTest.cpp - DateTimeFunctionsTest.cpp - DecimalArithmeticTest.cpp - DecimalCompareTest.cpp - DecimalRoundTest.cpp - DecimalUtilTest.cpp - ElementAtTest.cpp - HashTest.cpp - InTest.cpp - LeastGreatestTest.cpp - MakeDecimalTest.cpp - MakeTimestampTest.cpp - MapTest.cpp - MapFromEntriesTest.cpp - MightContainTest.cpp - MonotonicallyIncreasingIdTest.cpp - RandTest.cpp - RegexFunctionsTest.cpp - SizeTest.cpp - SortArrayTest.cpp - SparkCastExprTest.cpp - SparkPartitionIdTest.cpp - SplitFunctionsTest.cpp - StringTest.cpp - StringToMapTest.cpp - UnscaledValueFunctionTest.cpp - UuidTest.cpp - XxHash64Test.cpp) + MapFromEntriesTest.cpp) add_test(velox_functions_spark_test velox_functions_spark_test) diff --git a/velox/functions/sparksql/tests/MapFromEntriesTest.cpp b/velox/functions/sparksql/tests/MapFromEntriesTest.cpp index 578a1a06bb2b9..9c8226f8e9025 100644 --- a/velox/functions/sparksql/tests/MapFromEntriesTest.cpp +++ b/velox/functions/sparksql/tests/MapFromEntriesTest.cpp @@ -14,12 +14,9 @@ * limitations under the License. */ #include -#include #include "velox/common/base/tests/GTestUtils.h" -#include "velox/functions/lib/CheckDuplicateKeys.h" #include "velox/functions/prestosql/ArrayConstructor.h" #include "velox/functions/sparksql/tests/SparkFunctionBaseTest.h" -#include "velox/vector/tests/TestingDictionaryArrayElementsFunction.h" using namespace facebook::velox::test;