Skip to content

Commit

Permalink
Use makeArrayVerifier for collect_list
Browse files Browse the repository at this point in the history
  • Loading branch information
liujiayi771 committed Mar 29, 2024
1 parent 1d09263 commit 059061f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion velox/functions/sparksql/fuzzer/SparkAggregationFuzzerTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "velox/exec/fuzzer/AggregationFuzzerOptions.h"
#include "velox/exec/fuzzer/AggregationFuzzerRunner.h"
#include "velox/exec/fuzzer/DuckQueryRunner.h"
#include "velox/exec/fuzzer/TransformResultVerifier.h"
#include "velox/functions/prestosql/registration/RegistrationFunctions.h"
#include "velox/functions/sparksql/aggregates/Register.h"

DEFINE_int64(
Expand All @@ -48,13 +50,20 @@ int main(int argc, char** argv) {
// experience, and initialize glog and gflags.
folly::Init init(&argc, &argv);

facebook::velox::functions::prestosql::registerInternalFunctions();
facebook::velox::memory::MemoryManager::initialize({});

// TODO: List of the functions that at some point crash or fail and need to
// be fixed before we can enable. Constant argument of bloom_filter_agg cause
// fuzzer test fail.
std::unordered_set<std::string> skipFunctions = {"bloom_filter_agg"};

using facebook::velox::exec::test::TransformResultVerifier;

auto makeArrayVerifier = []() {
return TransformResultVerifier::create("\"$internal$canonicalize\"({})");
};

// The results of the following functions depend on the order of input
// rows. For some functions, the result can be transformed to a value that
// doesn't depend on the order of inputs. If such transformation exists, it
Expand All @@ -71,7 +80,8 @@ int main(int argc, char** argv) {
{"max_by", nullptr},
{"min_by", nullptr},
{"skewness", nullptr},
{"kurtosis", nullptr}};
{"kurtosis", nullptr},
{"collect_list", makeArrayVerifier()}};

size_t initialSeed = FLAGS_seed == 0 ? std::time(nullptr) : FLAGS_seed;
auto duckQueryRunner =
Expand Down

0 comments on commit 059061f

Please sign in to comment.