250308 {
250309 vector<TestType> result;
250310
250311
250312 result.emplace_back(LogicalType::BOOLEAN, "bool");
250313 result.emplace_back(LogicalType::TINYINT, "tinyint");
250314 result.emplace_back(LogicalType::SMALLINT, "smallint");
250315 result.emplace_back(LogicalType::INTEGER, "int");
250316 result.emplace_back(LogicalType::BIGINT, "bigint");
250317 result.emplace_back(LogicalType::HUGEINT, "hugeint");
250318 result.emplace_back(LogicalType::UHUGEINT, "uhugeint");
250319 result.emplace_back(LogicalType::UTINYINT, "utinyint");
250320 result.emplace_back(LogicalType::USMALLINT, "usmallint");
250321 result.emplace_back(LogicalType::UINTEGER, "uint");
250322 result.emplace_back(LogicalType::UBIGINT, "ubigint");
250323
250324
250325 if (use_large_bignum) {
250326 string data;
250328 data.resize(total_data_size);
250329
250330
250332
250334 auto max = Value::BIGNUM(data);
250335
250336
250338
250340 auto min = Value::BIGNUM(data);
250341 result.emplace_back(LogicalType::BIGNUM,
"bignum",
min,
max);
250342
250343 } else {
250344 result.emplace_back(LogicalType::BIGNUM, "bignum");
250345 }
250346
250347
250348 result.emplace_back(LogicalType::DATE, "date");
250349 result.emplace_back(LogicalType::TIME, "time");
250350 result.emplace_back(LogicalType::TIMESTAMP, "timestamp");
250351 result.emplace_back(LogicalType::TIMESTAMP_S, "timestamp_s");
250352 result.emplace_back(LogicalType::TIMESTAMP_MS, "timestamp_ms");
250353 result.emplace_back(LogicalType::TIMESTAMP_NS, "timestamp_ns");
250354 result.emplace_back(LogicalType::TIME_TZ, "time_tz");
250355 result.emplace_back(LogicalType::TIMESTAMP_TZ, "timestamp_tz");
250356
250357
250358 result.emplace_back(LogicalType::FLOAT,
"float",
Value::FLOAT(std::numeric_limits<float>::lowest()),
250360 result.emplace_back(LogicalType::DOUBLE,
"double",
Value::DOUBLE(std::numeric_limits<double>::lowest()),
250362 result.emplace_back(LogicalType::DECIMAL(4, 1), "dec_4_1");
250363 result.emplace_back(LogicalType::DECIMAL(9, 4), "dec_9_4");
250364 result.emplace_back(LogicalType::DECIMAL(18, 6), "dec_18_6");
250365 result.emplace_back(LogicalType::DECIMAL(38, 10), "dec38_10");
250366 result.emplace_back(LogicalType::UUID, "uuid");
250367
250368
250369 interval_t min_interval;
250370 min_interval.months = 0;
250371 min_interval.days = 0;
250372 min_interval.micros = 0;
250373
250374 interval_t max_interval;
250375 max_interval.months = 999;
250376 max_interval.days = 999;
250377 max_interval.micros = 999999999;
250378 result.emplace_back(LogicalType::INTERVAL, "interval", Value::INTERVAL(min_interval),
250379 Value::INTERVAL(max_interval));
250380
250381
250382 result.emplace_back(LogicalType::VARCHAR, "varchar", Value("🦆🦆🦆🦆🦆🦆"),
250383 Value(string("goo\x00se", 6)));
250384 result.emplace_back(LogicalType::BLOB,
"blob",
Value::BLOB(
"thisisalongblob\\x00withnullbytes"),
250386 result.emplace_back(LogicalType::BIT,
"bit",
Value::BIT(
"0010001001011100010101011010111"),
Value::BIT(
"10101"));
250387
250388
250389 Vector small_enum(LogicalType::VARCHAR, 2);
250390 auto small_enum_ptr = FlatVector::GetData<string_t>(small_enum);
250393 result.emplace_back(LogicalType::ENUM(small_enum, 2), "small_enum");
250394
250395 Vector medium_enum(LogicalType::VARCHAR, 300);
250396 auto medium_enum_ptr = FlatVector::GetData<string_t>(medium_enum);
250397 for (
idx_t i = 0; i < 300; i++) {
250399 }
250400 result.emplace_back(LogicalType::ENUM(medium_enum, 300), "medium_enum");
250401
250402 if (use_large_enum) {
250403
250404 Vector large_enum(LogicalType::VARCHAR, 70000);
250405 auto large_enum_ptr = FlatVector::GetData<string_t>(large_enum);
250406 for (
idx_t i = 0; i < 70000; i++) {
250408 }
250409 result.emplace_back(LogicalType::ENUM(large_enum, 70000), "large_enum");
250410 } else {
250411 Vector large_enum(LogicalType::VARCHAR, 2);
250412 auto large_enum_ptr = FlatVector::GetData<string_t>(large_enum);
250415 result.emplace_back(LogicalType::ENUM(large_enum, 2), "large_enum");
250416 }
250417
250418
250419 auto int_list_type = LogicalType::LIST(LogicalType::INTEGER);
250420 auto empty_int_list =
Value::LIST(LogicalType::INTEGER, vector<Value>());
250421 auto int_list =
250424 result.emplace_back(int_list_type, "int_array", empty_int_list, int_list);
250425
250426 auto double_list_type = LogicalType::LIST(LogicalType::DOUBLE);
250427 auto empty_double_list =
Value::LIST(LogicalType::DOUBLE, vector<Value>());
250432 result.emplace_back(double_list_type, "double_array", empty_double_list, double_list);
250433
250434 auto date_list_type = LogicalType::LIST(LogicalType::DATE);
250435 auto empty_date_list =
Value::LIST(LogicalType::DATE, vector<Value>());
250437 Value::DATE(date_t::ninfinity()), Value(LogicalType::DATE),
250439 result.emplace_back(date_list_type, "date_array", empty_date_list, date_list);
250440
250441 auto timestamp_list_type = LogicalType::LIST(LogicalType::TIMESTAMP);
250442 auto empty_timestamp_list =
Value::LIST(LogicalType::TIMESTAMP, vector<Value>());
250443 auto timestamp_list =
250445 Value::TIMESTAMP(timestamp_t::ninfinity()), Value(LogicalType::TIMESTAMP),
250447 result.emplace_back(timestamp_list_type, "timestamp_array", empty_timestamp_list, timestamp_list);
250448
250449 auto timestamptz_list_type = LogicalType::LIST(LogicalType::TIMESTAMP_TZ);
250450 auto empty_timestamptz_list =
Value::LIST(LogicalType::TIMESTAMP_TZ, vector<Value>());
250451 auto timestamptz_list =
250454 Value::TIMESTAMPTZ(timestamp_tz_t(timestamp_t::ninfinity())), Value(LogicalType::TIMESTAMP_TZ),
250456 result.emplace_back(timestamptz_list_type, "timestamptz_array", empty_timestamptz_list, timestamptz_list);
250457
250458 auto varchar_list_type = LogicalType::LIST(LogicalType::VARCHAR);
250459 auto empty_varchar_list =
Value::LIST(LogicalType::VARCHAR, vector<Value>());
250460 auto varchar_list =
Value::LIST(LogicalType::VARCHAR, {Value(
"🦆🦆🦆🦆🦆🦆"), Value(
"goose"),
250461 Value(LogicalType::VARCHAR), Value("")});
250462 result.emplace_back(varchar_list_type, "varchar_array", empty_varchar_list, varchar_list);
250463
250464
250465 auto nested_list_type = LogicalType::LIST(int_list_type);
250466 auto empty_nested_list =
Value::LIST(int_list_type, vector<Value>());
250467 auto nested_int_list =
250468 Value::LIST(int_list_type, {empty_int_list, int_list, Value(int_list_type), empty_int_list, int_list});
250469 result.emplace_back(nested_list_type, "nested_int_array", empty_nested_list, nested_int_list);
250470
250471
250472 child_list_t<LogicalType> struct_type_list;
250473 struct_type_list.push_back(make_pair("a", LogicalType::INTEGER));
250474 struct_type_list.push_back(make_pair("b", LogicalType::VARCHAR));
250475 auto struct_type = LogicalType::STRUCT(struct_type_list);
250476
250477 child_list_t<Value> min_struct_list;
250478 min_struct_list.push_back(make_pair("a", Value(LogicalType::INTEGER)));
250479 min_struct_list.push_back(make_pair("b", Value(LogicalType::VARCHAR)));
250480 auto min_struct_val =
Value::STRUCT(std::move(min_struct_list));
250481
250482 child_list_t<Value> max_struct_list;
250484 max_struct_list.push_back(make_pair("b", Value("🦆🦆🦆🦆🦆🦆")));
250485 auto max_struct_val =
Value::STRUCT(std::move(max_struct_list));
250486
250487 result.emplace_back(struct_type, "struct", min_struct_val, max_struct_val);
250488
250489
250490 child_list_t<LogicalType> struct_list_type_list;
250491 struct_list_type_list.push_back(make_pair("a", int_list_type));
250492 struct_list_type_list.push_back(make_pair("b", varchar_list_type));
250493 auto struct_list_type = LogicalType::STRUCT(struct_list_type_list);
250494
250495 child_list_t<Value> min_struct_vl_list;
250496 min_struct_vl_list.push_back(make_pair("a", Value(int_list_type)));
250497 min_struct_vl_list.push_back(make_pair("b", Value(varchar_list_type)));
250498 auto min_struct_val_list =
Value::STRUCT(std::move(min_struct_vl_list));
250499
250500 child_list_t<Value> max_struct_vl_list;
250501 max_struct_vl_list.push_back(make_pair("a", int_list));
250502 max_struct_vl_list.push_back(make_pair("b", varchar_list));
250503 auto max_struct_val_list =
Value::STRUCT(std::move(max_struct_vl_list));
250504
250505 result.emplace_back(struct_list_type, "struct_of_arrays", std::move(min_struct_val_list),
250506 std::move(max_struct_val_list));
250507
250508
250509 auto array_of_structs_type = LogicalType::LIST(struct_type);
250510 auto min_array_of_struct_val =
Value::LIST(struct_type, vector<Value>());
250511 auto max_array_of_struct_val =
Value::LIST(struct_type, {min_struct_val, max_struct_val, Value(struct_type)});
250512 result.emplace_back(array_of_structs_type, "array_of_structs", std::move(min_array_of_struct_val),
250513 std::move(max_array_of_struct_val));
250514
250515
250516 auto map_type = LogicalType::MAP(LogicalType::VARCHAR, LogicalType::VARCHAR);
250517 auto min_map_value =
Value::MAP(ListType::GetChildType(map_type), vector<Value>());
250518
250519 child_list_t<Value> map_struct1;
250520 map_struct1.push_back(make_pair("key", Value("key1")));
250521 map_struct1.push_back(make_pair("value", Value("🦆🦆🦆🦆🦆🦆")));
250522 child_list_t<Value> map_struct2;
250523 map_struct2.push_back(make_pair("key", Value("key2")));
250524 map_struct2.push_back(make_pair("value", Value("goose")));
250525
250526 vector<Value> map_values;
250529
250530 auto max_map_value =
Value::MAP(ListType::GetChildType(map_type), map_values);
250531 result.emplace_back(map_type, "map", std::move(min_map_value), std::move(max_map_value));
250532
250533
250534 child_list_t<LogicalType> members = {{"name", LogicalType::VARCHAR}, {"age", LogicalType::SMALLINT}};
250535 auto union_type = LogicalType::UNION(members);
250538 result.emplace_back(union_type,
"union",
min,
max);
250539
250540
250541 auto fixed_int_array_type = LogicalType::ARRAY(LogicalType::INTEGER, 3);
250542 auto fixed_int_min_array_value = Value::ARRAY(LogicalType::INTEGER, {Value(LogicalType::INTEGER), 2, 3});
250543 auto fixed_int_max_array_value = Value::ARRAY(LogicalType::INTEGER, {4, 5, 6});
250544 result.emplace_back(fixed_int_array_type, "fixed_int_array", fixed_int_min_array_value, fixed_int_max_array_value);
250545
250546
250547 auto fixed_varchar_array_type = LogicalType::ARRAY(LogicalType::VARCHAR, 3);
250548 auto fixed_varchar_min_array_value =
250549 Value::ARRAY(LogicalType::VARCHAR, {Value("a"), Value(LogicalType::VARCHAR), Value("c")});
250550 auto fixed_varchar_max_array_value = Value::ARRAY(LogicalType::VARCHAR, {Value("d"), Value("e"), Value("f")});
250551 result.emplace_back(fixed_varchar_array_type, "fixed_varchar_array", fixed_varchar_min_array_value,
250552 fixed_varchar_max_array_value);
250553
250554
250555 auto fixed_nested_int_array_type = LogicalType::ARRAY(fixed_int_array_type, 3);
250556 auto fixed_nested_int_min_array_value = Value::ARRAY(
250557 fixed_int_array_type, {fixed_int_min_array_value, Value(fixed_int_array_type), fixed_int_min_array_value});
250558 auto fixed_nested_int_max_array_value = Value::ARRAY(
250559 fixed_int_array_type, {fixed_int_max_array_value, fixed_int_min_array_value, fixed_int_max_array_value});
250560 result.emplace_back(fixed_nested_int_array_type, "fixed_nested_int_array", fixed_nested_int_min_array_value,
250561 fixed_nested_int_max_array_value);
250562
250563
250564 auto fixed_nested_varchar_array_type = LogicalType::ARRAY(fixed_varchar_array_type, 3);
250565 auto fixed_nested_varchar_min_array_value =
250566 Value::ARRAY(fixed_varchar_array_type,
250567 {fixed_varchar_min_array_value, Value(fixed_varchar_array_type), fixed_varchar_min_array_value});
250568 auto fixed_nested_varchar_max_array_value =
250569 Value::ARRAY(fixed_varchar_array_type,
250570 {fixed_varchar_max_array_value, fixed_varchar_min_array_value, fixed_varchar_max_array_value});
250571 result.emplace_back(fixed_nested_varchar_array_type, "fixed_nested_varchar_array",
250572 fixed_nested_varchar_min_array_value, fixed_nested_varchar_max_array_value);
250573
250574
250575 auto fixed_struct_array_type = LogicalType::ARRAY(struct_type, 3);
250576 auto fixed_struct_min_array_value = Value::ARRAY(struct_type, {min_struct_val, max_struct_val, min_struct_val});
250577 auto fixed_struct_max_array_value = Value::ARRAY(struct_type, {max_struct_val, min_struct_val, max_struct_val});
250578 result.emplace_back(fixed_struct_array_type, "fixed_struct_array", fixed_struct_min_array_value,
250579 fixed_struct_max_array_value);
250580
250581
250582 auto struct_of_fixed_array_type =
250583 LogicalType::STRUCT({{"a", fixed_int_array_type}, {"b", fixed_varchar_array_type}});
250584 auto struct_of_fixed_array_min_value =
250585 Value::STRUCT({{
"a", fixed_int_min_array_value}, {
"b", fixed_varchar_min_array_value}});
250586 auto struct_of_fixed_array_max_value =
250587 Value::STRUCT({{
"a", fixed_int_max_array_value}, {
"b", fixed_varchar_max_array_value}});
250588 result.emplace_back(struct_of_fixed_array_type, "struct_of_fixed_array", struct_of_fixed_array_min_value,
250589 struct_of_fixed_array_max_value);
250590
250591
250592 auto fixed_array_of_list_of_int_type = LogicalType::ARRAY(int_list_type, 3);
250593 auto fixed_array_of_list_of_int_min_value = Value::ARRAY(int_list_type, {empty_int_list, int_list, empty_int_list});
250594 auto fixed_array_of_list_of_int_max_value = Value::ARRAY(int_list_type, {int_list, empty_int_list, int_list});
250595 result.emplace_back(fixed_array_of_list_of_int_type, "fixed_array_of_int_list",
250596 fixed_array_of_list_of_int_min_value, fixed_array_of_list_of_int_max_value);
250597
250598
250599 auto list_of_fixed_array_of_int_type = LogicalType::LIST(fixed_int_array_type);
250600 auto list_of_fixed_array_of_int_min_value =
Value::LIST(
250601 fixed_int_array_type, {fixed_int_min_array_value, fixed_int_max_array_value, fixed_int_min_array_value});
250602 auto list_of_fixed_array_of_int_max_value =
Value::LIST(
250603 fixed_int_array_type, {fixed_int_max_array_value, fixed_int_min_array_value, fixed_int_max_array_value});
250604 result.emplace_back(list_of_fixed_array_of_int_type, "list_of_fixed_int_array",
250605 list_of_fixed_array_of_int_min_value, list_of_fixed_array_of_int_max_value);
250606
250607 result.emplace_back(LogicalType::TIME_NS, "time_ns");
250608
250609
250610
250611
250612
250613
250614 constexpr auto big_geom_wkt = R"WKT_LITERAL(
250615 GEOMETRYCOLLECTION (
250616 POINT (1 2),
250617 POINT EMPTY,
250618 LINESTRING (0 0, 1 1),
250619 LINESTRING EMPTY,
250620 POLYGON ((0 0, 0 1, 1 1, 1 0, 0 0)),
250621 POLYGON EMPTY,
250622 MULTIPOINT (
static DUCKDB_API void SetHeader(char *blob, uint64_t number_of_bytes, bool is_negative)
Definition duckdb.cpp:112382
static DUCKDB_API constexpr uint32_t MAX_DATA_SIZE
Definition duckdb.cpp:46513
static DUCKDB_API constexpr uint8_t BIGNUM_HEADER_SIZE
Header size of a Bignum is always 3 bytes.
Definition duckdb.cpp:46515
static DUCKDB_API date_t FromString(const string &str, bool strict=false)
Convert a string in the format "YYYY-MM-DD" to a date object.
Definition duckdb.cpp:117521
static DUCKDB_API timestamp_t FromString(const string &str, bool use_offset)
Convert a string in the format "YYYY-MM-DD hh:mm:ss[.f][-+TH[:tm]]" to a timestamp object.
Definition duckdb.cpp:129733
static DUCKDB_API Value UNION(child_list_t< LogicalType > members, uint8_t tag, Value value)
Create a union value from a selected value and a tag from a set of alternatives.
Definition duckdb.cpp:132530
static DUCKDB_API Value INTEGER(int32_t value)
Create an integer Value from a specified value.
Definition duckdb.cpp:132139
static DUCKDB_API Value SMALLINT(int16_t value)
Create a smallint Value from a specified value.
Definition duckdb.cpp:132132
static DUCKDB_API Value BLOB(const_data_ptr_t data, idx_t len)
Create a blob Value from a data pointer and a length: no bytes are interpreted.
Definition duckdb.cpp:132586
static DUCKDB_API Value MAP(const LogicalType &child_type, vector< Value > values)
Create a map value with the given entries.
Definition duckdb.cpp:132466
static DUCKDB_API Value TIMESTAMP(date_t date, dtime_t time)
Create a timestamp Value from a specified date/time combination.
Definition duckdb.cpp:132409
static DUCKDB_API Value DOUBLE(double value)
Create a double Value from a specified value.
Definition duckdb.cpp:132317
static DUCKDB_API Value BIT(const_data_ptr_t data, idx_t len)
Creates a bitstring by casting a specified string to a bitstring.
Definition duckdb.cpp:132655
static DUCKDB_API Value TIMESTAMPTZ(timestamp_tz_t timestamp)
Create a timestamp_tz Value from a specified value.
Definition duckdb.cpp:132402
static DUCKDB_API Value LIST(const LogicalType &child_type, vector< Value > values)
Create a list value with the given entries.
Definition duckdb.cpp:132555
static DUCKDB_API Value STRUCT(child_list_t< Value > values)
Create a struct value with given list of entries.
Definition duckdb.cpp:132434
static DUCKDB_API Value FLOAT(float value)
Create a float Value from a specified value.
Definition duckdb.cpp:132310
static DUCKDB_API Value DATE(date_t date)
Create a date Value from a specified date.
Definition duckdb.cpp:132338
std::string to_string(const T &value)
Definition duckdb.cpp:19425
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
static DUCKDB_API string_t AddStringOrBlob(Vector &vector, const char *data, idx_t len)
Definition duckdb.cpp:137893