Skip to content

Commit 6d481a6

Browse files
pratikpugaliameta-codesync[bot]
authored andcommitted
Skip IPADDRESS in containers for expression fuzzer functions that trigger Presto Int128ArrayBlock.compareTo() bug (#16742)
Summary: Pull Request resolved: #16742 Presto's `Int128ArrayBlock.compareTo()` is not implemented and throws `UnsupportedOperationException` when called during hash-based deduplication (via TypedSet/BlockSet) on containers with IPADDRESS elements. This causes the expression fuzzer with Presto SOT to fail on `distinct_from` and `array_union` when IPADDRESS is nested in containers with duplicate elements. Rename `DistinctFromArgTypesGenerator` to `SkipIPAddressArgTypesGenerator` since it now covers multiple functions, and add `array_union` alongside `distinct_from` in both OSS and internal fuzzer tests. See: prestodb/presto#26836 Reviewed By: kgpai Differential Revision: D96264027 fbshipit-source-id: 4f26da4b4d18a0fd20de9794b978e981c3e94398
1 parent e8fd7cf commit 6d481a6

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

velox/expression/fuzzer/ExpressionFuzzerTest.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
#include "velox/expression/fuzzer/ExpressionFuzzer.h"
2424
#include "velox/expression/fuzzer/FuzzerRunner.h"
2525
#include "velox/expression/fuzzer/SpecialFormSignatureGenerator.h"
26-
#include "velox/functions/prestosql/fuzzer/DistinctFromArgTypesGenerator.h"
2726
#include "velox/functions/prestosql/fuzzer/DivideArgTypesGenerator.h"
2827
#include "velox/functions/prestosql/fuzzer/FloorAndRoundArgTypesGenerator.h"
2928
#include "velox/functions/prestosql/fuzzer/ModulusArgTypesGenerator.h"
3029
#include "velox/functions/prestosql/fuzzer/MultiplyArgTypesGenerator.h"
3130
#include "velox/functions/prestosql/fuzzer/PlusMinusArgTypesGenerator.h"
31+
#include "velox/functions/prestosql/fuzzer/SkipIPAddressArgTypesGenerator.h"
3232

3333
#include "velox/functions/prestosql/fuzzer/SortArrayTransformer.h"
3434
#include "velox/functions/prestosql/fuzzer/TruncateArgTypesGenerator.h"
@@ -80,7 +80,11 @@ std::unordered_map<std::string, std::shared_ptr<ArgTypesGenerator>>
8080
{"round", std::make_shared<FloorAndRoundArgTypesGenerator>()},
8181
{"mod", std::make_shared<ModulusArgTypesGenerator>()},
8282
{"truncate", std::make_shared<TruncateArgTypesGenerator>()},
83-
{"distinct_from", std::make_shared<DistinctFromArgTypesGenerator>()}};
83+
// Block IPADDRESS in containers for functions whose hash-based
84+
// deduplication calls compareTo() on Int128ArrayBlock, which is not
85+
// implemented. See: https://github.com/prestodb/presto/issues/26836
86+
{"distinct_from", std::make_shared<SkipIPAddressArgTypesGenerator>()},
87+
{"array_union", std::make_shared<SkipIPAddressArgTypesGenerator>()}};
8488

8589
std::unordered_map<std::string, std::shared_ptr<ExprTransformer>>
8690
exprTransformers = {

velox/functions/prestosql/fuzzer/DistinctFromArgTypesGenerator.h renamed to velox/functions/prestosql/fuzzer/SkipIPAddressArgTypesGenerator.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121

2222
namespace facebook::velox::exec::test {
2323

24-
/// Custom argument type generator for distinct_from function that blocks
25-
/// types containing IPADDRESS in container positions (array elements, map
26-
/// keys, map values) which fail in Presto due to missing compareTo()
27-
/// implementation in Int128ArrayBlock.
24+
/// Blocks types containing IPADDRESS in container positions (array elements,
25+
/// map keys, map values) which fail in Presto due to missing compareTo()
26+
/// implementation in Int128ArrayBlock. Used for functions that perform
27+
/// element-level comparison (e.g., array_union, array_sort, contains).
2828
/// See: https://github.com/prestodb/presto/issues/26836
29-
class DistinctFromArgTypesGenerator : public fuzzer::ArgTypesGenerator {
29+
class SkipIPAddressArgTypesGenerator : public fuzzer::ArgTypesGenerator {
3030
public:
3131
std::vector<TypePtr> generateArgs(
3232
const exec::FunctionSignature& signature,

0 commit comments

Comments
 (0)