Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array fixes + make validity more lazy #9400

Merged
merged 2 commits into from
Oct 21, 2023
Merged

Conversation

Maxxen
Copy link
Member

@Maxxen Maxxen commented Oct 19, 2023

This PR started as an investigation of a failing nightly test related to array child-validity masks in combination with vector_size=2, but ended up bundling a couple of small fixes.

  • Fixes a corner-case where LIST->ARRAY try-casts end up indexing out of bounds.
  • Fixes a couple of non-deterministic array test cases
  • Fixes an issue where the validitymask of ARRAY child vectors are initialized with STANDARD_VECTOR_SIZE size, which is probably not equal to the child vector size since its always allocated as a multiple of the array size.

As a consequence, ValidtyMasks now contain a "target count" property declaring the desired (or actual) capacity of their validity data, which defaults to STANDARD_VECTOR_SIZE but can be set to something else during construction. This target count is then used instead of STANDARD_VECTOR_SIZE when the validity data is actually initialized and allocated, i.e. when.Set(i, true) or .Initialize() is made.

In effect validitymasks are now even lazier, and in theory we could defer initializing them even when Resize():ing. Although I could not get that to work in this PR (skipping the initialization causes a verification failure in some list-related tests) I am planning to look into that and work on a proper refactor of the ValidityMask code in a followup PR.

Closes https://github.com/duckdblabs/duckdb-internal/issues/497

@Mytherin Mytherin merged commit 7a091e5 into duckdb:feature Oct 21, 2023
43 checks passed
@Mytherin
Copy link
Collaborator

Thanks! LGTM

krlmlr added a commit to duckdb/duckdb-r that referenced this pull request Dec 11, 2023
Merge pull request duckdb/duckdb#9164 from Mause/feature/jdbc-uuid-param
Merge pull request duckdb/duckdb#9185 from pdet/adbc_07
Merge pull request duckdb/duckdb#9126 from Maxxen/parquet-kv-metadata
Merge pull request duckdb/duckdb#9123 from lnkuiper/parquet_schema
Merge pull request duckdb/duckdb#9086 from lnkuiper/json_inconsistent_structure
Merge pull request duckdb/duckdb#8977 from Tishj/python_readcsv_multi_v2
Merge pull request duckdb/duckdb#9279 from hawkfish/nsdate-cast
Merge pull request duckdb/duckdb#8851 from taniabogatsch/binary_lambdas
Merge pull request duckdb/duckdb#8983 from Maxxen/types/fixedsizelist
Merge pull request duckdb/duckdb#9318 from Maxxen/fix-unused
Merge pull request duckdb/duckdb#9220 from hawkfish/exclude
Merge pull request duckdb/duckdb#9230 from Maxxen/json-plan-serialization
Merge pull request duckdb/duckdb#9011 from Tmonster/add_create_statement_support_to_fuzzer
Merge pull request duckdb/duckdb#9400 from Maxxen/array-fixes
Merge pull request duckdb/duckdb#8741 from Tishj/python_import_cache_upgrade
Merge fixes
Merge pull request duckdb/duckdb#9395 from taniabogatsch/lambda-performance
Merge pull request duckdb/duckdb#9427 from Tishj/python_table_support_replacement_scan
Merge pull request duckdb/duckdb#9516 from carlopi/fixformat
Merge pull request duckdb/duckdb#9485 from Maxxen/fix-parquet-serialization
Merge pull request duckdb/duckdb#9388 from chrisiou/issue217
Merge pull request duckdb/duckdb#9565 from Maxxen/fix-array-vector-sizes
Merge pull request duckdb/duckdb#9583 from carlopi/feature
Merge pull request duckdb/duckdb#8907 from cryoEncryp/new-list-functions
Merge pull request duckdb/duckdb#8642 from Virgiel/capi-streaming-arrow
Merge pull request duckdb/duckdb#8658 from Tishj/pytype_optional
Merge pull request duckdb/duckdb#9040 from Light-City/feature/set_mg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants