Repository navigation
Conversation
Document the dev-only SQLite usage and remove the exception once sqlx supports a patched libsqlite3-sys release. Co-authored-by: Copilot App <[email protected]>
…3653) * build(python): build pyiceberg-core wheel with opt-level = 3 * update docs
…pache#3643) * fix(spec): write manifests and manifest lists with the deflate codec They were written without an avro.codec entry (uncompressed). Readers that assume a default for a missing entry refuse them: PyIceberg 0.12 reads it as "gzip" and raises 'Unsupported codec: gzip', so a table with one snapshot from iceberg-rust cannot be scanned from PyIceberg. Deflate is what other writers use for manifests, and it makes them smaller. * fix(avro): centralize deflate writer defaults Use a shared internal factory for Avro container writers and verify codec metadata in existing round-trip tests. Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: Kevin Liu <[email protected]> Co-authored-by: Copilot App <[email protected]>
Bump reqwest to 0.13.5
* Bump to Arrow 60 * fix(arrow): borrow page indexes and cover missing offsets --------- Co-authored-by: Kevin Liu <[email protected]>
…3668) The REST catalog spec recommends a standard User-Agent format whose library token for Rust is iceberg-rust (apache/iceberg#17727), so send iceberg-rust/<version> instead of iceberg-rs/<version>. A header.user-agent property still overrides the default.
* fix(encryption): reject encryption.key-id on pre-v3 tables EncryptionManager::from_table_metadata returned Ok(None) for v1/v2 tables before reading encryption.key-id, so commits to such tables silently wrote plaintext manifest lists and manifests. Return DataInvalid instead, matching iceberg-python. * fix(encryption): reject pre-v3 encryption properties on metadata updates Reject encryption.key-id and encryption.data-key-length when creating a table or setting properties below v3, before anything is persisted. Pre-v3 tables that already carry them still load, so they can be repaired by removing the properties or upgrading to v3, and snapshot production on them fails before any manifest is written. Co-authored-by: Copilot App <[email protected]> * fix(encryption): reject pre-v3 encryption properties only on table creation Match Java, which runs EncryptionUtil.checkCompatibility only when creating new table metadata: check in TableMetadataBuilder::new and leave property updates, loading, and snapshot writes unchanged. Co-authored-by: Copilot App <[email protected]> * refactor(spec): inline pre-v3 encryption property check Only TableMetadataBuilder::new uses it, so check inline like the reserved-property check instead of adding a TableProperties method. Co-authored-by: Copilot App <[email protected]> * refactor(spec): move pre-v3 encryption check into a helper Co-authored-by: Copilot App <[email protected]> * test(spec): cover pre-v3 encryption check at the builder level Test v1, v2, and v3 with each encryption property and both together in TableMetadataBuilder, where the check lives, instead of through the memory catalog. Co-authored-by: Copilot App <[email protected]> * fix(spec): reject pre-v3 encryption properties in set_properties Check in TableMetadataBuilder::set_properties so both table creation and property updates reject encryption.key-id and encryption.data-key-length below v3, as iceberg-python does. Only the properties being set are checked, so existing pre-v3 tables that already carry them can still be loaded and updated. Co-authored-by: Copilot App <[email protected]> * refactor(spec): rename property format-version check helper Co-authored-by: Copilot App <[email protected]> * fix(spec): check property format compatibility on every metadata build Run check_properties_format_compatibility in TableMetadataBuilder::build against the final properties and format version, so every metadata mutation is checked rather than only set_properties. A pre-v3 table that already has encryption properties must remove them or upgrade to v3 in its next commit; loading it is unaffected. Co-authored-by: Copilot App <[email protected]> * refactor(spec): shorten format compatibility helper name Co-authored-by: Copilot App <[email protected]> * fix(spec): reject encryption keys on pre-v3 table metadata v1 and v2 metadata do not serialize encryption-keys, so a key added below v3 was silently dropped on write. Check it in check_format_compatibility so every metadata build rejects it. Co-authored-by: Copilot App <[email protected]> * test(spec): consolidate pre-v3 encryption tests Merge the property and encryption-key tests into one table-driven test, and keep only the unrelated-update and removal cases for pre-v3 tables that already have encryption.key-id. Co-authored-by: Copilot App <[email protected]> * test(spec): tidy pre-v3 encryption tests --------- Co-authored-by: Kevin Liu <[email protected]> Co-authored-by: Copilot App <[email protected]>
fix(arrow): rewrite FixedSizeList file hints to List parquet-rs picks its list reader from the embedded Arrow schema. Iceberg has no fixed-size list type, so coerce FixedSizeList hints to List before name mapping and fallback IDs. The 3-level LIST reader then handles null rows without PromotePlan conversion or pad filtering.
…ing (apache#3438) * fix(arrow): keep struct presence when its requested children are missing When none of a struct's requested children are in a Parquet file and another column is projected, the projection mask selected no leaf under the struct, so it read as NULL on every row. Read one leaf under such a struct for its definition level, like Java's PresenceColumnSelector: inner structs first, then the leaf with the lowest repetition level, then the first. A leaf under a map reads the whole map, and a candidate must pass the projection's type check. Closes apache#3378 * fix(arrow): count list views in the presence walk, group projected field ids * fix(arrow): record no presence leaf under a list view
* feat(arrow): read unshredded variant columns Rebased onto main. * fix(arrow): address review on unshredded variant read - RecordBatchTransformer matches a variant's metadata/value by name, casts binary storage to the table type and sets arrow.parquet.variant on output - projection validates projected variants and tags only projected ones - files without field ids or name mapping reject variant projection - shredded variants fail with FeatureUnsupported linking apache#3606 - tests assert the extension end to end, cover a VARIANT-annotated file, dictionary and LargeBinary storage, name mapping and every malformed shape * fix(arrow): share variant storage check and cover null reads - projection and RecordBatchTransformer validate variant storage with one check, so both report shredded storage as FeatureUnsupported and malformed storage as DataInvalid naming the column and field id - an optional variant metadata field is DataInvalid - tests read null variant rows and a file written before the variant column was added * test(arrow): read a nested variant under a null struct row
…ds columns (apache#3665) * feat(transaction): update the name mapping when UpdateSchemaAction adds columns When a table has schema.name-mapping.default, UpdateSchemaAction now adds entries for added columns to it in the same commit, as Java's MappingUtil.update does: new entries go under the parent's entry, an existing entry in the same struct loses a name an added column takes, and deleted columns keep their entries. A mapping that fails to parse is logged and left unchanged. Co-authored-by: Isaac <[email protected]> * fix(transaction): skip name mapping entries for additions under deleted ancestors An addition whose parent is deleted in the same update is dropped from the new schema, and its ID can be assigned again later. Giving it a name mapping entry would let id-less files resolve that name to an unrelated column. Also look up added names through a map instead of scanning the additions for every alias. Co-authored-by: Isaac <[email protected]> --------- Co-authored-by: Isaac <[email protected]>
* fix: support fast append across partition specs * fix: address multi-spec append review feedback
…gBuilderFactory (apache#3407) The factories in the registry return a Box<dyn BoxedCatalogBuilder>, not a CatalogBuilder, so name the alias after the trait it produces. Suggested in review of apache#3286.
…he#3424) * feat(scan): optionally retain column statistics on FileScanTask Add TableScanBuilder::with_column_stats, mirroring Java's Scan.includeColumnStats. The named columns resolve to field ids at build time with the scan's case sensitivity, and each planned FileScanTask carries a FileScanTaskColumnStats holding the data file's value, null and NaN counts and lower and upper bounds for only those field ids. Retention is opt-in: by default column_stats is None, nothing is copied from the manifest entry, and the field is omitted when a task is serialized, so serialized tasks are unchanged. * fix(scan): serialize column bounds as spec binary values Bounds went through Datum's JSON encoding, which writes non-finite floats as null and rejects many finite float values when reading them back, so a task with such a bound serialized but failed to deserialize. Serialize each bound as its type and the spec's single-value binary encoding, as the DataFile JSON serde already does, so every bound round-trips exactly. * refactor(scan): address review of column statistics retention Retain column_sizes for the requested ids too, matching Java's BaseFile(copy, requestedColumnIds). Share the column-name lookup and its error with column selection, keep the requested names as an Option like column_names so an empty list yields empty statistics, and pass the ids as Arc<[i32]>. Skip work for an empty map when filtering, trim the struct docs, and cover nested field names. * fix(scan): reject column names that cannot have statistics Struct, list and map fields have no statistics of their own, and metadata columns are not stored in data files, so requesting stats for them silently returned empty maps or failed with a misleading "not found" error. Fail build() with an error that says why. Also cover bounds that keep the manifest's type after a type promotion. * fix(scan): promote column stats bounds to the scan schema type A manifest written before a type promotion keeps the narrower type, so one scan could return an int bound for one file and a long bound for another, and Datum cannot order values of different types. Promote bounds to the column's type in the scan schema (int to long, float to double, decimal to a wider precision) and omit a bound that cannot be promoted. Box the retained statistics so tasks of scans that never request them do not grow, and add a doctest for with_column_stats. * refactor(scan): resolve column stats types once and trim tests and docs Resolve each requested column's type when the scan is built, so planning no longer looks the column up in the schema for every bound of every manifest entry. Rebuild the column stats tests on the builder, one behavior per test, and cover list names. Drop private field docs that repeated the getter docs, and state the decimal and date-to-timestamp promotion rules in the struct docs. * docs(scan): drop the date to timestamp claim from the column stats docs A date bound under a timestamp column is stored in 4 bytes, which Datum::try_from_bytes cannot decode as a timestamp, so the manifest read fails before planning sees the bound. The docs described a case that planning never handles.
build(deps): update quinn-udp for RUSTSEC-2026-0538
* fix(arrow): skip data files with a known zero record count * test(arrow): simplify empty-file reader regressions
…#3514) * feat(scan): expose portable reader options for planned tasks * refactor(arrow): separate reader options from scan planning * feat(arrow): include Parquet tuning in shared reader options * refactor(arrow): refine reader options API after review * refactor(arrow): address reader configuration review feedback * fix: preserve scan concurrency defaults for Arrow reads * refactor(arrow): clarify options API and focus reader tests * test(arrow): migrate upstream scheduling tests to reader options * refactor(arrow): retain reader options and address review feedback * fix(arrow): serialize Parquet preload settings * fix(arrow): expose preload settings on Parquet options builder * fix(arrow): expose Parquet preload getters * refactor(arrow): resolve reader concurrency independently of scans * refactor(arrow): keep reader concurrency solely in options * Update crates/iceberg/src/arrow/reader/mod.rs Co-authored-by: blackmwk <[email protected]> * docs(arrow): clarify reader options migration and preload behavior --------- Co-authored-by: blackmwk <[email protected]>
…e previous file (apache#3695) * fix(spec): validate the metadata log in build() with the entry for the previous file * test(spec): metadata change after a branch snapshot within the clock-skew tolerance builds
* feat: add TableMetadataBuilder::build_replacement Backs `REPLACE TABLE`: swaps the schema, partition spec and sort order while keeping the table's uuid, properties and snapshots, and drops the main branch so the replaced table has no current snapshot. Columns the table already has keep their field ids, so data files written before the replacement stay readable through the shared columns. New columns draw ids above `last_column_id`, never reusing a dropped column's id. Partition field ids are likewise reused across historical specs. Extracts `rebind_to_schema` out of `reassign_ids` so the partition spec and sort order can be rebound to a schema whose ids were assigned either from scratch or by `assign_fresh_ids`. Format version 1 is not supported. * fix docs * tighten up tests * nits * test: cover build_replacement error paths and refs, document id matching * refactor: take a typed format_version in build_replacement * refactor: make build_replacement pub(crate) until RTAS uses it Moves the doc example into a unit test, since a doctest cannot call a pub(crate) function. * fix: return an error when build_replacement runs out of partition ids Reuses equivalent ids through reuse_partition_field_ids and assigns the rest with PartitionSpecBuilder, which errors on overflow instead of wrapping. The AddSpec change still carries every field id.
…rted load (apache#3697) * fix(arrow): wake equality-delete waiters with the notifier of the started load Co-authored-by: JeonDaehong <[email protected]> * Assert that insert_equality_delete gets the notifier of the started load --------- Co-authored-by: JeonDaehong <[email protected]>
…e predicate (apache#3507) * fix(reader): keep pages whose index bounds cannot be compared with the predicate Page-index bounds are built with the table field type but the file's physical literal. When the two differ, e.g. a long field read against INT32 pages written before an int -> long promotion, a double field against FLOAT pages, or a UINT_32 column mapped to long, the bounds never compare with the predicate literal. Inequality and IN predicates treated that as "cannot match" and skipped pages holding matching rows. Keep a page whenever its bound cannot be compared with the literal: the inequality check now treats an incomparable bound as a possible match, and IN uses all(lt) / all(gt) instead of !any(ge) / !any(le). * test(reader): cover a mixed UINT_32 page in the page-index evaluator A page holding both 100 and 3_000_000_000 has a raw signed max below its min, which pins the unsigned column order that a later bound widening has to zero-extend rather than sign-extend. * test(reader): cover <= and > on INT32 pages of a promoted long field * test(reader): cover all four inequality operators on promoted float and timestamp pages * test(reader): pass RowGroupPageIndex to the page-index evaluator in the promoted-type tests Arrow 60 (apache#3257) changed PageIndexEvaluator::eval to take a RowGroupPageIndex and removed ParquetMetaData::column_index, so the tests added here no longer built after merging main.
Defer Moka cache construction until the first manifest or manifest-list read, and skip it entirely when caching is disabled. Share lazy cache state across clones and retain existing cache policy and encryption. Adapted from DataDog#34 for upstream main, without the fork-specific FileIO rebinding helper. Co-authored-by: Geoffrey Claude <[email protected]>
* fix(spec): keep refs in format-version 1 table metadata * test(spec): cover invalid v1 refs and expiry of v1 refs * docs: drop the CHANGELOG line for v1 refs Keeping refs fixes a bug, so it is not a breaking change.
* feat(reader): resolve unknown delete-file sizes lazily Execution engines that build scan tasks themselves do not always carry a delete file's size. Tasks planned from manifest entries keep the recorded size; externally constructed tasks may now leave FileScanTaskDeleteFile's file size unset, and the Parquet delete-file loader resolves it with one metadata request when the file is first loaded. The caching loader loads each delete file once per reader, so the request is made once per delete file even when several data files reference it. FileScanTaskDeleteFile::file_size_in_bytes now returns Option<u64>. None means unknown, so a size of 0 is no longer a sentinel and is rejected like any other size below the Parquet footer minimum. A failed metadata request is reported with the delete-file path while keeping the storage error's kind and retryability. A size below the Parquet footer minimum, whether resolved or supplied by the task, fails the read rather than dropping the file's deletes. Deletion vectors do not use this size and are unchanged. Co-authored-by: unikdahal <[email protected]> * fix(reader): rely on Parquet's footer check for delete-file sizes Parquet already rejects a size below its footer, so drop the separate 8-byte check and assert Parquet's error in the test instead. Also document leaving the size unset when the recorded one can't be trusted (apache/iceberg#12554), add a serde round trip for a delete file without a size, and tidy the metadata-counting test storage. * test(reader): drop delete-size tests covered elsewhere Keep only the footer cases in the delete_file_loader test; the missing file and lazy read are covered by test_load_deletes_reports_unknown_size_failures and test_read_encrypted_positional_delete_file. Remove the equality-delete parse test, which test_unknown_size_equality_deletes_are_resolved_once_and_cached already covers through load_deletes. * test(reader): resolve unknown delete sizes once under concurrent loads * test(reader): yield in the counting storage so concurrent loads overlap * fix(scan): keep the delete file size required in the builder * test(reader): drop qualifications the merge made unnecessary --------- Co-authored-by: unikdahal <[email protected]>
fix: skip manifests with no live entries Avoid opening manifests whose list counts prove there are no added or existing files. Cover normal and copy-on-write planning with a removed dead-only manifest.
…#3453) * fix(arrow): load equality deletes on fields nested in structs Equality ids may name a field nested in a struct, which the spec allows and EqualityDeleteWriter writes. Loading such a delete file failed because schema evolution only maps top-level field ids, so the delete file is now read by the top-level fields that hold the equality ids. The delete predicate also used the leaf name (`f`), which binds to a top-level column of the same name or fails; it now uses the full name (`s.f`). * fix(arrow): read equality deletes through the schema pruned to their fields Equality ids missing from the scan schema now fail instead of being dropped. The delete file is read as the scan schema pruned to the equality fields, like Java's DeleteFilter, and a nested field that EqualityDeleteWriter wrote as a top-level column is put back under its parent struct first, so both layouts load. * fix(arrow): check equality ids before claiming the delete file load * fix(arrow): read a field under a null struct in an equality delete as null * test(arrow): cover nested equality deletes under a shared, a two-level and a required parent The parent struct put back over a flat nested column now takes its nullability from the schema.
…hReaders (apache#3652) * feat(python): read manifests and manifest lists as pyarrow RecordBatchReaders * docs(python): document raised errors and input release for the Arrow readers * Address review feedback on the Arrow manifest readers - Drop the unused manifest_length, partition_spec_id, and min_sequence_number arguments from read_manifest_entries_as_arrow. - Share decoding, projection, and stop-after-error between the two readers through a private ProjectingReader. - Restore the original schema wording in the reader docs. - Check for multiple batches instead of the batch size constant in the Python test. Co-authored-by: Copilot App <[email protected]> * Remove the empty partition workaround now that arrow-avro decodes empty records arrow-avro 60 decodes records with no fields (apache/arrow-rs#10771), so the entry reader no longer projects out the empty partition of unpartitioned manifests. It now reads the header from its own reader instead of a separate borrowing one. Co-authored-by: Copilot App <[email protected]> * Document that the Arrow manifest readers take decrypted bytes * Rename the Arrow manifest bindings to *_as_arrow_reader Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: Kevin Liu <[email protected]> Co-authored-by: Copilot App <[email protected]>
* perf(scan): parse manifests concurrently TableScan::plan_files loads manifests from one task spawned on the io runtime, and ManifestReader::read parsed each manifest on that task, so the Avro decoding of every manifest in a snapshot ran one after another while the other workers idled. Planning a 601-manifest table spent about 80% of its time in Manifest::try_from_avro_bytes on a single core. ManifestReader now takes an optional Runtime and runs the parse on its cpu handle, which is what Runtime::cpu is documented for; the fetch stays on the calling io task. The scan passes the table's runtime through ObjectCache::get_manifest, so up to concurrency_limit_manifest_files parses run in parallel. ObjectCache itself stores no runtime, so Table::with_runtime keeps sharing it. Spawning the whole per-manifest future on io() would parallelise but keep CPU work on the io runtime; spawning it on cpu() would run storage IO on a runtime that an engine using iceberg-rust for planning only may build without an IO driver. spawn rather than spawn_blocking keeps the parse within the worker count the embedding engine sized cpu() with, matching how the entry stages in plan_files already spawn their work. A panic or cancellation in a parse surfaces as ErrorKind::Unexpected through JoinHandle, and try_for_each_concurrent stops starting new manifests on the first error, so the plan stream ends with that error exactly as it does for a read error. plan_bench medians (4 workers): SF10 23.9 -> 7.0 ms, SF100 232.9 -> 65.4 ms. (cherry picked from commit ce885c9) * refactor(scan): require a runtime on ManifestReader and name the manifest on JoinError ManifestReader took an Option<Runtime>, which left two parse paths: the spawned one the scan uses and an inline one that catalog::utils' delete_data_files and several tests still took, so manifests read while dropping a table were parsed serially. The runtime is now a constructor argument, with_runtime is gone, and delete_data_files builds its reader from the table. The inline-vs-spawned equivalence test goes with the inline path it compared against. A JoinError from the spawned parse (a panic, or a cpu runtime shut down mid-plan) carried only "spawned task failed"; a parse error already names the manifest. The reader now attaches the manifest path as context, so every failure out of ManifestReader::read names the file. ObjectCache wraps the error with the path too, which is why the scan-level cancellation test passed without this; a reader-level test fails without it. The scan-level test also asserts the path now, matching its corrupt and missing siblings. * refactor(scan): bind the parse runtime to ObjectCache instead of passing it per call ObjectCache::get_manifest took a &Runtime on every call, which threaded a runtime through PlanContext, ManifestFileContext and validate_files_not_live only to hand it to the ManifestReader it builds. The cache now owns the runtime it parses on, taken at construction from the TableBuilder, and get_manifest has its original signature again. Table::with_runtime rebinds the cache through ObjectCache::with_runtime, which clones the moka cache: a moka Cache is a handle to shared storage, so the rebound table keeps every entry the original loaded while its misses parse on the new runtime. The with_runtime test now checks both, by building the table on a runtime it then shuts down: a cache that kept the old runtime fails its first miss, and a cache that did not share storage cannot answer for a manifest list whose file has been removed. * docs(scan): note that manifest reads parse on the table's cpu runtime Table::manifest_reader and ManifestReader::read now say the parse runs on the cpu runtime and fails with ErrorKind::Unexpected once that runtime has shut down. The scan-level cancellation test credits ObjectCache's wrapper for the manifest path, and points to the reader-level test that pins the reader's own context.
…nst their identity partition value or initial-default (apache#3302) * fix(arrow): evaluate filters on columns missing from a data file against their identity partition value or initial-default * dedupe some test code. * address PR feedback. negate NOT in residual, test equality deletes on missing columns * address PR feedback
* chore: add a test that recreates the uuid partition error * fix: update to turn UUIDs into Strings for Partitions * chore: add a unit test for RawLiteralEnum::try_from with uuid * chore: move UUID partition test to use datafusion integration tests * feat: restrict UUID partitions to only hyphenated UUIDs * refactor: move from serde solution to avro solution * feat: add logicalType uuid to the uuid transported by avro * revert: undo adding rest_catalog to integration tests * chore: update to use Avro 0.22 changes * revert: go back to using serde_json::Value * docs: add a comment on hyphenated needing to match java * chore: add a test going through ManifestWriter::write_manifest_file * chore: improve the error message on hyphenated UUID * chore: change unreachable path to an error * chore: add Avro UUID roundtrip test * docs: clarified some of the comment behaviour better * chore: add datum roundtrip test * chore: add Datum avro uuid round trip test * refactor: change from RawLiteralEnum::Uuid to RawLiteralEnum::Fixed * chore: add avro uuid to datum test * refactor: remove Result return type from avro_uuid_schema() * refactor: rename datum tests to clarify 16 bytes * refactor: change round trip tests to use manifest reader / writer * chore: add a test to confirm uuid turns into avro fixed 16 * chore: add json tests * chore: add a comment to clarify the serialisation behaviour * refactor: simplify the serde value Primitive UUID to Literal UUID branches * refactor: update manifest tests to match branch building * chore: update explanation of the use of avro's fixed serialize * refactor: merge the manifest writer tests into a single test with multiple cases * chore: update tests to new ManifestReader api
# Conflicts: # crates/iceberg/src/transaction/snapshot/mod.rs # crates/iceberg/src/transaction/snapshot/simple.rs
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main moved on with the per-spec fast append, so this branch conflicts in simple.rs and mod.rs. This merges main and keeps its per-spec manifests and validation, nothing else. Happy to adjust or drop it if you'd rather resolve it yourself.