Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
d19eb93
feat: Prototype Db2 z/OS support
nj1973 Dec 5, 2025
89a69ee
feat: Prototype Db2 z/OS support
nj1973 Dec 17, 2025
36906d7
feat: Prototype Db2 z/OS support
nj1973 Dec 17, 2025
ec75d2e
feat: Prototype Db2 z/OS support
nj1973 Dec 17, 2025
f31ca4c
feat: Prototype Db2 z/OS support
nj1973 Dec 17, 2025
11f44be
feat: Prototype Db2 z/OS support
nj1973 Dec 17, 2025
7712040
feat: Prototype Db2 z/OS support
nj1973 Dec 17, 2025
6783d6f
feat: Prototype Db2 z/OS support
nj1973 Dec 17, 2025
8a1f9f5
feat: Prototype Db2 z/OS support
nj1973 Dec 17, 2025
a77772a
feat: Prototype Db2 z/OS support
nj1973 Dec 18, 2025
7e7f2b1
feat: Prototype Db2 z/OS support
nj1973 Dec 19, 2025
5f690ff
feat: Prototype Db2 z/OS support
nj1973 Dec 19, 2025
ee25457
feat: Prototype Db2 z/OS support
nj1973 Dec 19, 2025
680d90b
feat: Prototype Db2 z/OS support
nj1973 Dec 19, 2025
5324407
feat: Prototype Db2 z/OS support
nj1973 Dec 19, 2025
8e9340a
feat: Prototype Db2 z/OS support
nj1973 Dec 19, 2025
20cf58c
feat: Move Impala/Hive functions to dedicated registry file
nj1973 Dec 19, 2025
da0b076
feat: Move Impala/Hive functions to dedicated registry file
nj1973 Dec 19, 2025
d43e8a6
feat: Move Impala/Hive functions to dedicated registry file
nj1973 Dec 19, 2025
7d9fe34
feat: Move Impala/Hive functions to dedicated registry file
nj1973 Dec 19, 2025
d9c1602
fix: Db2 GROUP BY support in column validation
nj1973 Dec 22, 2025
f678fd9
feat: Prototype Db2 z/OS support
nj1973 Dec 22, 2025
5b3c465
feat: Prototype Db2 z/OS support
nj1973 Dec 22, 2025
bc6b1d5
feat: Prototype Db2 z/OS support
nj1973 Dec 22, 2025
7390f28
feat: Prototype Db2 z/OS support
nj1973 Dec 22, 2025
13ffff5
feat: Prototype Db2 z/OS support
nj1973 Dec 22, 2025
1bef8b6
chore: Pandas deprecation warning
nj1973 Jan 8, 2026
1c9e643
chore: Resolve Pandas FutureWarning
nj1973 Jan 8, 2026
4cb50af
feat: Prototype Db2 z/OS support
nj1973 Jan 8, 2026
9eb756d
feat: Prototype Db2 z/OS support
nj1973 Jan 9, 2026
9724414
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Jan 13, 2026
00dcc0e
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Jan 16, 2026
7fc6976
feat: Prototype Db2 z/OS support
nj1973 Jan 16, 2026
00bd601
fix: Fix strftime for Db2 LUW
nj1973 Jan 23, 2026
dfb8e13
fix: Fix strftime for Db2 LUW
nj1973 Jan 23, 2026
3b844cd
fix: Fix strftime for Db2 LUW
nj1973 Jan 23, 2026
5fefbdc
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Jan 23, 2026
f0473fe
test: Change dvt_db2_types testing to compare with BigQuery table
nj1973 Jan 23, 2026
2d3b21d
test: Change dvt_db2_types testing to compare with BigQuery table
nj1973 Jan 23, 2026
48011bd
fix: Use strftime to format TIME data types
nj1973 Jan 23, 2026
85c0a46
fix: Fix Db2 TIME formatting
nj1973 Jan 27, 2026
1ffb7a7
feat: Prototype Db2 z/OS support
nj1973 Jan 27, 2026
bc011ac
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Jan 28, 2026
dedf97e
test: Add missing DBCLOB column to pso_data_validator.dvt_db2_types
nj1973 Jan 30, 2026
75746de
test: Fix pso_data_validator.dvt_core_types data
nj1973 Jan 30, 2026
336d3d3
test: Add more Db2 tests
nj1973 Jan 30, 2026
439afac
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Feb 4, 2026
f9f24a8
feat: Prototype Db2 z/OS support
nj1973 Feb 5, 2026
595f865
Revert "feat: Prototype Db2 z/OS support"
nj1973 Feb 5, 2026
6cb7eb6
feat: Prototype Db2 z/OS support
nj1973 Feb 6, 2026
1b41c80
fix: Attempt to prevent exceptions due to ROWID types
nj1973 Feb 6, 2026
e6fe664
Revert "fix: Attempt to prevent exceptions due to ROWID types"
nj1973 Feb 6, 2026
6828f1a
feat: Prototype Db2 z/OS support
nj1973 Feb 6, 2026
d669a24
feat: Add Db2 z/OS VARG variant of VARGRAPHIC
nj1973 Feb 6, 2026
4721811
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Feb 6, 2026
6a55378
feat: Prototype Db2 z/OS support
nj1973 Feb 6, 2026
e5b060f
fix: Skip Db2 internal generated columns
nj1973 Feb 9, 2026
6984bbe
fix: Skip Db2 internal generated columns
nj1973 Feb 9, 2026
69a6cd0
fix: Skip Db2 internal generated columns
nj1973 Feb 9, 2026
912b67e
fix: Skip Db2 internal generated columns
nj1973 Feb 9, 2026
3d81f7c
fix: Skip Db2 internal generated columns
nj1973 Feb 9, 2026
6e19966
feat: Prototype Db2 z/OS support
nj1973 Feb 10, 2026
4eeda00
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Feb 11, 2026
626c6c6
feat: Prototype Db2 z/OS support
nj1973 Feb 11, 2026
da47aad
chore: Fix Pandas 3 FutureWarning
nj1973 Feb 11, 2026
9d5b663
feat: Prototype Db2 z/OS support
nj1973 Feb 11, 2026
284ff31
feat: Prototype Db2 z/OS support
nj1973 Feb 11, 2026
c029f97
feat: Prototype Db2 z/OS support
nj1973 Feb 11, 2026
3c8779c
feat: Prototype Db2 z/OS support
nj1973 Feb 11, 2026
287a706
feat: Prototype Db2 z/OS support
nj1973 Feb 11, 2026
72f347e
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Feb 12, 2026
1cf3e80
feat: Prototype Db2 z/OS support
nj1973 Feb 12, 2026
d3dec08
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Feb 20, 2026
c8e2742
feat: Exclude XML from Db2 z/OS column validations
nj1973 Feb 23, 2026
2087540
chore: Fix merge conflict mistake
nj1973 Feb 23, 2026
b2d4c8c
chore: Fix merge conflict mistake
nj1973 Feb 23, 2026
17b47c5
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Feb 24, 2026
634b8b5
fix: Fix formatting of decimal with scale>0 for Db2 row validation
nj1973 Feb 24, 2026
d88ee2d
feat: Add VARBIN for Db2 z/OS
nj1973 Feb 24, 2026
56a15eb
feat: Add decimal cast override for Db2 z/OS
nj1973 Feb 25, 2026
5674c82
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Feb 26, 2026
1559877
fix: Force Db2 FOR BIT DATA columns to Ibis Binary
nj1973 Feb 26, 2026
fb47abd
fix: Add ifnull token length for Db2 binary data types
nj1973 Feb 26, 2026
2ae6ffe
fix: FOR BIT DATA tweak for Db2 z/OS
nj1973 Feb 26, 2026
9d54457
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Mar 2, 2026
d1fe542
chore: Fix merge
nj1973 Mar 2, 2026
80a64fb
fix: FOR BIT DATA tweak for Db2 z/OS
nj1973 Mar 3, 2026
dc0a1b4
feat: Auto exclude Db2 internal hidden columns from validations
nj1973 Mar 4, 2026
56ce9fe
feat: Auto exclude Db2 internal hidden columns from validations
nj1973 Mar 4, 2026
db593c5
fix: Cap Db2 precision at 31 when casting decimals to string
nj1973 Mar 4, 2026
161d7b2
test: Fix schema name in Db2 test
nj1973 Mar 4, 2026
302a8e0
fix: Cap Db2 z/OS precision at 31 when casting decimals to string
nj1973 Mar 4, 2026
a23ec12
feat: Add random row support for Db2 z/OS
nj1973 Mar 12, 2026
14d8a86
feat: Add random row support for Db2 z/OS
nj1973 Mar 12, 2026
a59b3d4
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Mar 12, 2026
41fd4eb
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Mar 13, 2026
2737806
chore: Fix broken merge
nj1973 Mar 13, 2026
dca1f71
feat: Add Db2 z/OS support
nj1973 Mar 13, 2026
9b1dfca
feat: Add random row support for Db2 z/OS
nj1973 Mar 13, 2026
5f3246d
fix: Add raw datatype support for Db2 custom queries
nj1973 Mar 19, 2026
04903a8
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Mar 19, 2026
38800d7
test: Unit tests for Db2 connections add
nj1973 Mar 31, 2026
92c189b
feat: Add Db2 z/OS support
nj1973 Apr 1, 2026
786a08a
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Apr 2, 2026
38ac21c
chore: Reformat
nj1973 Apr 2, 2026
571922b
feat: Add Db2 z/OS support
nj1973 Apr 2, 2026
c964c68
feat: Add Db2 z/OS support
nj1973 Apr 2, 2026
576fcb9
feat: Add Db2 z/OS support
nj1973 Apr 2, 2026
8c1ba23
feat: Add Db2 z/OS support
nj1973 Apr 2, 2026
9565646
feat: Add Db2 z/OS support
nj1973 Apr 2, 2026
fcc35b8
feat: Add Db2 z/OS support
nj1973 Apr 2, 2026
486e4a6
feat: Add Db2 z/OS support
nj1973 Apr 2, 2026
a15b12b
feat: Add Db2 z/OS support
nj1973 Apr 2, 2026
9ef1a4c
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Apr 2, 2026
5b47c45
chore: Remove unused imports
nj1973 Apr 8, 2026
a7a2363
feat: Add Db2 z/OS support
nj1973 Apr 9, 2026
071b853
Merge remote-tracking branch 'origin/develop' into 1630-db2-zos-support
nj1973 Apr 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ DVT supports the following connection types:

* [AlloyDB](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/connections.md#alloydb)
* [BigQuery](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/connections.md#google-bigquery)
* [DB2](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/connections.md#db2)
* [Db2 LUW](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/connections.md#db2_luw)
* [Db2 z/OS](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/connections.md#db2_zos)
* [FileSystem](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/connections.md#filesystem)
* [Hive](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/connections.md#hive)
* [Impala](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/connections.md#impala)
Expand Down Expand Up @@ -70,7 +71,7 @@ The CLI is the main interface to use this tool and it has several different
commands which can be used to create and run validations. DVT is designed to run in
an environment connected to GCP services, specifically, BigQuery, GCS and Secret manager.
If DVT is being run on-premises or in an environment with restricted access to GCP services, see
[running DVT at on-prem](#running-dvt-at-on-prem). Below are the command syntax and options for running validations.
[running DVT at on-prem](#running-dvt-at-on-prem). Below are the command syntax and options for running validations.

Alternatives to running DVT in the CLI include deploying DVT to Cloud Run, Cloud Functions, or Airflow
([Examples Here](https://github.com/GoogleCloudPlatform/professional-services-data-validator/tree/develop/samples)). See the [Validation Logic](https://github.com/GoogleCloudPlatform/professional-services-data-validator#validation-logic) section
Expand Down
21 changes: 16 additions & 5 deletions data_validation/cli_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,24 @@
["http_path", "URL path of HTTP proxy"],
],
consts.SOURCE_TYPE_DB2: [
["host", "DB2 host"],
["port", "DB2 port (50000 if not provided)"],
["host", "Db2 host"],
["port", "Db2 port (50000 if not provided)"],
["user", "Username to connect to"],
["password", "Password for authentication of user"],
["database", "Database in DB2 to connect to"],
["url", "URL link in DB2 to connect to"],
["driver", "Driver link in DB2 to connect to (default ibm_db_sa)"],
["database", "Database in Db2 to connect to"],
["url", "URL link in Db2 to connect to"],
["driver", "Driver link in Db2 to connect to (default ibm_db_sa)"],
["connect_args", "(Optional) Additional connection argument mapping"],
],
consts.SOURCE_TYPE_DB2_ZOS: [
["host", "Db2 host"],
["port", "Db2 port (50000 if not provided)"],
["user", "Username to connect to"],
["password", "Password for authentication of user"],
["database", "Database in Db2 to connect to"],
["url", "URL link in Db2 to connect to"],
["driver", "Driver link in Db2 to connect to (default ibm_db_sa)"],
["connect_args", "(Optional) Additional connection argument mapping"],
],
}

Expand Down
5 changes: 5 additions & 0 deletions data_validation/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"oracle",
"postgres",
"db2",
"db2_zos",
"mssql",
"redshift",
"snowflake",
Expand Down Expand Up @@ -91,8 +92,10 @@ def get_client_call(*args, **kwargs):
# DB2 requires ibm_db_sa
try:
from third_party.ibis.ibis_db2.api import db2_connect
from third_party.ibis.ibis_db2_zos.api import db2_zos_connect
except ImportError:
db2_connect = _raise_missing_client_error("pip install ibm_db_sa")
db2_zos_connect = _raise_missing_client_error("pip install ibm_db_sa")

# Sybase requires sqlalchemy_sybase package.
try:
Expand Down Expand Up @@ -227,6 +230,7 @@ def get_ibis_table(client, schema_name, table_name, database_name=None):
"oracle",
"postgres",
"db2",
"db2_zos",
"mssql",
"redshift",
"sybase",
Expand Down Expand Up @@ -430,4 +434,5 @@ def get_max_in_list_size(client, in_list_over_expressions=False):
consts.SOURCE_TYPE_SPANNER: spanner_connect,
consts.SOURCE_TYPE_SYBASE: sybase_connect,
consts.SOURCE_TYPE_DB2: db2_connect,
consts.SOURCE_TYPE_DB2_ZOS: db2_zos_connect,
}
27 changes: 25 additions & 2 deletions data_validation/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,11 +676,25 @@ def _is_db2_blob(self, source_column_name: str, target_column_name: str) -> bool
)

def _is_db2_xml(self, source_column_name: str, target_column_name: str) -> bool:
"""Returns True when either source or target column is Oracle LOB data type."""
"""Returns True when either source or target column is Db2 XML data type."""
return self._is_raw_data_type(
"db2", source_column_name, target_column_name, ["XML"]
)

def _is_db2_zos_blob(
self, source_column_name: str, target_column_name: str
) -> bool:
"""Returns True when either source or target column is Db2 z/OS BLOB data type."""
return self._is_raw_data_type(
"db2_zos", source_column_name, target_column_name, ["BLOB"]
)

def _is_db2_zos_xml(self, source_column_name: str, target_column_name: str) -> bool:
"""Returns True when either source or target column is Db2 z/OS XML data type."""
return self._is_raw_data_type(
"db2_zos", source_column_name, target_column_name, ["XML"]
)

def _is_oracle_lob(self, source_column_name: str, target_column_name: str) -> bool:
"""Returns True when either source or target column is Oracle LOB data type.

Expand Down Expand Up @@ -1066,7 +1080,11 @@ def require_pre_agg_calc_field(
# Oracle BLOB is invalid for use with SQL COUNT function.
# The expression below returns True if client is Oracle which
# has the effect of triggering use of byte_length transformation.
return self._is_oracle_lob(source_column, target_column)
# Same for Db2 z/OS.
return bool(
self._is_oracle_lob(source_column, target_column)
or self._is_db2_zos_blob(source_column, target_column)
)
else:
# Convert to length for any min/max/sum on binary columns.
return True
Expand Down Expand Up @@ -1154,6 +1172,11 @@ def require_pre_agg_calc_field(
f"Skipping {agg_type} on {column} due to SQL Server image data type"
)
continue
elif self._is_db2_zos_xml(column, column):
logging.info(
f"Skipping {agg_type} on {column} due to Db2 z/OS XML data type"
)
continue
elif agg_type != "count" and self._is_db2_xml(column, column):
logging.info(
f"Skipping {agg_type} on {column} due to Db2 XML data type"
Expand Down
1 change: 1 addition & 0 deletions data_validation/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
# Connection key constants.
SOURCE_TYPE_BIGQUERY = "BigQuery"
SOURCE_TYPE_DB2 = "DB2"
SOURCE_TYPE_DB2_ZOS = "DB2_ZOS"
SOURCE_TYPE_FILESYSTEM = "FileSystem"
SOURCE_TYPE_IMPALA = "Impala"
SOURCE_TYPE_MSSQL = "MSSQL"
Expand Down
17 changes: 15 additions & 2 deletions data_validation/query_builder/random_row_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from data_validation.query_builder.query_builder import QueryBuilder

# Adding new data sources should be done by adding the Backend name here
RANDOM_SORT_SUPPORTS = [
SUPPORTS_SORT_BY_RANDOM = [
"bigquery",
"teradata",
"impala",
Expand All @@ -35,6 +35,10 @@
"sybase",
]

SUPPORTS_SORT_BY_ALIASED_RANDOM = [
"db2_zos",
]


class RandomRowBuilder(object):
def __init__(self, primary_keys: List[str], batch_size: int):
Expand Down Expand Up @@ -87,7 +91,16 @@ def maybe_add_random_sort(
self, data_client: ibis.backends.base.BaseBackend, table: ibis.Expr
) -> ibis.Expr:
"""Return a randomly sorted query if it is supported for the client."""
if data_client.name in RANDOM_SORT_SUPPORTS:
if data_client.name in SUPPORTS_SORT_BY_ALIASED_RANDOM:
random_sort_col = "random_sort"
return (
table[self.primary_keys]
.mutate(**{random_sort_col: ibis.random()})
.order_by(random_sort_col)
.limit(self.batch_size)[self.primary_keys]
)

if data_client.name in SUPPORTS_SORT_BY_RANDOM:
# Teradata 'SAMPLE' and Spanner 'TABLESAMPLE' is random by nature
# and does not require a sort by
if data_client.name == "teradata" or data_client.name == "spanner":
Expand Down
2 changes: 1 addition & 1 deletion data_validation/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def dvt_temp_object_name(prefix: str = "dvt_temp") -> str:
prefix: The prefix to use for the temporary object name.

Returns:
A lower case random name for when DVT needs to create a temporary object.
A random name for when DVT needs to create a temporary object.
"""
if not isinstance(prefix, str) or not re.match(r"^[a-zA-Z0-9_]+$", prefix):
raise exceptions.ValidationException(
Expand Down
60 changes: 50 additions & 10 deletions docs/connections.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ The data validation tool supports the following connection types.
* [FileSystem](#filesystem-csv-orc-parquet-or-json-only)
* [Impala](#impala)
* [Hive](#hive)
* [DB2](#db2)
* [Db2 LUW](#db2)
* [Db2 z/OS](#db2_zos)
* [AlloyDB](#alloydb)
* [Snowflake](#snowflake)
* [Sybase ASE](#sybase-ase)
Expand Down Expand Up @@ -411,22 +412,61 @@ data-validation connections add

```

## DB2
## Db2 LUW

DB2 requires the `ibm_db_sa` package. We currently support only IBM DB2 LUW - Universal Database for Linux/Unix/Windows versions 9.7 onwards.
Db2 requires the `ibm_db_sa` package. We currently support only IBM Db2 LUW - Universal Database for Linux/Unix/Windows versions 9.7 onwards.

```
data-validation connections add
[--secret-manager-type <None|GCP>] Secret Manager type (None, GCP)
[--secret-manager-project-id SECRET_PROJECT_ID] Secret Manager project ID
--connection-name CONN_NAME DB2 Connection name
--host HOST DB2 host
--port PORT DB2 port, defaults to 50000
--user USER DB2 user
--password PASSWORD DB2 password
--database DATABASE DB2 database
--connection-name CONN_NAME Db2 Connection name
--host HOST Db2 host
--port PORT Db2 port, defaults to 50000
--user USER Db2 user
--password PASSWORD Db2 password
--database DATABASE Db2 database
[--url URL] SQLAlchemy connection URL
[--driver DRIVER] DB2 driver, defaults to "ibm_db_sa"
[--driver DRIVER] Db2 driver, defaults to "ibm_db_sa"
[--connect-args CONNECT_ARGS] Additional connection args, JSON String dict, default {}
```

Example TLS connection:
```
data-validation connections add -c db2conn DB2 \
--host=sdb2-host --database=somedb \
--user=dvt --password=DVTS3cret \
--connect-args='{"Security": "SSL", "SSLClientKeystoredb": "/path/to/file.kdb", "SSLClientKeystash": "/path/to/file.sth"}'
```

## Db2 z/OS

Db2 requires the `ibm_db_sa` package.

```
data-validation connections add
[--secret-manager-type <None|GCP>] Secret Manager type (None, GCP)
[--secret-manager-project-id SECRET_PROJECT_ID] Secret Manager project ID
--connection-name CONN_NAME DB2_zOS Connection name
--host HOST Db2 host
--port PORT Db2 port, defaults to 50000
--user USER Db2 user
--password PASSWORD Db2 password
--database DATABASE Db2 database
[--url URL] SQLAlchemy connection URL
[--driver DRIVER] Db2 driver, defaults to "ibm_db_sa"
[--connect-args CONNECT_ARGS] Additional connection args, JSON String dict, default {}
```

Db2 permissions required to run DVT custom-query validations:
- CREATE VIEW. See [Db2 z/OS limitations](limitations.md#db2-zos).

Example TLS connection:
```
data-validation connections add -c db2conn DB2_zOS \
--host=sdb2-host --database=somedb \
--user=dvt --password=DVTS3cret \
--connect-args='{"Security": "SSL", "SSLClientKeystoredb": "/path/to/file.kdb", "SSLClientKeystash": "/path/to/file.sth"}'
```

Db2 permissions required to run DVT custom-query validations:
Expand Down
11 changes: 10 additions & 1 deletion docs/limitations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,19 @@
## Db2 LUW

- Db2 LUW BLOB datatype is excluded from row validation due to incompatibility with concatenation/hashing functions.
- Db2 LUW XML data type is not compatible with the LENGTH function and is excluded from any column validations other than `--count`.
- Db2 LUW custom query validations require the creation of temporary views in the database to resolve additional data type information.
This requires CREATE VIEW privileges for the connected user. Without it some data types will not be resolved correctly, for
example CHARACTER will be interpreted as VARCHAR.

## Db2 z/OS

- Db2 z/OS XML data type is not compatible with aggregation functions or LENGTH function and is excluded from all column validations.
- Db2 z/OS custom query validations require the creation of temporary views in the database to resolve additional data type information.
This requires CREATE VIEW privileges for the connected user. Without it some data types will not be resolved correctly, for
example CHARACTER will be interpreted as VARCHAR.
- Db2 Z/OS ROWID data type is not supported.

## Oracle

- Requires the `oracledb` package to be installed as an extra dependency.
Expand Down Expand Up @@ -42,4 +51,4 @@
## Teradata

- Requires the `teradatasql` package to be installed as an extra dependency.
- Teradata does not have a native SHA-256 hash function but a third party UDF can be (installed)[https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/installation.md#teradata].
- Teradata does not have a native SHA-256 hash function but a third party UDF can be (installed)[https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/installation.md#teradata].
16 changes: 16 additions & 0 deletions tests/resources/db2_test_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -242,3 +242,19 @@ INSERT INTO pso_data_validator.dvt_tricky_dates VALUES
-- NULL in all columns.
INSERT INTO pso_data_validator.dvt_tricky_dates (id) VALUES (2);
COMMIT;

-- pso_data_validator.dvt_db2_generated_cols1 has fake generated columns that should be ignored.
CREATE TABLE IF NOT EXISTS pso_data_validator.dvt_db2_generated_cols1
( id INTEGER NOT NULL PRIMARY KEY
, col_int INTEGER
, db2_generated_docid_for_xml INTEGER
, db2_generated_rowid_for_lob INTEGER);
COMMENT ON TABLE pso_data_validator.dvt_db2_generated_cols1 IS 'Test table to prove generated columns are ignored.';
INSERT INTO pso_data_validator.dvt_db2_generated_cols1 VALUES (1,1,1,1);
COMMIT;
-- pso_data_validator.dvt_db2_generated_cols2 no fake generated columns, tests in tandem with dvt_db2_generated_cols1.
CREATE TABLE IF NOT EXISTS pso_data_validator.dvt_db2_generated_cols2
( id INTEGER NOT NULL PRIMARY KEY
, col_int INTEGER);
COMMENT ON TABLE pso_data_validator.dvt_db2_generated_cols2 IS 'Test table to prove generated columns are ignored.';
INSERT INTO pso_data_validator.dvt_db2_generated_cols2 VALUES (1,1);
Loading
Loading