Skip to main content

datus-dws

Huawei Cloud GaussDB(DWS) adapter for Datus.

DWS is a shared-nothing MPP analytical warehouse that speaks the PostgreSQL wire protocol. This adapter builds on datus-postgresql: it reuses the psycopg2 transport unchanged and overrides only what DWS does differently — its system schema set, its native table-definition function, and the Oracle-compatibility semantics of ORA mode.

Timeouts

timeout_seconds must be positive and now bounds driver I/O as well as pool checkout where applicable. Long operations may need a larger value. Server execution deadlines and supported overrides are described in the shared timeout policy and real-database validation. A socket/RPC timeout is distinct from an overall operation deadline.

Installation

pip install datus-dws

Configuration

datasources:
  dws_analytics:
    type: dws
    host: example.dws.myhuaweicloud.com
    port: 8000
    database: gaussdb
    schema: public
    username: dbadmin
    password: ${DWS_PASSWORD}
    sslmode: verify-ca
    sslrootcert: /path/to/cacert.pem
    timeout_seconds: 30

host also accepts the console's host:port form, in which case port may be omitted. The cluster's default database is normally gaussdb.

TLS

sslmode Behaviour
prefer (default) Encrypts when the server offers it; upgrades automatically if the cluster enforces SSL
require Encrypts without verifying the server certificate
verify-ca Verifies the server certificate against sslrootcert
verify-full Cannot succeed — see below
disable Fails if the cluster has SSL enforcement switched on

Two things to know about DWS certificates:

  • verify-full is not usable. The default server certificate has CN=server and carries no subjectAltName, so hostname verification can never match a real endpoint. This is a property of the certificate, not a misconfiguration.
  • Use the v2 CA. The console's dws_ssl_cert bundle contains both v1/sslcert/cacert.pem and v2/sslcert/cacert.pem. Only v2 matches the server certificate issuer; v1 is CN=Huawei Equipment CA and fails verification.

sslrootcert accepts either a filesystem path or inline PEM content, so a hosted deployment can pass an uploaded certificate directly.

Compatibility modes

DWS databases run in ORA, TD or MySQL compatibility mode, reported by pg_database.datcompatibility and surfaced through DWSConnector.get_compatibility_mode().

ORA mode — the default for new clusters — changes expression semantics in ways that can silently produce wrong results:

  • 7/2 is 3.5 (double precision), not integer 3.
  • '' is stored as NULL and '' IS NULL is true; col = '' never matches.
  • 'a' || NULL is 'a'; concatenation absorbs NULL.
  • DATE is timestamp(0) and DATE - DATE yields an interval.

The cloud integration suite runs the same contract and TPC-H tests in ORA, TD and MySQL modes.

Table DDL

Table DDL comes from DWS's pg_get_tabledef(), which preserves orientation, compression, DISTRIBUTE BY, partitioning, TABLESPACE and TO GROUP.

TABLESPACE and TO GROUP name objects of the source cluster and will not replay elsewhere. Use DWSConnector.strip_cluster_specific_clauses() to remove them before applying the DDL to a migration target.

Testing

# Unit tests (no cluster required)
python -m pytest tests/unit/ -v

# Integration tests against a live cluster
export DWS_HOST=... DWS_PORT=8000 DWS_DATABASE=gaussdb \
       DWS_USERNAME=dbadmin DWS_PASSWORD=... DWS_SSLROOTCERT=/path/to/cacert.pem
python -m pytest tests/integration/ -v

Integration tests skip automatically when DWS_HOST is unset. They create objects in a run-scoped schema and drop it on teardown.

Initialize persistent TPC-H sample data

The integration suite loads a deterministic five-table TPC-H fixture into its temporary schema. To initialize the same dataset in a schema kept for Agent testing, run from the datus-dws directory:

export DWS_HOST=... DWS_PORT=8000 DWS_DATABASE=gaussdb \
       DWS_USERNAME=dbadmin DWS_PASSWORD=... DWS_SCHEMA=main
python scripts/init_tpch_data.py --drop

The command reuses datus_dws.tpch_data, verifies every row count, and only drops the five tpch_* tables when --drop is explicitly provided.

Verified against

DWS 9.1.0.227, storage-decoupled (compute-group mode), 3 CN + 3 DN, ORA compatibility mode.

Metadata

Release files for datus-dws 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datus-dws 0.1.2
File Size Uploaded Provenance Actions
datus_dws-0.1.2.tar.gz 32.3 kB Without provenance Details for datus_dws-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datus-dws 0.1.2
File Interpreter ABI Platform Actions
datus_dws-0.1.2-py3-none-any.whl Python 3 none any Details for datus_dws-0.1.2-py3-none-any.whl

Total release size: 53.6 kB

Release files / datus_dws-0.1.2.tar.gz

Download URL datus_dws-0.1.2.tar.gz
Size 32.3 kB
Tags Source
SHA-256 checksum
How to use checksums
42367abb0951b0697c5e04f3916fdbb559c565bf192c4f814c1359b7a69de88b
BLAKE2b-256 checksum
How to use checksums
142f1bd810487c2f8659b789a73a12fd5285ee6d438adc1a4119be93437d97b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Release files / datus_dws-0.1.2-py3-none-any.whl

Download URL datus_dws-0.1.2-py3-none-any.whl
Size 21.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ad8255639855b14c04bf42bffdafaf8d95b9a32c8cfece6bd5babfb116c7a26c
BLAKE2b-256 checksum
How to use checksums
cafa383d3799f426d9b197a13f0c2f2e1df5ae74405bdd5b31605678bf12d362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.15

Security for datus-dws 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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