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 FE/BE 4.0.7 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
DORIS_FE_JAVA_XMS 1024m Initial FE JVM heap for the Docker test environment
DORIS_FE_JAVA_XMX 2048m Maximum FE JVM heap for the Docker test environment
HIVE_METASTORE_URI thrift://hive-metastore:9083 Hive catalog metastore URI

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.0.tar.gz (25.8 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.0-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for datus_doris-0.1.0.tar.gz
Algorithm Hash digest
SHA256 48bd38f688c88532b21cc54346dce8f9b0ac15d51f25c2414abfd9251633657f
MD5 0f2fe50db3f5fb59d204ba35643a4929
BLAKE2b-256 a6c08ebe27d97c1c8f384467eaf4a3a4998806cc0d8c8da0195fcd165b1105e9

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for datus_doris-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 893fbab17c513eb1087645c3e0ec95255afff22a54d35c37b22154dbc008e574
MD5 22148d4d48f8010f7e378119b97b454f
BLAKE2b-256 1c2d2546223715b3867f45694d5acfe0df6282b414bf94c6f49be5b36d2a1ac5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

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