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.2.tar.gz (54.3 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.2-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: datus_doris-0.1.2.tar.gz
  • Upload date:
  • Size: 54.3 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.2.tar.gz
Algorithm Hash digest
SHA256 bf9678551e259202ad6521c063f0a497ff64c78eb35fdf68d41d5f9335788b01
MD5 4d27718d703584662f618b98abb1390f
BLAKE2b-256 79aae17d98350ce7f478381ceaa82d594582bb3423e54e076c2fb3ad7977ef0c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: datus_doris-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a6f7a355bc2a6dd14b13209d9a42bab130f07fc6803fbe25f583f5d2ddd4e5e2
MD5 8f34e8369c7281d89b50c64f5f20a3d5
BLAKE2b-256 5662a07ff40ada85a10ea7afc702cc8cbfc700f48aa9eb6dc427e310b153222e

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 files

0.1.1

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