Skip to content
Open
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
1163 commits
Select commit Hold shift + click to select a range
1760677
More bitpacking optimizations
yan-alex Nov 17, 2025
aa2f040
`struct_keys` for StructVector
EtgarDev Nov 5, 2025
a5d4e6b
Tests for `struct_keys`
EtgarDev Nov 6, 2025
a5124a0
Formatting
EtgarDev Nov 6, 2025
42c6bcf
Add error handling tests for non-STRUCT inputs in `struct_keys`
EtgarDev Nov 6, 2025
ee0c997
Remove a redundant input type check for `struct_keys` function
EtgarDev Nov 6, 2025
4ee2cf8
Refactor `struct_keys` to use `StructKeysBindData` for improved perfo…
EtgarDev Nov 7, 2025
2cb1d4d
Remove unused `GetKeys` methods from StructVector
EtgarDev Nov 7, 2025
75bc964
Refactor `struct_keys` to replace `dict_child` with `keys_vector` for…
EtgarDev Nov 7, 2025
b732445
Clean up `struct_keys` by removing redundant assignments and simplify…
EtgarDev Nov 7, 2025
4d0291f
Add test for `struct_keys` with NULL as input
EtgarDev Nov 7, 2025
7744525
Remove redundant `PRAGMA enable_verification` statement from `test_st…
EtgarDev Nov 7, 2025
9c94114
Handle unnamed structs in `struct_keys` by returning NULL, update tes…
EtgarDev Nov 7, 2025
1128a4a
Add test for `struct_keys` with flat vector input and simplify consta…
EtgarDev Nov 10, 2025
14686fd
Update `struct_keys` to reserve list size before processing and expan…
EtgarDev Nov 10, 2025
50740b5
Simplify `struct_keys` constant vector check using `args.AllConstant()`
EtgarDev Nov 10, 2025
9ccfa1b
Update `struct_keys` to pass bind function through constructor
EtgarDev Nov 10, 2025
48c4b49
Disallow `struct_keys` on unnamed structs, update logic to raise an e…
EtgarDev Nov 10, 2025
00abda1
Register `struct_keys` in `extension_entries.hpp`.
EtgarDev Nov 13, 2025
75c6c81
Reorder `struct_update` in `extension_entries.hpp`.
EtgarDev Nov 16, 2025
e7aca50
Introduce `alias_ref('name')` support in SELECT projection
EtgarDev Nov 12, 2025
52eb12e
Expand `alias_ref` error handling tests for invalid and NULL arguments
EtgarDev Nov 12, 2025
b723491
Remove verification pragma from alias_function_errors test
EtgarDev Nov 12, 2025
a08bb02
prettier
EtgarDev Nov 12, 2025
b404f2b
removed redundant comments
EtgarDev Nov 12, 2025
a6a69a8
removed redundant comments
EtgarDev Nov 12, 2025
ad36ed9
Expand `alias_ref` error handling tests for subqueries in SELECT aliases
EtgarDev Nov 12, 2025
ed9ce5f
Refactor `alias_ref` to use `alias.name` syntax in SELECT projection
EtgarDev Nov 13, 2025
101f885
Refactor `alias_ref` tests and binder logic to adopt `alias.name` syntax
EtgarDev Nov 13, 2025
a88caa2
Rename `alias_function` tests to `alias_qualification` for clarity.
EtgarDev Nov 13, 2025
f8e58ca
Expand `alias_qualification` tests to cover various alias usage scena…
EtgarDev Nov 13, 2025
dc6d6e3
Fix conflicts with the edge-case of having a table named "alias"
EtgarDev Nov 13, 2025
f1c2eee
Refactor alias binding to implement unified two-step alias resolution
EtgarDev Nov 16, 2025
0d6d4bf
Add tests for alias resolution in various SQL clauses
EtgarDev Nov 16, 2025
c9f37eb
Simplify comment for legacy alias binding function
EtgarDev Nov 16, 2025
d5a1223
Simplify comment in `OrderBinder::BindExpression` to improve clarity
EtgarDev Nov 16, 2025
eae396a
Remove invalid test cases for `alias.*` usage outside SELECT lists
EtgarDev Nov 16, 2025
a059031
Bringing back older functionality of `bind_columnref_expression` that…
EtgarDev Nov 17, 2025
e20195b
formatter
EtgarDev Nov 17, 2025
eef7db3
Fixed resolving of the AliasReference after mistakenly removing it
EtgarDev Nov 17, 2025
536c7e9
Fixed a test to expect the right amount of columns
EtgarDev Nov 17, 2025
921ae60
Remove the redundent `BindColumnRef` function in `SelectBinder`
EtgarDev Nov 17, 2025
51564f2
Refactor alias binding checks for consistency and simplicity
EtgarDev Nov 17, 2025
cb1382e
Refactor alias binding in `OrderBinder` for clarity and consistency
EtgarDev Nov 17, 2025
50fc91a
Remove redundant `BindColumnRef` override in `SelectBinder`
EtgarDev Nov 17, 2025
bf785e6
Remove test from wal verification
d-justen Nov 17, 2025
327dbd6
nits
maiadegraaf Nov 17, 2025
872f7e9
WRITE_TO_WAL_COMMIT_LATENCY -> COMMIT_LOCAL_STORAGE_LATENCY
maiadegraaf Nov 17, 2025
94431ed
Add missing include for windows
Dtenwolde Nov 17, 2025
415cee6
Rework the way segment tree const-ness works
Mytherin Nov 17, 2025
882764f
Make original_column const in ColumnCheckpointState
Mytherin Nov 17, 2025
56c7c77
Remove unused variable
Mytherin Nov 17, 2025
b297c27
Fix incorrect results with NOT EXISTS and IS DISTINCT FROM operator (…
henry8128 Nov 17, 2025
7445bb3
Add `depth` parameter to alias binding functions to fix errors in ali…
EtgarDev Nov 17, 2025
a4fd89d
Redo row-group agnostic partition stats
d-justen Nov 17, 2025
e9a6881
Remove `QualifyColumnAlias` method and refactor related alias binding…
EtgarDev Nov 17, 2025
4f5d2fb
Change test cases
d-justen Nov 17, 2025
fca1c2f
Remove `depth` parameter from `BindAndQualifyFunction` and update cal…
EtgarDev Nov 17, 2025
45d8cc3
Tidy
d-justen Nov 17, 2025
c373566
Explicit
d-justen Nov 17, 2025
77d4859
add errors to logs + test
maiadegraaf Nov 17, 2025
faf7970
Move DuckDBPartitionRowGroup to row_group.cpp
d-justen Nov 17, 2025
c0716e1
add fixme to places we should log in future
maiadegraaf Nov 17, 2025
7f7b559
generate files again
maiadegraaf Nov 17, 2025
ad6c484
rm header
maiadegraaf Nov 17, 2025
f1aeeed
rm diff
maiadegraaf Nov 17, 2025
8388b08
Add script that shows missing grammar rules
Dtenwolde Nov 17, 2025
739054f
Add the script
Dtenwolde Nov 17, 2025
e44327a
Update script to also include enum and registering
Dtenwolde Nov 17, 2025
adc6a86
Small fixes
Dtenwolde Nov 17, 2025
f8111bc
Add output for generated methods
Dtenwolde Nov 17, 2025
37b8b06
Exclude grammar rules, update output
Dtenwolde Nov 17, 2025
9e7e6a0
Print excluded count
Dtenwolde Nov 17, 2025
6d33395
Add skip found flag
Dtenwolde Nov 17, 2025
df638e7
Remove unnecessary bitwise OR, revert appender changes
yan-alex Nov 17, 2025
0171ae5
add tpcds test, failing currently with an OOM error
Tishj Nov 17, 2025
458ab3f
WIP: make RowGroup const during checkpoint
Mytherin Nov 17, 2025
970d0ad
add try catch around logging in destructor
maiadegraaf Nov 17, 2025
85062bd
Internal #6607: IEJoin Task Locking
hawkfish Nov 18, 2025
599495c
Format fix
Dtenwolde Nov 18, 2025
79df0c1
[Profiling] Split COMMIT_WRITE_WAL_LATENCY into COMMIT_LOCAL_STORAGE_…
pdet Nov 18, 2025
44451da
Fix flawed logic
Dtenwolde Nov 18, 2025
0cf2ae9
Improve formatting
Dtenwolde Nov 18, 2025
0677e92
Move GetData as GetDataInternal, and have GetData as wrapper (#19791)
pdet Nov 18, 2025
af1a8ec
PositionalScan: handle also HAVE_MORE_OUTPUT + empty chunk via iteration
carlopi Nov 18, 2025
87b160a
Revert "Change back default strategy for debug_physical_table_scan_ex…
carlopi Nov 18, 2025
6077eb8
Add some excluded rules
Dtenwolde Nov 18, 2025
f6cf4be
No alternative verify
d-justen Nov 18, 2025
d4f24de
[swift] fix compiler warnings for deprecated @_implementationOnly (#1…
pdet Nov 18, 2025
511613e
Fix nested sleep_ms calls and add tests
krleonid Nov 18, 2025
52a07d0
CLI: Silence auto-complete failures instead of exiting (#19813)
Mytherin Nov 18, 2025
9a59505
add test to exlcusion list, try to guard against c-math macros in hea…
Maxxen Nov 18, 2025
11d1e77
random cleanup
taniabogatsch Nov 18, 2025
5a50408
when iterating through expression children, favor found bound column …
Tishj Nov 18, 2025
6924cc4
WIP: generate a new RowGroupSegmentTree in RowGroupCollection::Checkp…
Mytherin Nov 18, 2025
7a80542
passing (but extreeeemely slow) tpcds test
Tishj Nov 18, 2025
8b7279e
Remove `TryBindRegularAlias` and unify alias binding through `TryReso…
EtgarDev Nov 18, 2025
38294a7
Make WriteToDisk emit a new row group, instead of modifying the exist…
Mytherin Nov 18, 2025
84fb243
- Refactor alias binding by replacing `QualifyColumnAlias` with `Does…
EtgarDev Nov 18, 2025
cf12f3b
Clean up: remove redundant blank lines and adjust indentation in expr…
EtgarDev Nov 18, 2025
d22884e
Remove `DoesColumnAliasExist` from `GroupBinder`
EtgarDev Nov 18, 2025
cefa08d
Add test for method call on alias reference in projection
EtgarDev Nov 18, 2025
871845e
Remove unused `BindResult` and related comment in alias qualification…
EtgarDev Nov 18, 2025
0c97711
Add `root_expression` parameter to `TryResolveAliasReference` to elim…
EtgarDev Nov 18, 2025
23133ac
Remove redundant comment in alias binding logic detailing the two-ste…
EtgarDev Nov 18, 2025
e2c07d2
Move `UnsupportedAggregateMessage` method implementation to reduce "c…
EtgarDev Nov 18, 2025
7f91404
Remove unused `in_root_group_ref` variable from `GroupBinder`
EtgarDev Nov 18, 2025
c635736
Reformat
EtgarDev Nov 18, 2025
1bf0acd
Add include to ipp
Mytherin Nov 18, 2025
5b4e9c2
revert header changes
Maxxen Nov 18, 2025
6f1e079
adjust comments
henry8128 Nov 18, 2025
ce17e09
add 'column_stats' to 'pragma_storage_info', reporting the BaseStatis…
Tishj Nov 18, 2025
4119bba
Replace exception with `false` return in alias binding when alias doe…
EtgarDev Nov 18, 2025
607621f
Update tests to verify proper error handling for invalid alias usage …
EtgarDev Nov 18, 2025
e0ced3f
Update test to reflect changes in alias qualification logic for GROUP…
EtgarDev Nov 18, 2025
0ab45a8
WIP of test that checks variant shredding through stats
Tishj Nov 18, 2025
5c73f6b
Restrict roaring booleans to v1.5.0 or higher. Fail on compile time w…
yan-alex Nov 18, 2025
683f6a5
Use EnumUtil and remove DatePartToString
Dtenwolde Nov 18, 2025
0aa8772
Bump CI
Dtenwolde Nov 18, 2025
04faf9c
The error is actually regarding unknown table but it doesn't matter
EtgarDev Nov 18, 2025
fb15a6f
wip wip wip
Tishj Nov 18, 2025
332ce23
Add TOTAL_MEMORY_ALLOCATED profiling metric
krleonid Nov 18, 2025
c3aa7ee
Update error messages for alias qualification logic in SELECT clause
EtgarDev Nov 18, 2025
39ed267
refactor: streamline boolean bitpacking functions
yan-alex Nov 18, 2025
a760fc8
Fix MetricsType enum count from 64 to 65
krleonid Nov 18, 2025
2da3f49
Merge branch 'main' of github.com:duckdb/duckdb into nested-sleep-ms
krleonid Nov 18, 2025
752455d
Add test with generated data
yan-alex Nov 18, 2025
84b0367
add concurrent test and nits and fixes
taniabogatsch Nov 18, 2025
7a0c7b4
Enable macros in DuckLake
pdet Nov 18, 2025
7b7a720
add additional tests for partial/fully shredded object/array values
Tishj Nov 18, 2025
f8c74b9
Merge branch 'main' into #6429-roaring-booleans
yan-alex Nov 18, 2025
4d3042a
Merge branch 'main' into log-callback-nits
taniabogatsch Nov 18, 2025
941ab07
wip
Tishj Nov 18, 2025
e8aa2c8
finalize test
taniabogatsch Nov 18, 2025
a06c69d
CleanupAppend - keep SegmentTree alive while cleaning up
Mytherin Nov 18, 2025
033c47f
Turn into reference + shared pointer
Mytherin Nov 18, 2025
713d83f
test changes
yan-alex Nov 18, 2025
1a7054e
Rework RowGroupSegmentTree access so that we keep the shared pointer …
Mytherin Nov 18, 2025
49e1f90
Trigger CI/CD
krleonid Nov 19, 2025
a018747
Try to fix tidy on the shared ptr file
Mytherin Nov 19, 2025
46d4369
Random small nits (#19828)
pdet Nov 19, 2025
02009a2
Add test to exclusion list (#19827)
pdet Nov 19, 2025
14c00e7
Create statement for PEG Transformer (#19807)
pdet Nov 19, 2025
2606b63
Add `struct_keys` method to StructVector (#19673)
pdet Nov 19, 2025
ac5a5e4
More includes
Mytherin Nov 19, 2025
4a4fe15
Add partial checkpoint benchmark
Mytherin Nov 19, 2025
2f264f8
Static assert for compress as well
yan-alex Nov 19, 2025
435926e
PR request
pdet Nov 19, 2025
842ca66
Added test for version 1.4
yan-alex Nov 19, 2025
38ab4db
Merge remote-tracking branch 'upstream/main' into #6429-roaring-booleans
yan-alex Nov 19, 2025
f1521fb
Merge branch 'main' into logger_callback
maiadegraaf Nov 19, 2025
b3122b2
Remove Release Assertions OSX
Mytherin Nov 19, 2025
0e54eb5
Remove old code coverage run
Mytherin Nov 19, 2025
680592a
Move "Forcing async Sinks/Sources" to nightly tests
Mytherin Nov 19, 2025
0e4ce53
Main.yml - make all runs depend on linux-debug
Mytherin Nov 19, 2025
2b55da9
woopsie
pdet Nov 19, 2025
fd4da2d
Merge branch 'logger_callback' into log-callback-nits
taniabogatsch Nov 19, 2025
7d7da70
remove fixme, Has No Null will always be true, might need fixing in g…
Tishj Nov 19, 2025
0b5f8ac
- Fix WhereBinder to align with other binders
EtgarDev Nov 19, 2025
1006544
Update comment in test_sleep.test: correct expected timing for nested…
krleonid Nov 19, 2025
90404a9
[Dev] Disallow aggregates used in the TRY expression child (#16285)
pdet Nov 19, 2025
2307f23
Reformat
EtgarDev Nov 19, 2025
f139acf
add extra data and adjustments / more review feedback
taniabogatsch Nov 19, 2025
a9e1eb3
Merge pull request #13 from taniabogatsch/log-callback-nits
maiadegraaf Nov 19, 2025
b6b1d4b
CI Cleanup (#19840)
Mytherin Nov 19, 2025
8559017
Fix positional scan and restore task executor (#19825)
pdet Nov 19, 2025
b558407
Merge branch 'main' into concurrentcheckpoint
Mytherin Nov 19, 2025
2f38e7a
[CLI] fix escaping sequence for ctrl/alt arrow key shortcuts (#19261)
Mytherin Nov 19, 2025
cf62f4b
Remove shared table locks + add concurrent checkpoints while doing lo…
Mytherin Nov 19, 2025
a11d432
Add verification that children nodes don't have total_memory_allocated
krleonid Nov 19, 2025
0d56973
Remove redundant comment from test
krleonid Nov 19, 2025
48508dc
Remove all shared locks
Mytherin Nov 19, 2025
cbc3cc5
optional_ptr
Mytherin Nov 19, 2025
5c62fdc
Remove RowGroupCollection::GetBaseRowId() - instead get it from the s…
Mytherin Nov 19, 2025
90de00c
adjust WKB casting logic slightly
Maxxen Nov 19, 2025
2b67aca
Fix assertions
Mytherin Nov 19, 2025
b55dbe9
Make SegmentNode members private
Mytherin Nov 19, 2025
8a03884
Enable macros in DuckLake (#19836)
Mytherin Nov 19, 2025
e4fd0de
Update sleep_ms test timing expectations from 0.04s to 0.05s
krleonid Nov 19, 2025
aa38ede
Make RowGroup::Checkpoint and ColumnData::Checkpoint generate a new R…
Mytherin Nov 19, 2025
d922854
test
ccfelius Nov 19, 2025
7734cf4
Merge remote-tracking branch 'upstream/main' into variant_shredded_st…
Tishj Nov 19, 2025
b1e76ee
move the 'Initialize(...)' call from the RowGroup::AlterType, into th…
Tishj Nov 19, 2025
9e05822
Merge branch 'main' into sort-strategy
hawkfish Nov 19, 2025
647cf4b
Merge branch 'main' into iejoin-threads
hawkfish Nov 19, 2025
def9474
Rework vacuum to no longer modify the segment tree in-place
Mytherin Nov 20, 2025
956093e
Use original segmentcount during checkpoint
Mytherin Nov 20, 2025
b9aed20
Fix incorrect results with NOT EXISTS and IS DISTINCT FROM operator (…
Mytherin Nov 20, 2025
f17e4aa
#6429 Roaring Booleans (#19785)
Mytherin Nov 20, 2025
2b8a6a3
Correctly load all segments in SegmentTree::GetSegmentCount
Mytherin Nov 20, 2025
1ba1823
remove use of the 'column_stats' column from 'pragma_storage_info'
Tishj Nov 20, 2025
ba3a421
Flush partial blocks before overwriting row group pointer
Mytherin Nov 20, 2025
d6dce8b
`GEOMETRY` Rework: Part 4 - Step 2 - Adjust WKB conversion functions …
Mytherin Nov 20, 2025
2a46513
Internal #6607: IEJoin Task Locking (#19852)
Mytherin Nov 20, 2025
b59251d
Add TOTAL_MEMORY_ALLOCATED profiling metric (#19834)
Mytherin Nov 20, 2025
5f94550
Delete unused block header size (#19855)
Mytherin Nov 20, 2025
78bdd21
implement merging of subsets of struct fields, also fix an issue wher…
Tishj Nov 20, 2025
e6fbbf4
add test
Tishj Nov 20, 2025
dd63728
add tpcds test for struct extract cardinalities
Tishj Nov 20, 2025
6a72039
Add lock to ART::SerializeToWAL
Mytherin Nov 20, 2025
b156aa3
fix a bunch of issues
Tishj Nov 20, 2025
789b0b9
SegmentTree clean-up
Mytherin Nov 20, 2025
95ba540
Merge branch 'main' into concurrentcheckpoint
Mytherin Nov 20, 2025
6a84651
[CAPI] Expose basic custom log storage to CAPI (#19810)
pdet Nov 20, 2025
b25e50e
vector<bool> is evil
Mytherin Nov 20, 2025
57b0c7d
Move to slow tests
Mytherin Nov 20, 2025
3e9d98c
Format
Mytherin Nov 20, 2025
b467630
if an 'initial_db' is set, also replace the paths set by 'load', to t…
Tishj Nov 20, 2025
cec6520
Enable support for mouse clicks in Linenoise - pressing Ctrl+Q allows…
Mytherin Nov 20, 2025
88f74e5
Don't call MoveToCollection anymore in RowGroupCollection::Checkpoint…
Mytherin Nov 20, 2025
778f335
fix compilation error
Tishj Nov 20, 2025
c747ccc
don't use GetSegmentCount, instead just do it inside the loop, might …
Tishj Nov 20, 2025
1f90f7d
Enable reads to run concurrently while another connection is checkpoi…
Mytherin Nov 21, 2025
6bb5529
CLI: Enable support for mouse clicks in Linenoise - pressing Ctrl+Q a…
Mytherin Nov 21, 2025
9e8f590
Merge branch 'main' into row-group-stats-in-optimizer
d-justen Nov 21, 2025
3067ecc
Unflake test
d-justen Nov 18, 2025
da432e2
Unflake Pt. 2
d-justen Nov 18, 2025
afd94d5
Fix rebase issues
d-justen Nov 21, 2025
b5a55f3
account for needed alignment during flushing, when calculating space …
Tishj Nov 21, 2025
39b2baa
fix conversion issues in RoaringBoolean
Tishj Nov 21, 2025
bc1ef4e
Merge remote-tracking branch 'upstream/main' into fix_assertion_failu…
Tishj Nov 21, 2025
70a0fb6
formatting
Tishj Nov 21, 2025
2b6e3e6
I guess we can't assume its aligned when bitpacking..
Tishj Nov 21, 2025
8ee8adf
Internal #6653: WindowExpression Construction
hawkfish Nov 21, 2025
06e29b9
add all variant storage tests to the skipped tests
Tishj Nov 23, 2025
94916fd
formatting
Tishj Nov 23, 2025
1ba9167
rerun CI
Tishj Nov 23, 2025
273abb5
Merge remote-tracking branch 'upstream/main' into write_parquet_varia…
Tishj Nov 23, 2025
29e7d84
rerun CI
Tishj Nov 23, 2025
fefd40b
Fix alias reference in SELECT clause error message
EtgarDev Nov 23, 2025
ec47f5f
Update error message for alias reference in SELECT clause test
EtgarDev Nov 23, 2025
dfbfe2b
fix merge resolution bug
Tishj Nov 23, 2025
06cbd16
skip variant stats tests
Tishj Nov 23, 2025
f94e8ea
one more test to skip
Tishj Nov 23, 2025
7cc8977
[swift] decode boolean primitive type.
kokluch Nov 23, 2025
d710bba
Add alias reference support (`alias.<name>`) (#19747)
Mytherin Nov 24, 2025
d2cbbf3
[Compression] Fix an existing and a new bug in Roaring compression (#…
Mytherin Nov 24, 2025
2ca8f20
PEG Transformer template script (#19812)
Mytherin Nov 24, 2025
f69183b
[Testing][Dev] Extend tests covered by the `storage_compatibility` te…
pdet Nov 24, 2025
b4d6aaf
[swift] decode boolean primitive type (#19890)
pdet Nov 24, 2025
9b445d1
[Parquet] Implement automatic shredding for `VARIANT` columns in COPY…
Mytherin Nov 24, 2025
aa588f8
Offset Pruning for Pagination Queries (#19806)
Mytherin Nov 24, 2025
f8612e2
Internal #6568: SortStrategy Refactoring (#19814)
Mytherin Nov 24, 2025
51b58f0
Refactor hash join filter scan helper (#19802)
Mytherin Nov 24, 2025
142b128
[Optimizer] Fix cardinality estimates getting lost through `struct_ex…
Mytherin Nov 24, 2025
5246f98
[Dev] Fix assertion failure in `AlterType` (#19850)
Mytherin Nov 24, 2025
c699132
Internal #6653: WindowExpression Construction (#19885)
Mytherin Nov 24, 2025
ac45a76
Fix nested sleep_ms calls and add tests (#19837)
Mytherin Nov 24, 2025
272459a
Merge remote-tracking branch 'upstream/main' into variant_shredded_st…
Tishj Nov 24, 2025
ebde0f6
rerun CI
Tishj Nov 24, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

#include "duckdb/common/types/string_type.hpp"
#include "duckdb/common/types/value.hpp"
#include "reader/variant/variant_value.hpp"
#include "duckdb/common/types/variant_value.hpp"
#include "yyjson.hpp"

using namespace duckdb_yyjson;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "reader/variant/variant_value.hpp"
#include "duckdb/common/types/variant_value.hpp"
#include "reader/variant/variant_binary_decoder.hpp"

namespace duckdb {
Expand Down
5 changes: 2 additions & 3 deletions extension/parquet/reader/variant/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
add_library_unity(
duckdb_parquet_reader_variant OBJECT variant_binary_decoder.cpp
variant_value.cpp variant_shredded_conversion.cpp)
add_library_unity(duckdb_parquet_reader_variant OBJECT
variant_binary_decoder.cpp variant_shredded_conversion.cpp)

set(PARQUET_EXTENSION_FILES
${PARQUET_EXTENSION_FILES} $<TARGET_OBJECTS:duckdb_parquet_reader_variant>
Expand Down
360 changes: 26 additions & 334 deletions extension/parquet/writer/variant/convert_variant.cpp

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions src/catalog/catalog_entry/duck_table_entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ DuckTableEntry::DuckTableEntry(Catalog &catalog, SchemaCatalogEntry &schema, Bou
// create the physical storage
vector<ColumnDefinition> column_defs;
for (auto &col_def : columns.Physical()) {
if (TypeVisitor::Contains(col_def.Type(), LogicalTypeId::VARIANT)) {
throw NotImplementedException("A table cannot be created from a VARIANT column yet");
}
column_defs.push_back(col_def.Copy());
}
storage = make_shared_ptr<DataTable>(catalog.GetAttached(), StorageManager::Get(catalog).GetTableIOManager(&info),
Expand Down
28 changes: 25 additions & 3 deletions src/common/enum_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
#include "duckdb/common/types/row/tuple_data_states.hpp"
#include "duckdb/common/types/timestamp.hpp"
#include "duckdb/common/types/variant.hpp"
#include "duckdb/common/types/variant_value.hpp"
#include "duckdb/common/types/vector.hpp"
#include "duckdb/common/types/vector_buffer.hpp"
#include "duckdb/execution/index/art/art.hpp"
Expand Down Expand Up @@ -4318,19 +4319,20 @@ const StringUtil::EnumStringLiteral *GetStatisticsTypeValues() {
{ static_cast<uint32_t>(StatisticsType::STRUCT_STATS), "STRUCT_STATS" },
{ static_cast<uint32_t>(StatisticsType::BASE_STATS), "BASE_STATS" },
{ static_cast<uint32_t>(StatisticsType::ARRAY_STATS), "ARRAY_STATS" },
{ static_cast<uint32_t>(StatisticsType::GEOMETRY_STATS), "GEOMETRY_STATS" }
{ static_cast<uint32_t>(StatisticsType::GEOMETRY_STATS), "GEOMETRY_STATS" },
{ static_cast<uint32_t>(StatisticsType::VARIANT_STATS), "VARIANT_STATS" }
};
return values;
}

template<>
const char* EnumUtil::ToChars<StatisticsType>(StatisticsType value) {
return StringUtil::EnumToString(GetStatisticsTypeValues(), 7, "StatisticsType", static_cast<uint32_t>(value));
return StringUtil::EnumToString(GetStatisticsTypeValues(), 8, "StatisticsType", static_cast<uint32_t>(value));
}

template<>
StatisticsType EnumUtil::FromString<StatisticsType>(const char *value) {
return static_cast<StatisticsType>(StringUtil::StringToEnum(GetStatisticsTypeValues(), 7, "StatisticsType", value));
return static_cast<StatisticsType>(StringUtil::StringToEnum(GetStatisticsTypeValues(), 8, "StatisticsType", value));
}

const StringUtil::EnumStringLiteral *GetStatsInfoValues() {
Expand Down Expand Up @@ -4920,6 +4922,26 @@ VariantLogicalType EnumUtil::FromString<VariantLogicalType>(const char *value) {
return static_cast<VariantLogicalType>(StringUtil::StringToEnum(GetVariantLogicalTypeValues(), 35, "VariantLogicalType", value));
}

const StringUtil::EnumStringLiteral *GetVariantValueTypeValues() {
static constexpr StringUtil::EnumStringLiteral values[] {
{ static_cast<uint32_t>(VariantValueType::PRIMITIVE), "PRIMITIVE" },
{ static_cast<uint32_t>(VariantValueType::OBJECT), "OBJECT" },
{ static_cast<uint32_t>(VariantValueType::ARRAY), "ARRAY" },
{ static_cast<uint32_t>(VariantValueType::MISSING), "MISSING" }
};
return values;
}

template<>
const char* EnumUtil::ToChars<VariantValueType>(VariantValueType value) {
return StringUtil::EnumToString(GetVariantValueTypeValues(), 4, "VariantValueType", static_cast<uint32_t>(value));
}

template<>
VariantValueType EnumUtil::FromString<VariantValueType>(const char *value) {
return static_cast<VariantValueType>(StringUtil::StringToEnum(GetVariantValueTypeValues(), 4, "VariantValueType", value));
}

const StringUtil::EnumStringLiteral *GetVectorAuxiliaryDataTypeValues() {
static constexpr StringUtil::EnumStringLiteral values[] {
{ static_cast<uint32_t>(VectorAuxiliaryDataType::ARROW_AUXILIARY), "ARROW_AUXILIARY" }
Expand Down
1 change: 1 addition & 0 deletions src/common/types/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
add_subdirectory(column)
add_subdirectory(row)
add_subdirectory(variant)

if(${EXIT_TIME_DESTRUCTORS_WARNING})
set(CMAKE_CXX_FLAGS_DEBUG
Expand Down
5 changes: 5 additions & 0 deletions src/common/types/variant/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
add_library_unity(duckdb_common_variant OBJECT variant.cpp variant_value.cpp
variant_value_convert.cpp)
set(ALL_OBJECT_FILES
${ALL_OBJECT_FILES} $<TARGET_OBJECTS:duckdb_common_variant>
PARENT_SCOPE)
76 changes: 76 additions & 0 deletions src/common/types/variant/variant.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#include "duckdb/common/types/variant.hpp"
#include "duckdb/common/types/vector.hpp"

namespace duckdb {

VariantVectorData::VariantVectorData(Vector &variant)
: variant(variant), keys_index_validity(FlatVector::Validity(VariantVector::GetChildrenKeysIndex(variant))),
keys(VariantVector::GetKeys(variant)) {
blob_data = FlatVector::GetData<string_t>(VariantVector::GetData(variant));
type_ids_data = FlatVector::GetData<uint8_t>(VariantVector::GetValuesTypeId(variant));
byte_offset_data = FlatVector::GetData<uint32_t>(VariantVector::GetValuesByteOffset(variant));
keys_index_data = FlatVector::GetData<uint32_t>(VariantVector::GetChildrenKeysIndex(variant));
values_index_data = FlatVector::GetData<uint32_t>(VariantVector::GetChildrenValuesIndex(variant));
values_data = FlatVector::GetData<list_entry_t>(VariantVector::GetValues(variant));
children_data = FlatVector::GetData<list_entry_t>(VariantVector::GetChildren(variant));
keys_data = FlatVector::GetData<list_entry_t>(keys);
}

UnifiedVariantVectorData::UnifiedVariantVectorData(const RecursiveUnifiedVectorFormat &variant)
: variant(variant), keys(UnifiedVariantVector::GetKeys(variant)),
keys_entry(UnifiedVariantVector::GetKeysEntry(variant)), children(UnifiedVariantVector::GetChildren(variant)),
keys_index(UnifiedVariantVector::GetChildrenKeysIndex(variant)),
values_index(UnifiedVariantVector::GetChildrenValuesIndex(variant)),
values(UnifiedVariantVector::GetValues(variant)), type_id(UnifiedVariantVector::GetValuesTypeId(variant)),
byte_offset(UnifiedVariantVector::GetValuesByteOffset(variant)), data(UnifiedVariantVector::GetData(variant)),
keys_index_validity(keys_index.validity) {
blob_data = data.GetData<string_t>();
type_id_data = type_id.GetData<uint8_t>();
byte_offset_data = byte_offset.GetData<uint32_t>();
keys_index_data = keys_index.GetData<uint32_t>();
values_index_data = values_index.GetData<uint32_t>();
values_data = values.GetData<list_entry_t>();
children_data = children.GetData<list_entry_t>();
keys_data = keys.GetData<list_entry_t>();
keys_entry_data = keys_entry.GetData<string_t>();
}

bool UnifiedVariantVectorData::RowIsValid(idx_t row) const {
return variant.unified.validity.RowIsValid(variant.unified.sel->get_index(row));
}
bool UnifiedVariantVectorData::KeysIndexIsValid(idx_t row, idx_t index) const {
auto list_entry = GetChildrenListEntry(row);
return keys_index_validity.RowIsValid(keys_index.sel->get_index(list_entry.offset + index));
}

list_entry_t UnifiedVariantVectorData::GetChildrenListEntry(idx_t row) const {
return children_data[children.sel->get_index(row)];
}
list_entry_t UnifiedVariantVectorData::GetValuesListEntry(idx_t row) const {
return values_data[values.sel->get_index(row)];
}
const string_t &UnifiedVariantVectorData::GetKey(idx_t row, idx_t index) const {
auto list_entry = keys_data[keys.sel->get_index(row)];
return keys_entry_data[keys_entry.sel->get_index(list_entry.offset + index)];
}
uint32_t UnifiedVariantVectorData::GetKeysIndex(idx_t row, idx_t child_index) const {
auto list_entry = GetChildrenListEntry(row);
return keys_index_data[keys_index.sel->get_index(list_entry.offset + child_index)];
}
uint32_t UnifiedVariantVectorData::GetValuesIndex(idx_t row, idx_t child_index) const {
auto list_entry = GetChildrenListEntry(row);
return values_index_data[values_index.sel->get_index(list_entry.offset + child_index)];
}
VariantLogicalType UnifiedVariantVectorData::GetTypeId(idx_t row, idx_t value_index) const {
auto list_entry = values_data[values.sel->get_index(row)];
return static_cast<VariantLogicalType>(type_id_data[type_id.sel->get_index(list_entry.offset + value_index)]);
}
uint32_t UnifiedVariantVectorData::GetByteOffset(idx_t row, idx_t value_index) const {
auto list_entry = values_data[values.sel->get_index(row)];
return byte_offset_data[byte_offset.sel->get_index(list_entry.offset + value_index)];
}
const string_t &UnifiedVariantVectorData::GetData(idx_t row) const {
return blob_data[data.sel->get_index(row)];
}

} // namespace duckdb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#include "reader/variant/variant_value.hpp"
#include "duckdb/common/types/variant_value.hpp"
#include "yyjson.hpp"

#include "duckdb/common/serializer/varint.hpp"
#include "duckdb/common/enum_util.hpp"
#include "duckdb/common/types/time.hpp"
Expand All @@ -14,6 +16,8 @@
#include "duckdb/common/helper.hpp"
#include "duckdb/function/cast/variant/to_variant_fwd.hpp"

using namespace duckdb_yyjson;

namespace duckdb {

void VariantValue::AddChild(const string &key, VariantValue &&val) {
Expand Down
55 changes: 55 additions & 0 deletions src/common/types/variant/variant_value_convert.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#include "duckdb/function/variant/variant_value_convert.hpp"

namespace duckdb {

template <>
Value ValueConverter::VisitInteger<int8_t>(int8_t val) {
return Value::TINYINT(val);
}

template <>
Value ValueConverter::VisitInteger<int16_t>(int16_t val) {
return Value::SMALLINT(val);
}

template <>
Value ValueConverter::VisitInteger<int32_t>(int32_t val) {
return Value::INTEGER(val);
}

template <>
Value ValueConverter::VisitInteger<int64_t>(int64_t val) {
return Value::BIGINT(val);
}

template <>
Value ValueConverter::VisitInteger<hugeint_t>(hugeint_t val) {
return Value::HUGEINT(val);
}

template <>
Value ValueConverter::VisitInteger<uint8_t>(uint8_t val) {
return Value::UTINYINT(val);
}

template <>
Value ValueConverter::VisitInteger<uint16_t>(uint16_t val) {
return Value::USMALLINT(val);
}

template <>
Value ValueConverter::VisitInteger<uint32_t>(uint32_t val) {
return Value::UINTEGER(val);
}

template <>
Value ValueConverter::VisitInteger<uint64_t>(uint64_t val) {
return Value::UBIGINT(val);
}

template <>
Value ValueConverter::VisitInteger<uhugeint_t>(uhugeint_t val) {
return Value::UHUGEINT(val);
}

} // namespace duckdb
1 change: 1 addition & 0 deletions src/function/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ add_subdirectory(pragma)
add_subdirectory(scalar)
add_subdirectory(table)
add_subdirectory(window)
add_subdirectory(variant)

if(GENERATE_EXTENSION_ENTRIES)
add_definitions(-DGENERATE_EXTENSION_ENTRIES)
Expand Down
Loading