Skip to main content

datus-doris

Apache Doris database adapter for Datus.

Features

  • MySQL-protocol connection and SQL execution
  • Multi-catalog discovery and context switching
  • Catalog-aware table, view, schema, and sample-row metadata
  • Asynchronous materialized-view discovery and DDL retrieval
  • Three-part identifiers: catalog.database.table
  • Doris migration capability, table-layout, and type-mapping guidance
  • List, CSV, Pandas, and Arrow result formats inherited from datus-mysql

Installation

pip install datus-doris

The package installs datus-db-core and datus-mysql as dependencies and registers the doris adapter through the datus.adapters entry-point group.

Configuration

database:
  type: doris
  host: localhost
  port: 9030
  username: root
  password: ""
  catalog: internal
  database: analytics

The built-in catalog is internal. External catalogs, including Hive Metastore catalogs, can be selected through the same connector API.

Python API

from datus_doris import DorisConfig, DorisConnector

config = DorisConfig(
    host="localhost",
    port=9030,
    username="root",
    password="",
    catalog="internal",
    database="analytics",
)

with DorisConnector(config) as connector:
    catalogs = connector.get_catalogs()
    tables = connector.get_tables(database_name="analytics")
    views = connector.get_views(database_name="analytics")
    materialized_views = connector.get_materialized_views_with_ddl(
        database_name="analytics"
    )
    result = connector.execute_query("SELECT 1")

Catalog context can be switched explicitly:

connector.switch_catalog("hive_catalog")
databases = connector.get_databases()
connector.switch_catalog("internal")

Fully qualified identifiers are rendered as Doris three-part names:

connector.full_name(
    catalog_name="internal",
    database_name="analytics",
    table_name="events",
)
# `internal`.`analytics`.`events`

Development and testing

Unit tests do not require a database:

ci/run-unit-tests.sh datus-doris

The repository integration runner starts Apache Doris 4.1.3 (FE and BE in one apache/doris:all-in-one-4.1.3 container) and Hive Metastore 4.0.1, waits for an alive backend and a successful OLAP DDL probe, runs the complete integration suite, and removes the test services afterward:

ci/run-integration-tests.sh doris

To run the package-local workflow manually:

cd datus-doris
docker compose up -d --wait
./scripts/test.sh integration
docker compose down -v

The integration suite covers catalog operations, Hive external catalogs, tables, views, asynchronous materialized views, DDL/DML, sample rows, TPC-H queries, and list/CSV/Pandas/Arrow output.

Environment variables

Variable Default Description
DORIS_HOST localhost FE query host
DORIS_PORT 9030 MySQL protocol port
DORIS_USER root Username
DORIS_PASSWORD empty Password
DORIS_CATALOG internal Initial catalog
DORIS_DATABASE test Test database
HIVE_METASTORE_URI thrift://hive-metastore:9083 Hive catalog metastore URI
DORIS_QUERY_HOST_PORT 9030 Host port mapped to the container query port
DORIS_HTTP_HOST_PORT 8030 Host port mapped to the container FE HTTP port

The apache/doris:all-in-one-4.1.3 image carries its own integration-test FE and BE configuration, so there are no heap or replication knobs to set here. FE_CONFIG_EXTRA and BE_CONFIG_EXTRA are appended to fe.conf / be.conf at startup if a single setting ever needs overriding.

License

Apache License 2.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

datus_doris-0.1.1.tar.gz (53.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

datus_doris-0.1.1-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file datus_doris-0.1.1.tar.gz.

File metadata

  • Download URL: datus_doris-0.1.1.tar.gz
  • Upload date:
  • Size: 53.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for datus_doris-0.1.1.tar.gz
Algorithm Hash digest
SHA256 05408ed56df6b0f5c2b7dd4ccfb078ab166687a2b76529ea0ddfd2491ca627e2
MD5 2d89257f670dbd80dcefc24b8e29834d
BLAKE2b-256 8e30d7c7837ccf5e41b6e879b0d96585243d6d7af6a429f012a9b3b1d8674cab

See more details on using hashes here.

File details

Details for the file datus_doris-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: datus_doris-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.14

File hashes

Hashes for datus_doris-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a6a3fc02a4a3604b91a8677ea18a86c36db4ae437b969996c900d1f03e16e35
MD5 19d59735cf794d69099cde05546a9b8c
BLAKE2b-256 36c2efa63922da12a1d8c296994d260831e9c9d56c97aefb1ffad365463de066

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page