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.

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.

TD and MySQL modes are not verified by this adapter's test suite.

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.

Verified against

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

Download files

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

Source Distribution

datus_dws-0.1.1.tar.gz (27.5 kB view details)

Uploaded Source

Built Distribution

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

datus_dws-0.1.1-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for datus_dws-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c02046a013953d9caf1fbf2fe37e164e8db699c282c9cc04dfa22855b6252c57
MD5 ed69adcea2785be1a5c9e9d9e3aad8c9
BLAKE2b-256 c23a550d088e5ecca33267fe145a41fe8c208ca64627832755955f984a648a1c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for datus_dws-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dfac316bdadd9e3283b3e14c413708f90fafa81f0faafd2720fbff3a9e455e0a
MD5 4ac47746e8548515a8a7747f59861cad
BLAKE2b-256 afcdaf5976ab1b35808aa29b7ae8769bb923b1b4dc52f834fe8b08ab05b24214

See more details on using hashes here.

Release history Release notifications | RSS feed

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