|
|
Value | sample_size |
|
bool | is_percentage |
|
SampleMethod | method |
|
optional_idx | seed = optional_idx::Invalid() |
|
bool | repeatable |
|
|
static constexpr idx_t | MAX_SAMPLE_ROWS = 1000000000 |
◆ SampleOptions()
| duckdb::SampleOptions::SampleOptions |
( |
int64_t | seed_ = -1 | ) |
|
|
explicit |
340243 {
340244 repeatable = false;
340245 if (seed_ >= 0) {
340246 seed =
static_cast<idx_t>(seed_);
340247 }
340248 sample_size = 0;
340249 is_percentage = false;
340250 method = SampleMethod::INVALID;
340251}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
◆ Copy()
| unique_ptr< SampleOptions > duckdb::SampleOptions::Copy |
( |
| ) |
|
340253 {
340254 auto result = make_uniq<SampleOptions>();
340255 result->sample_size = sample_size;
340256 result->is_percentage = is_percentage;
340257 result->method = method;
340258 result->seed = seed;
340259 result->repeatable = repeatable;
340260 return result;
340261}
◆ SetSeed()
| void duckdb::SampleOptions::SetSeed |
( |
idx_t | new_seed | ) |
|
340263 {
340264 seed = new_seed;
340265}
◆ Equals()
| bool duckdb::SampleOptions::Equals |
( |
SampleOptions * | a, |
|
|
SampleOptions * | b ) |
|
static |
340267 {
340268 if (a == b) {
340269 return true;
340270 }
340271 if (!a || !b) {
340272 return false;
340273 }
340274
340275 if (a->seed.IsValid() != b->seed.IsValid()) {
340276 return false;
340277 }
340278
340279 if (!a->seed.IsValid() && !b->seed.IsValid()) {
340280 return true;
340281 }
340282 if (a->sample_size != b->sample_size || a->is_percentage != b->is_percentage || a->method != b->method ||
340283 a->seed.GetIndex() != b->seed.GetIndex()) {
340284 return false;
340285 }
340286 return true;
340287}
◆ Serialize()
| void duckdb::SampleOptions::Serialize |
( |
Serializer & | serializer | ) |
const |
417676 {
417677 serializer.WriteProperty<Value>(100, "sample_size", sample_size);
417678 serializer.WritePropertyWithDefault<bool>(101, "is_percentage", is_percentage);
417679 serializer.WriteProperty<SampleMethod>(102, "method", method);
417680 serializer.WritePropertyWithDefault<
int64_t>(103,
"seed", GetSeed());
417681}
◆ Deserialize()
417683 {
417684 auto sample_size = deserializer.ReadProperty<Value>(100, "sample_size");
417685 auto is_percentage = deserializer.ReadPropertyWithDefault<bool>(101, "is_percentage");
417686 auto method = deserializer.ReadProperty<SampleMethod>(102, "method");
417687 auto seed = deserializer.ReadPropertyWithDefault<
int64_t>(103,
"seed");
417688 auto result = duckdb::unique_ptr<SampleOptions>(new SampleOptions(seed));
417689 result->sample_size = sample_size;
417690 result->is_percentage = is_percentage;
417691 result->method = method;
417692 return result;
417693}
◆ GetSeed()
| int64_t duckdb::SampleOptions::GetSeed |
( |
| ) |
const |
340289 {
340290 if (seed.IsValid()) {
340291 return static_cast<int64_t>(seed.GetIndex());
340292 }
340293 return -1;
340294}
The documentation for this class was generated from the following files: