Repository navigation
feat(storage,driver,adapters): add streaming Arrow batches, binary COPY, staged upserts, and index lifecycle - #868
Merged
Merged
Conversation
cofin
force-pushed
the
research_databakes_data_flow
branch
from
October 30, 2026 18:58
f8dec2c to
edbf197
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #868 +/- ##
==========================================
- Coverage 80.58% 80.40% -0.18%
==========================================
Files 563 562 -1
Lines 99315 100697 +1382
Branches 19155 19414 +259
==========================================
+ Hits 80030 80970 +940
- Misses 14287 14594 +307
- Partials 4998 5133 +135
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
cofin
marked this pull request as ready for review
October 30, 2026 21:09
cofin
force-pushed
the
research_sybase_adbc_driver
branch
from
October 31, 2026 02:19
3f9c0f7 to
74fc6be
Compare
cofin
force-pushed
the
research_databakes_data_flow
branch
2 times, most recently
from
October 31, 2026 02:31
5063633 to
f1e1a47
Compare
…aults, and schema-pinned jsonl
…out_indexes, and dynamic auth providers
… and post-connect parquet_metadata_cache
…ache coordination
… and adbc callable import
…rage, pgcopy, and telemetry
…ch write args, and batch prep typing
cofin
force-pushed
the
research_databakes_data_flow
branch
from
October 31, 2026 15:32
93db25e to
c93ce8d
Compare
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
Implements the complete
high-performance-data-flowspecification across SQLSpec's Arrow utilities, storage pipeline, driver base classes, database adapters, and cache subsystem:RecordBatchCoercion & Stage-Split Telemetry (t1):coerce_arrow_batches,arrow_batch_to_rows, andingest_telemetry_from_batchesinsqlspec/utils/arrow_helpers.py(directly imported and re-exported with canonical names insqlspec/driver/_storage_helpers.py).StorageTelemetry(sqlspec/storage/pipeline.py) with stage-level metrics (read_duration_s,encode_duration_s,write_duration_s,commit_duration_s,shards_processed,shards_skipped,wal_bytes).COPY (FORMAT BINARY)& StreamingpgvectorFraming (t2):encode_arrow_batch_pg_binary,iter_pgcopy_binary_chunks, anditer_pgcopy_binary_chunks_asyncinsqlspec/utils/arrow_helpers.pywith a zero-Python-loop structured NumPy dtype fast path (releasing the GIL inside NumPy C kernels for fixed-width andpgvectorFixedSizeList<float32>/FixedSizeList<float16>columns) and direct Arrow buffer slicing (memoryview+np.diff(offsets)) for variable-width (utf8,binary,jsonb) columns.COPYacrosspsycopg(sync & async),asyncpg,psqlpy,cockroach_psycopg, andcockroach_asyncpginside each adapter's owncore.pyanddriver.py.t3):read_arrow_batches/read_arrow_batches_asyncandwrite_arrow_batches/write_arrow_batches_asynconSyncStoragePipelineandAsyncStoragePipeline.resolve_parquet_use_dictionaryto automatically disable Parquet dictionary encoding on floating-point list/fixed-size-list vector columns while preserving dictionary encoding on scalar/string columns.iter_streamed_arrow_batchessupportingarrow_schema-pinned streamingjsonl/ndjson(pa.json.ParseOptions(explicit_schema=arrow_schema)),csv(pa.csv.ConvertOptions(column_types=arrow_schema)),parquet, andarrow-ipc, plusObStoreBackendrange-readread_buffer_bytesand_ObstoreSinkbytearraycopy-on-write safety.t4):list_sources/list_sources_asyncglob/prefix discovery andexecute_load_from_storage_sync/execute_load_from_storage_asyncwith database-backedcheckpoint_table/checkpoint_phaseresumability,max_workers, andexecutor="thread" | "process"(multiprocessing.get_context("spawn")+compute_worker_thread_budget/init_spawn_worker_thread_budget).auth_token_providersupport acrossPsycopgSyncConfig,PsycopgAsyncConfig(with async AlloyDB connector parity),AsyncpgConfig,PsqlpyConfig, andAdbcConfig, plusDuckDBSecretConfigvalue_provider/refresh_interval_secondsand native DuckDB GCSbearer_token+ glob pushdown.t5,t6):stage_table,conflict_keys,on_conflict="update" | "nothing",exclude_update_columns,drop_stage_table, andtype_castsacrossload_from_arrow,load_from_storage, andload_from_recordson all 19 database adapters (UNLOGGEDon PostgreSQL/CockroachDB,TEMPon DuckDB/SQLite/MySQL,NOLOGGINGon Oracle,SELECT TOP 0 * INTOon MSSQL,WITH NO DATAon Db2,LIKEon BigQuery, nativeinsert_or_update/insert_or_ignoreon Spanner, andUNLOGGEDarray-to-UDT cast staging on ADBC).t7):driver.without_indexes(table, *, schema=None, concurrent=False)(sync & async context manager) anddrop_indexes/concurrent_indexesonload_from_arrowandload_from_storagebacked bydriver.data_dictionary.get_indexesandget_ddl.t8):detect_container_memory_limit_bytes/resolve_duckdb_memory_limit(Linux cgroup v1/v2 memory clamping),validate_duckdb_temp_directory(/proc/mountstmpfs/ramfsdetection), and post-extensionparquet_metadata_cacheapplication inDuckDBConnectionPool.t9):CachedQuery,QueryCache,StatementCacheHolder, andresolve_statement_cache_sizefromsqlspec/driver/_query_cache.pyintosqlspec/core/cache.pyso L1 per-configQueryCacheinstances and L2 process-globalNamespacedCache/StatementPipelineRegistrycaches are managed together byclear_all_caches(),update_cache_config(),reset_stats_only(), andget_cache_statistics()["query"].