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-fullis not usable. The default server certificate hasCN=serverand carries nosubjectAltName, 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_certbundle contains bothv1/sslcert/cacert.pemandv2/sslcert/cacert.pem. Only v2 matches the server certificate issuer; v1 isCN=Huawei Equipment CAand 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/2is3.5(double precision), not integer3.''is stored as NULL and'' IS NULLis true;col = ''never matches.'a' || NULLis'a'; concatenation absorbs NULL.DATEistimestamp(0)andDATE - DATEyields aninterval.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c02046a013953d9caf1fbf2fe37e164e8db699c282c9cc04dfa22855b6252c57
|
|
| MD5 |
ed69adcea2785be1a5c9e9d9e3aad8c9
|
|
| BLAKE2b-256 |
c23a550d088e5ecca33267fe145a41fe8c208ca64627832755955f984a648a1c
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dfac316bdadd9e3283b3e14c413708f90fafa81f0faafd2720fbff3a9e455e0a
|
|
| MD5 |
4ac47746e8548515a8a7747f59861cad
|
|
| BLAKE2b-256 |
afcdaf5976ab1b35808aa29b7ae8769bb923b1b4dc52f834fe8b08ab05b24214
|