feat: replace carquet C library with pure Zig zig-parquet - #217
Merged
Conversation
- Remove ~60 C source files (~150K LOC) from lib/carquet/, lib/zstd/, lib/lz4/, lib/zlib/ - Add zig-parquet dependency (main branch, Zig 0.16 compatible) with codecs=zig-only - Rewrite src/parquet.zig using DynamicReader API (openBufferDynamic, readAllRows) - Schema-based type mapping with logical type support (DATE, TIME, TIMESTAMP, DECIMAL) - All compression codecs now pure Zig (zstd, gzip, snappy, lz4, brotli) - Update documentation (codemap.md, src/codemap.md, .gitignore) - All 120+ integration tests pass
- Fix DECIMAL byte-array panic: bind raw bytes as TEXT (matches carquet) - Fix INT96: convert to ISO timestamp (like TIMESTAMP) instead of raw nanos - Hoist schema lookups out of inner loop (O(R×C²) → O(R×C)) - Trim lib/parquet from 166 to 83 files (remove tests/examples/docs/C-API/WASM/C-codecs) - Strip C dep declarations from lib/parquet/build.zig.zon - All 120+ tests pass
… fixture test - src/parquet.zig: physicalToAffinity maps .int96 to TEXT to match ISO timestamp text binding (was INTEGER, causing schema/value mismatch) - lib/parquet/build.zig: remove opt-in c_api/wasm_wasi/wasm_freestanding blocks and wasm-smoke step that referenced deleted src/api surfaces - build.zig: integration test 206g for INT96 legacy timestamps - tests/fixtures/int96.parquet: physical INT96 fixture (no logical type)
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.
Summary
Replace bundled C carquet + compression libs (zstd, lz4, zlib) with pure Zig
zig-parquetlibrary. Remove ~60 C source files (~150K LOC).Changes
Build System
zig_parquetdependency (main branch, Zig 0.16 compatible) withcodecs=zig-onlybuild.zigCore Logic (
src/parquet.zig)openBufferDynamic,readAllRows)readAllRows()Cleanup
lib/zstd/,lib/lz4/,lib/zlib/,lib/carquet/(~60 C files, ~150K LOC).gitignoreto remove carquet/zstd/lz4/zlib patternsDocumentation
codemap.md(root) — replace carquet references with zig-parquetsrc/codemap.md— replace carquet FFI description with zig-parquet DynamicReader APIVerification
zig build— compileszig build test— 120+ integration tests passzig build unit-test— CSV unit tests passWhat Remains (C sources)
lib/sqlite3.c/h— SQLite amalgamation (no pure Zig alternative)lib/yaml/— libyaml subset (pure Zig alternatives exist but not yet migrated)Oracle Reviews
All 3 Oracle review gates passed (Phases 1, 2, 4).