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

Uploaded Python 3

File details

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

File metadata

  • Download URL: datus_dws-0.1.0.tar.gz
  • Upload date:
  • Size: 24.7 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.0.tar.gz
Algorithm Hash digest
SHA256 b061197c32d9d1d18f3a737871d3aac1cde898d69b9bd42172d0ada8491bd31a
MD5 1160f276bf03e513cffcd68d600bfd06
BLAKE2b-256 bfa78f1d7372d1116af60b82ce1f7ffa6839104e021be0214d972c2f9ba39690

See more details on using hashes here.

File details

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

File metadata

  • Download URL: datus_dws-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cf9cfb6fc2f9a62d86b0e8e634e59e2d3158ba824201fcb8861328a7e9c195b
MD5 774b74d74e45127fb1be8cf00629107e
BLAKE2b-256 8c6e28f16373d3586e2f8948feb20332b3d6215a25e88bd8b1583956f38e95d9

See more details on using hashes here.

Release history Release notifications | RSS feed

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