Skip to content

Commit

Permalink
refactor: Extract the definition of Vector::Options::TimestampPrecisi…
Browse files Browse the repository at this point in the history
…on to Utils.h (#11722)

Summary: Pull Request resolved: #11722

Reviewed By: kevinwilfong

Differential Revision: D65576378
  • Loading branch information
kagamiori authored and facebook-github-bot committed Dec 3, 2024
1 parent a0bbea2 commit 83972d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 7 additions & 0 deletions velox/vector/fuzzer/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ namespace facebook::velox {

using FuzzerGenerator = std::mt19937;

enum class FuzzerTimestampPrecision : int8_t {
kNanoSeconds = 0,
kMicroSeconds = 1,
kMilliSeconds = 2,
kSeconds = 3,
};

namespace generator_spec_utils {

bool coinToss(FuzzerGenerator& rng, double threshold);
Expand Down
9 changes: 2 additions & 7 deletions velox/vector/fuzzer/VectorFuzzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
#pragma once

#include <boost/random/uniform_01.hpp>
#include <random>

#include "velox/type/Type.h"
#include "velox/vector/BaseVector.h"
#include "velox/vector/ComplexVector.h"
#include "velox/vector/fuzzer/GeneratorSpec.h"
#include "velox/vector/fuzzer/Utils.h"

namespace facebook::velox {

Expand Down Expand Up @@ -140,12 +140,7 @@ class VectorFuzzer {

/// Control the precision of timestamps generated. By default generate using
/// nanoseconds precision.
enum class TimestampPrecision : int8_t {
kNanoSeconds = 0,
kMicroSeconds = 1,
kMilliSeconds = 2,
kSeconds = 3,
};
using TimestampPrecision = FuzzerTimestampPrecision;
TimestampPrecision timestampPrecision{TimestampPrecision::kNanoSeconds};

/// If true, fuzz() will randomly generate lazy vectors and fuzzInputRow()
Expand Down

0 comments on commit 83972d7

Please sign in to comment.