Skip to content

Commit

Permalink
fix: Revert array_has_duplicates unit test due to Linux/Ubuntu test m…
Browse files Browse the repository at this point in the history
…ismatch (facebookincubator#12203)

Summary:
Pull Request resolved: facebookincubator#12203

New unit test for array_has_duplicates fails on Linux but not Ubuntu. Undoing the addition temporarily while we investigate the issue in case it's a result of added Json functionality

Reviewed By: bikramSingh91

Differential Revision: D68845988
  • Loading branch information
peterenescu authored and facebook-github-bot committed Jan 29, 2025
1 parent 052d6ce commit 9b48314
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 41 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ void registerArrayFunctions(const std::string& prefix) {
registerArrayHasDuplicatesFunctions<int64_t>(prefix);
registerArrayHasDuplicatesFunctions<int128_t>(prefix);
registerArrayHasDuplicatesFunctions<Varchar>(prefix);
registerArrayHasDuplicatesFunctions<Json>(prefix);

registerArrayFrequencyFunctions<bool>(prefix);
registerArrayFrequencyFunctions<int8_t>(prefix);
Expand Down
40 changes: 0 additions & 40 deletions velox/functions/prestosql/tests/ArrayHasDuplicatesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include <optional>
#include "velox/functions/prestosql/tests/utils/FunctionBaseTest.h"
#include "velox/functions/prestosql/types/JsonType.h"

using namespace facebook::velox;
using namespace facebook::velox::test;
Expand Down Expand Up @@ -146,42 +145,3 @@ TEST_F(ArrayHasDuplicatesTest, nullFreeStrings) {
auto expected = makeFlatVector<bool>({false, true, false, true});
testExpr(expected, "array_has_duplicates(C0)", {array});
}

TEST_F(ArrayHasDuplicatesTest, json) {
auto result = evaluate(
"array_has_duplicates(C0)",
makeRowVector({makeNullableArrayVector<StringView>(
{{R"({"key":"value"})", R"({"key":"value"})"}}, ARRAY(JSON()))}));
assertEqualVectors(makeFlatVector<bool>(true), result);

result = evaluate(
"array_has_duplicates(C0)",
makeRowVector({makeNullableArrayVector<StringView>(
{{R"({"key":"value"})"},
{R"({"key":"same_value"})",
R"({"key":"another_value"})",
R"({"key":"same_value"})"},
{std::nullopt, std::nullopt},
{R"({"key":"value"})", R"({"key":"another_value"})"},
{R"({"key":"value"})",
R"({"key":"another_value"})",
R"({"another_key":"value"})"},
{R"({"key": "value\with\backslash"})",
R"({"key": "value\with\backslash"})"},
{R"({"key": "value\nwith\nnewline"})",
R"({"key": "value\nwith\nnewline"})"},
{R"({"key": "value with \u00A9 and \u20AC"})",
R"({"key": "value with \u00A9 and \u20AC"})"},
{R"({"key": "!@#$%^&*()_+-={}:<>?,./~`"})",
R"({"key": "!@#$%^&*()_+-={}:<>?,./~`"})"},
{R"({"key":"value"})",
std::nullopt,
R"({"key":"another_value"})",
R"({"another_key":"value"})",
std::nullopt}},
ARRAY(JSON()))}));
assertEqualVectors(
makeFlatVector<bool>(std::vector<bool>{
{false, true, true, false, false, true, true, true, true, true}}),
result);
}

0 comments on commit 9b48314

Please sign in to comment.