Skip to content

feat: Add Apache Doris 4.0 vector database connector - #1

Open
tomz-alt wants to merge 4 commits into
mainfrom
feat/doris-connector
Open

feat: Add Apache Doris 4.0 vector database connector#1
tomz-alt wants to merge 4 commits into
mainfrom
feat/doris-connector

Conversation

@tomz-alt

Copy link
Copy Markdown
Owner

Summary

Adds native support for Apache Doris (and VeloDB Cloud) as a CocoIndex target, enabling vector similarity search and full-text search capabilities.

Features

Vector Index Support

  • HNSW (Hierarchical Navigable Small World) - default algorithm with configurable m and ef_construction parameters
  • IVF (Inverted File) - cluster-based indexing with configurable lists parameter
  • Metrics: L2 distance (Euclidean), Inner product similarity

Full-Text Search

  • Inverted index support for text columns
  • Configurable parser options: unicode, english, chinese
  • MATCH_ANY, MATCH_ALL, MATCH_PHRASE operators

Data Ingestion

  • Stream Load API for high-throughput bulk ingestion
  • Batch processing with configurable batch_size (default: 10,000 rows)
  • Upsert and delete operations for incremental updates

Schema Management

  • Extend mode (default): Safely add missing columns, preserve extra columns
  • Strict mode: Enforce exact schema match, raise errors on drift
  • Automatic table creation with DUPLICATE KEY model (required for vector indexes)

Reliability

  • Retry logic with exponential backoff for transient errors
  • Covers both HTTP (Stream Load) and MySQL protocol (DDL) operations
  • Configurable max_retries, retry_base_delay, retry_max_delay

Query Helpers

  • connect_async() - Async MySQL connection helper with proper cleanup
  • build_vector_search_query() - SQL builder for vector similarity search

Test Coverage

Type Count Status
Unit tests 67 ✅ Pass
Integration tests 60 ✅ Pass

Integration tests verified against VeloDB Cloud.

Documentation

  • Complete target documentation at docs/docs/targets/doris.md
  • Added to targets index page

Example

New examples/text_embedding_doris/ following the same pattern as text_embedding_lancedb:

  • Markdown file ingestion with chunking
  • SentenceTransformer embeddings
  • Vector and full-text index creation
  • Query handler with similarity search

Requirements

  • Apache Doris 4.0+ or VeloDB Cloud (for vector index support)
  • Python packages: aiohttp, aiomysql

Breaking Changes

None - this is a new target connector.

@tomz-alt
tomz-alt force-pushed the feat/doris-connector branch from 15b2894 to be15045 Compare January 12, 2026 07:38
Add native support for Apache Doris (and VeloDB Cloud) as a target with:

- Vector indexes (HNSW, IVF) with L2 distance and inner product metrics
- Full-text search with inverted indexes
- Stream Load for bulk data ingestion
- Schema evolution modes (extend/strict)
- Retry logic with exponential backoff for transient errors
- Query helpers (connect_async, build_vector_search_query)

Test coverage:
- 67 unit tests
- 60 integration tests (verified against VeloDB Cloud)

Documentation and example included.
@tomz-alt
tomz-alt force-pushed the feat/doris-connector branch from be15045 to 4a47bd9 Compare January 13, 2026 00:52
ZhiHanZ and others added 3 commits January 17, 2026 09:54
- Implement JSON fallback for vectors without fixed dimension (like Postgres/Qdrant)
- Add aiohttp to optional dependencies in pyproject.toml
- Make schema_change_timeout and index_build_timeout configurable
- Fix flaky test_remove_index_from_existing_table with retry loop
- Clean up redundant unit tests
- Add timeout config propagation unit test
- Fix type annotation in test_doris_integration.py (rename shadowed variable)
- Add return type annotation to get_doris_config() in example
- Remove unused imports from test_doris_integration.py
tomz-alt pushed a commit that referenced this pull request Feb 11, 2026
feat: boilerplate and lifespan/Env for cocoindex v1
tomz-alt pushed a commit that referenced this pull request Jun 22, 2026
…io#1999)

Resolves the spec's §4.2 observability gap: previously, orphan-delete
failures during a normal update's commit phase (when a parent's
`process()` no longer declared a child it had declared on a prior run)
hit the framework's default `error!` log instead of routing through the
parent's user-installed exception handler chain. Only `App.drop()` (a
Delete-mode root with a raising on_error) propagated descendant
failures; `coco.mount`-mounted parents had no observability.

Symmetric with `ComponentDeleteContext::on_error`:

- `ComponentBuildContext` gains an `on_error: Option<OnError>` field.
- `ComponentProcessingAction::new_build` and
  `new_processor_context_for_build` accept it.
- `Component::mount` stores its `on_error` argument on the child's Build
  context (in addition to passing it to `run_in_background`) — one
  handler, two surfaces.
- `LiveComponentController::update_full` and `run_op`'s `Op::Update`
  branch mirror the same pattern for the live-component dispatch path.
- `App::update` (root), `Component::use_mount` (foreground), and
  `mount_inner_live`'s synthetic parent context pass `None` — the prior
  log+swallow default is preserved where intentional.

`launch_child_component_gc` switches from `delete_action_on_error()` to
the new unified `processing_action_on_error()`, so it cascades the
parent's on_error regardless of mode. `delete_action_on_error()` stays
as the Delete-only accessor used by `Component::delete`'s spawned task
(a Build context's on_error is meant for cascades, not for invoking on
the build's own failure — that flows through `run_in_background`'s
`on_error` argument directly).

Adds `test_orphan_delete_failure_routes_through_parent_handler` in
test_exception_handlers.py: parent mounts child A on update #1, doesn't
mount A on update #2, sink fails during the orphan delete. Verifies
the handler fires exactly once (mount_kind="mount"). Toggling
`launch_child_component_gc` back to `delete_action_on_error()`
confirms the test fails without this change.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

3 participants