google-pso-data-validator 4.2.0__tar.gz → 4.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {google-pso-data-validator-4.2.0/google_pso_data_validator.egg-info → google-pso-data-validator-4.4.0}/PKG-INFO +62 -20
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/README.md +60 -18
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/__main__.py +146 -24
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/cli_tools.py +44 -10
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/clients.py +1 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/combiner.py +13 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/config_manager.py +66 -25
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/consts.py +1 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/partition_builder.py +35 -10
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/state_manager.py +12 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0/google_pso_data_validator.egg-info}/PKG-INFO +62 -20
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/google_pso_data_validator.egg-info/SOURCES.txt +1 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/google_pso_data_validator.egg-info/requires.txt +1 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/setup.py +2 -2
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_addon/api.py +13 -2
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_addon/operations.py +52 -24
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_cloud_spanner/__init__.py +10 -5
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_cloud_spanner/api.py +2 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_cloud_spanner/client.py +2 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_cloud_spanner/compiler.py +4 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_cloud_spanner/datatypes.py +2 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_cloud_spanner/registry.py +7 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_db2/__init__.py +13 -12
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_db2/api.py +3 -3
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_db2/compiler.py +2 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_db2/datatypes.py +16 -17
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_db2/registry.py +98 -95
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_impala/api.py +15 -15
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_mssql/__init__.py +8 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_mssql/api.py +2 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_mssql/datatypes.py +2 -2
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_mysql/compiler.py +3 -2
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_oracle/__init__.py +13 -9
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_oracle/api.py +2 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_oracle/compiler.py +1 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_oracle/datatypes.py +47 -21
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_oracle/registry.py +94 -95
- google-pso-data-validator-4.4.0/third_party/ibis/ibis_postgres/__init__.py +2 -0
- google-pso-data-validator-4.4.0/third_party/ibis/ibis_postgres/client.py +121 -0
- google-pso-data-validator-4.4.0/third_party/ibis/ibis_postgres/datatypes.py +22 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_redshift/__init__.py +10 -10
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_redshift/api.py +4 -3
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_redshift/compiler.py +3 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_snowflake/datatypes.py +1 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_teradata/__init__.py +23 -1
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_teradata/api.py +2 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_teradata/registry.py +9 -1
- google-pso-data-validator-4.2.0/third_party/ibis/ibis_postgres/client.py +0 -63
- google-pso-data-validator-4.2.0/third_party/ibis/ibis_snowflake/__init__.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/LICENSE +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/__init__.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/app.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/client_info.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/data_validation.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/exceptions.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/jellyfish_distance.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/metadata.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/query_builder/__init__.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/query_builder/partition_row_builder.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/query_builder/query_builder.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/query_builder/random_row_builder.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/result_handlers/__init__.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/result_handlers/bigquery.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/result_handlers/text.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/schema_validation.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/secret_manager.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/data_validation/validation_builder.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/google_pso_data_validator.egg-info/dependency_links.txt +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/google_pso_data_validator.egg-info/entry_points.txt +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/google_pso_data_validator.egg-info/top_level.txt +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/setup.cfg +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_addon/__init__.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_cloud_spanner/tests/__init__.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_cloud_spanner/tests/conftest.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_cloud_spanner/to_pandas.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_impala/__init__.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_mysql/__init__.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_mysql/base_sql_compiler/__init__.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_mysql/base_sql_compiler/select_builder.py +0 -0
- {google-pso-data-validator-4.2.0/third_party/ibis/ibis_postgres → google-pso-data-validator-4.4.0/third_party/ibis/ibis_snowflake}/__init__.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_snowflake/api.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_teradata/compiler.py +0 -0
- {google-pso-data-validator-4.2.0 → google-pso-data-validator-4.4.0}/third_party/ibis/ibis_teradata/datatypes.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: google-pso-data-validator
|
|
3
|
-
Version: 4.
|
|
3
|
+
Version: 4.4.0
|
|
4
4
|
Summary: A package to enable easy data validation
|
|
5
5
|
Home-page: https://github.com/pypa/sampleproject
|
|
6
6
|
Author: Dylan Hercher
|
|
@@ -29,7 +29,7 @@ Requires-Dist: psycopg2-binary==2.9.6
|
|
|
29
29
|
Requires-Dist: PyYAML==6.0
|
|
30
30
|
Requires-Dist: pandas==1.5.3
|
|
31
31
|
Requires-Dist: proto-plus==1.22.3
|
|
32
|
-
Requires-Dist: pyarrow==
|
|
32
|
+
Requires-Dist: pyarrow==14.0.1
|
|
33
33
|
Requires-Dist: pydata-google-auth==1.8.0
|
|
34
34
|
Requires-Dist: google-cloud-bigquery==3.11.3
|
|
35
35
|
Requires-Dist: google-cloud-bigquery-storage==2.20.0
|
|
@@ -101,8 +101,8 @@ setup steps needed to install and use the Data Validation Tool.
|
|
|
101
101
|
Before using this tool, you will need to create connections to the source and
|
|
102
102
|
target tables. Once the connections are created, you can run validations on
|
|
103
103
|
those tables. Validation results can be printed to stdout (default) or outputted
|
|
104
|
-
to BigQuery (recommended). DVT also allows you to save
|
|
105
|
-
configurations in a YAML file. This is useful for running common validations or
|
|
104
|
+
to BigQuery (recommended). DVT also allows you to save and edit validation
|
|
105
|
+
configurations in a YAML or JSON file. This is useful for running common validations or
|
|
106
106
|
updating the configuration.
|
|
107
107
|
|
|
108
108
|
### Managing Connections
|
|
@@ -121,6 +121,8 @@ Alternatives to running DVT in the CLI include deploying DVT to Cloud Run, Cloud
|
|
|
121
121
|
([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
|
|
122
122
|
to learn more about how DVT uses the CLI to generate SQL queries.
|
|
123
123
|
|
|
124
|
+
Note that we do not support nested or complex columns for column or row validations.
|
|
125
|
+
|
|
124
126
|
#### Column Validations
|
|
125
127
|
|
|
126
128
|
Below is the command syntax for column validations. To run a grouped column
|
|
@@ -146,15 +148,13 @@ data-validation (--verbose or -v) (--log-level or -ll) validate column
|
|
|
146
148
|
i.e 'bigquery-public-data.new_york_citibike.citibike_trips'
|
|
147
149
|
[--grouped-columns or -gc GROUPED_COLUMNS]
|
|
148
150
|
Comma separated list of columns for Group By i.e col_a,col_b
|
|
149
|
-
[--primary-keys or -pk PRIMARY_KEYS]
|
|
150
|
-
Comma separated list of columns to use as primary keys
|
|
151
|
-
(Note) Only use with grouped column validation. See *Primary Keys* section.
|
|
152
151
|
[--count COLUMNS] Comma separated list of columns for count or * for all columns
|
|
153
152
|
[--sum COLUMNS] Comma separated list of columns for sum or * for all numeric
|
|
154
153
|
[--min COLUMNS] Comma separated list of columns for min or * for all numeric
|
|
155
154
|
[--max COLUMNS] Comma separated list of columns for max or * for all numeric
|
|
156
155
|
[--avg COLUMNS] Comma separated list of columns for avg or * for all numeric
|
|
157
156
|
[--std COLUMNS] Comma separated list of columns for stddev_samp or * for all numeric
|
|
157
|
+
[--exclude-columns or -ec] Flag to indicate the list of columns provided should be excluded and not included.
|
|
158
158
|
[--bq-result-handler or -bqrh PROJECT_ID.DATASET.TABLE]
|
|
159
159
|
BigQuery destination for validation results. Defaults to stdout.
|
|
160
160
|
See: *Validation Reports* section
|
|
@@ -171,7 +171,10 @@ data-validation (--verbose or -v) (--log-level or -ll) validate column
|
|
|
171
171
|
If target filter is not provided, the source filter will run on source and target tables.
|
|
172
172
|
See: *Filters* section
|
|
173
173
|
[--config-file or -c CONFIG_FILE]
|
|
174
|
-
YAML Config File Path to be used for storing validations.
|
|
174
|
+
YAML Config File Path to be used for storing validations and other features.
|
|
175
|
+
See: *Running DVT with YAML Configuration Files* section
|
|
176
|
+
[--config-file-json or -cj CONFIG_FILE_JSON]
|
|
177
|
+
JSON Config File Path to be used for storing validations only for application purposes.
|
|
175
178
|
[--threshold or -th THRESHOLD]
|
|
176
179
|
Float value. Maximum pct_difference allowed for validation to be considered a success. Defaults to 0.0
|
|
177
180
|
[--labels or -l KEY1=VALUE1,KEY2=VALUE2]
|
|
@@ -182,8 +185,8 @@ data-validation (--verbose or -v) (--log-level or -ll) validate column
|
|
|
182
185
|
Comma separated list of statuses to filter the validation results. Supported statuses are (success, fail). If no list is provided, all statuses are returned.
|
|
183
186
|
```
|
|
184
187
|
|
|
185
|
-
The default aggregation type is a 'COUNT *'
|
|
186
|
-
|
|
188
|
+
The default aggregation type is a 'COUNT *', which will run in addition to the validations you specify. To remove this default,
|
|
189
|
+
use [YAML configs](https://github.com/GoogleCloudPlatform/professional-services-data-validator/tree/develop#running-dvt-with-yaml-configuration-files).
|
|
187
190
|
|
|
188
191
|
The [Examples](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/examples.md) page provides many examples of how a tool can be used to run powerful validations without writing any queries.
|
|
189
192
|
|
|
@@ -207,7 +210,7 @@ and finally hashing the row.
|
|
|
207
210
|
|
|
208
211
|
Under the hood, row validation uses
|
|
209
212
|
[Calculated Fields](https://github.com/GoogleCloudPlatform/professional-services-data-validator#calculated-fields) to
|
|
210
|
-
apply functions such as IFNULL() or RTRIM(). These can be edited in the YAML config to customize your row validation.
|
|
213
|
+
apply functions such as IFNULL() or RTRIM(). These can be edited in the YAML or JSON config file to customize your row validation.
|
|
211
214
|
|
|
212
215
|
```
|
|
213
216
|
data-validation (--verbose or -v) (--log-level or -ll) validate row
|
|
@@ -238,7 +241,10 @@ data-validation (--verbose or -v) (--log-level or -ll) validate row
|
|
|
238
241
|
If target filter is not provided, the source filter will run on source and target tables.
|
|
239
242
|
See: *Filters* section
|
|
240
243
|
[--config-file or -c CONFIG_FILE]
|
|
241
|
-
YAML Config File Path to be used for storing validations.
|
|
244
|
+
YAML Config File Path to be used for storing validations and other features.
|
|
245
|
+
See: *Running DVT with YAML Configuration Files* section
|
|
246
|
+
[--config-file-json or -cj CONFIG_FILE_JSON]
|
|
247
|
+
JSON Config File Path to be used for storing validations only for application purposes.
|
|
242
248
|
[--labels or -l KEY1=VALUE1,KEY2=VALUE2]
|
|
243
249
|
Comma-separated key value pair labels for the run.
|
|
244
250
|
[--format or -fmt] Format for stdout output. Supported formats are (text, csv, json, table).
|
|
@@ -315,7 +321,10 @@ data-validation (--verbose or -v) (--log-level or -ll) validate schema
|
|
|
315
321
|
[--service-account or -sa PATH_TO_SA_KEY]
|
|
316
322
|
Service account to use for BigQuery result handler output.
|
|
317
323
|
[--config-file or -c CONFIG_FILE]
|
|
318
|
-
YAML Config File Path to be used for storing validations.
|
|
324
|
+
YAML Config File Path to be used for storing validations and other features.
|
|
325
|
+
See: *Running DVT with YAML Configuration Files* section
|
|
326
|
+
[--config-file-json or -cj CONFIG_FILE_JSON]
|
|
327
|
+
JSON Config File Path to be used for storing validations only for application purposes.
|
|
319
328
|
[--format or -fmt] Format for stdout output. Supported formats are (text, csv, json, table).
|
|
320
329
|
Defaults to table.
|
|
321
330
|
[--filter-status or -fs STATUSES_LIST]
|
|
@@ -359,11 +368,17 @@ data-validation (--verbose or -v) (--log-level or -ll) validate custom-query col
|
|
|
359
368
|
[--max COLUMNS] Comma separated list of columns for max or * for all numeric
|
|
360
369
|
[--avg COLUMNS] Comma separated list of columns for avg or * for all numeric
|
|
361
370
|
[--std COLUMNS] Comma separated list of columns for stddev_samp or * for all numeric
|
|
371
|
+
[--exclude-columns or -ec] Flag to indicate the list of columns provided should be excluded and not included.
|
|
362
372
|
[--bq-result-handler or -bqrh PROJECT_ID.DATASET.TABLE]
|
|
363
373
|
BigQuery destination for validation results. Defaults to stdout.
|
|
364
374
|
See: *Validation Reports* section
|
|
365
375
|
[--service-account or -sa PATH_TO_SA_KEY]
|
|
366
376
|
Service account to use for BigQuery result handler output.
|
|
377
|
+
[--config-file or -c CONFIG_FILE]
|
|
378
|
+
YAML Config File Path to be used for storing validations and other features.
|
|
379
|
+
See: *Running DVT with YAML Configuration Files* section
|
|
380
|
+
[--config-file-json or -cj CONFIG_FILE_JSON]
|
|
381
|
+
JSON Config File Path to be used for storing validations only for application purposes.
|
|
367
382
|
[--labels or -l KEY1=VALUE1,KEY2=VALUE2]
|
|
368
383
|
Comma-separated key value pair labels for the run.
|
|
369
384
|
[--format or -fmt] Format for stdout output. Supported formats are (text, csv, json, table).
|
|
@@ -421,6 +436,11 @@ data-validation (--verbose or -v) (--log-level or -ll) validate custom-query row
|
|
|
421
436
|
See: *Validation Reports* section
|
|
422
437
|
[--service-account or -sa PATH_TO_SA_KEY]
|
|
423
438
|
Service account to use for BigQuery result handler output.
|
|
439
|
+
[--config-file or -c CONFIG_FILE]
|
|
440
|
+
YAML Config File Path to be used for storing validations and other features.
|
|
441
|
+
See: *Running DVT with YAML Configuration Files* section
|
|
442
|
+
[--config-file-json or -cj CONFIG_FILE_JSON]
|
|
443
|
+
JSON Config File Path to be used for storing validations only for application purposes.
|
|
424
444
|
[--labels or -l KEY1=VALUE1,KEY2=VALUE2]
|
|
425
445
|
Comma-separated key value pair labels for the run.
|
|
426
446
|
[--format or -fmt] Format for stdout output. Supported formats are (text, csv, json, table).
|
|
@@ -457,17 +477,19 @@ For example, this flag can be used as follows:
|
|
|
457
477
|
}
|
|
458
478
|
```
|
|
459
479
|
|
|
460
|
-
### YAML Configuration Files
|
|
480
|
+
### Running DVT with YAML Configuration Files
|
|
461
481
|
|
|
462
|
-
|
|
463
|
-
|
|
482
|
+
Running DVT with YAML configuration files is the recommended approach if:
|
|
483
|
+
* you want to customize the configuration for any given validation OR
|
|
484
|
+
* you want to run DVT at scale (i.e. row validations across many partitions)
|
|
485
|
+
Nearly every validation command can take the argument `-c <file-name>` (the `generate-table-partitions` command takes `-cdir <directory-name>`) where one or more yaml files are produced. These yaml files can be modified for custom validations.
|
|
464
486
|
|
|
465
|
-
|
|
487
|
+
The following command creates a YAML file for the validation of the
|
|
466
488
|
`new_york_citibike` table: `data-validation validate column -sc my_bq_conn -tc
|
|
467
489
|
my_bq_conn -tbls bigquery-public-data.new_york_citibike.citibike_trips -c
|
|
468
490
|
citibike.yaml`.
|
|
469
491
|
|
|
470
|
-
The
|
|
492
|
+
The validation config file is saved to the GCS path specified by the `PSO_DV_CONFIG_HOME`
|
|
471
493
|
env variable if that has been set; otherwise, it is saved to wherever the tool is run.
|
|
472
494
|
|
|
473
495
|
You can now edit the YAML file if, for example, the `new_york_citibike` table is
|
|
@@ -492,6 +514,26 @@ View the complete YAML file for a Grouped Column validation on the
|
|
|
492
514
|
[Examples](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/examples.md#sample-yaml-config-grouped-column-validation) page.
|
|
493
515
|
|
|
494
516
|
You can view a list of all saved validation YAML files using `data-validation configs list`, and print a YAML config using `data-validation configs get -c citibike.yaml`.
|
|
517
|
+
#### Scaling DVT to run 10's to 1000's of validations concurrently
|
|
518
|
+
The above example `configs run -cdir` shows how you can run multiple validations with one command. If the directory used has been created by `generate-table-partitions`, you will have partition files numbered from `0000.yaml` to `<partno-1>.yaml`, where `<partno>` is the total number of partitions. These can be run as mentioned above and the partitions will be validated in order. This could take a long time if the number of partitions is large.
|
|
519
|
+
|
|
520
|
+
DVT validations can be run concurrently (horizontal scaling) using GKE (Kubernetes Jobs) or Cloud Run Jobs. In order to run DVT in a container, you have to build a docker image, [see instructions](https://github.com/GoogleCloudPlatform/professional-services-data-validator/tree/develop/samples/docker#readme). Set the `PSO_DV_CONFIG_HOME` environment variable to point to a GCS prefix where the connection configuration files are stored. In Cloud Run you can use the option `--set-env-vars` or `--update-env-vars` to pass [the environment variable](https://cloud.google.com/run/docs/configuring/services/environment-variables#setting). We recommend that you use the `bq-result-handler` to save your validation results. In order to validate partitions concurrently, run DVT in Kubernetes or Cloud Run as shown below:
|
|
521
|
+
```
|
|
522
|
+
data-validation (--verbose or -v) (--log-level or -ll) configs run
|
|
523
|
+
[--kube-completions or -kc] Specifies that validation is being run in Kubernetes or Cloud Run in indexed completion mode.
|
|
524
|
+
specifies to DVT that validation being run in indexed completion mode in Kubernetes or as multiple independent tasks in Cloud Run.
|
|
525
|
+
--config-dir or -cdir GCS_DIRECTORY
|
|
526
|
+
where GCS_DIRECTORY = CONFIG_DIR/SOURCE_SCHEMA.SOURCE_TABLE, where CONFIG_DIR, SOURCE_SCHEMA and SOURCE_TABLE are
|
|
527
|
+
the arguments provided to generate-table-partitions to generate the partition yamls. GCS_DIRECTORY is the directory
|
|
528
|
+
where the partition files numbered 0000.yaml to <partno-1>.yaml are stored.
|
|
529
|
+
```
|
|
530
|
+
If you are not familiar with Kubernetes or Cloud Run Jobs, review the [internal docs](docs/internal/kubernetes_jobs.md) for an overview of the orchestration of multiple validations.
|
|
531
|
+
|
|
532
|
+
The Cloud Run and Kubernetes pods must run in a network with access to the database servers. Every Cloud Run job is associated with a [service account](https://cloud.google.com/run/docs/securing/service-identity). You need to ensure that this service account has access to Google Cloud Storage (to read connection configuration and yaml files) and BigQuery (to publish results). If you are using Kubernetes, you will need to use a service account with the same privileges as mentioned for Cloud Run. In Kubernetes, you will need to set up [workload identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) so the DVT container can impersonate the service account.
|
|
533
|
+
|
|
534
|
+
In Cloud Run, the [job](https://cloud.google.com/run/docs/create-jobs) must be run as multiple, independent tasks with the task count set to the number of partitions generated. In Kubernetes, set the number of completions to the number of partitions generated - see [Kubernetes Parallel Jobs](https://kubernetes.io/docs/concepts/workloads/controllers/job/#parallel-jobs). The option `--kube-completions or -kc` tells DVT that many DVT containers are running in a Kubernetes cluster. Each DVT container only validates the specific partition yaml (based on the index assigned by Kubernetes control plane). If the `-kc` option is used and you are not running in indexed mode, you will receive a warning and the container will process all the validations sequentially. If the `-kc` option is used and a config directory is not provided (a `--config-file` is provided instead), a warning is issued.
|
|
535
|
+
|
|
536
|
+
By default, each partition validation is retried up to 3 times if there is an error. In Kubernetes and Cloud Run, you can set the parallelism to the number you want. Keep in mind that if you are validating 1000's of partitions in parallel, you may find that setting the parallelism too high (say 100) may result in timeouts and slow down the validation.
|
|
495
537
|
|
|
496
538
|
### Validation Reports
|
|
497
539
|
|
|
@@ -648,7 +690,7 @@ significant figure.
|
|
|
648
690
|
|
|
649
691
|
Once a calculated field is defined, it can be referenced by other calculated
|
|
650
692
|
fields at any "depth" or higher. Depth controls how many subqueries are executed
|
|
651
|
-
in the resulting query. For example, with the following YAML config
|
|
693
|
+
in the resulting query. For example, with the following YAML config:
|
|
652
694
|
|
|
653
695
|
```yaml
|
|
654
696
|
- calculated_fields:
|
|
@@ -669,7 +711,7 @@ in the resulting query. For example, with the following YAML config...
|
|
|
669
711
|
depth: 1 # calculated one query above
|
|
670
712
|
```
|
|
671
713
|
|
|
672
|
-
is equivalent to the following SQL query
|
|
714
|
+
is equivalent to the following SQL query:
|
|
673
715
|
|
|
674
716
|
```sql
|
|
675
717
|
SELECT
|
|
@@ -53,8 +53,8 @@ setup steps needed to install and use the Data Validation Tool.
|
|
|
53
53
|
Before using this tool, you will need to create connections to the source and
|
|
54
54
|
target tables. Once the connections are created, you can run validations on
|
|
55
55
|
those tables. Validation results can be printed to stdout (default) or outputted
|
|
56
|
-
to BigQuery (recommended). DVT also allows you to save
|
|
57
|
-
configurations in a YAML file. This is useful for running common validations or
|
|
56
|
+
to BigQuery (recommended). DVT also allows you to save and edit validation
|
|
57
|
+
configurations in a YAML or JSON file. This is useful for running common validations or
|
|
58
58
|
updating the configuration.
|
|
59
59
|
|
|
60
60
|
### Managing Connections
|
|
@@ -73,6 +73,8 @@ Alternatives to running DVT in the CLI include deploying DVT to Cloud Run, Cloud
|
|
|
73
73
|
([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
|
|
74
74
|
to learn more about how DVT uses the CLI to generate SQL queries.
|
|
75
75
|
|
|
76
|
+
Note that we do not support nested or complex columns for column or row validations.
|
|
77
|
+
|
|
76
78
|
#### Column Validations
|
|
77
79
|
|
|
78
80
|
Below is the command syntax for column validations. To run a grouped column
|
|
@@ -98,15 +100,13 @@ data-validation (--verbose or -v) (--log-level or -ll) validate column
|
|
|
98
100
|
i.e 'bigquery-public-data.new_york_citibike.citibike_trips'
|
|
99
101
|
[--grouped-columns or -gc GROUPED_COLUMNS]
|
|
100
102
|
Comma separated list of columns for Group By i.e col_a,col_b
|
|
101
|
-
[--primary-keys or -pk PRIMARY_KEYS]
|
|
102
|
-
Comma separated list of columns to use as primary keys
|
|
103
|
-
(Note) Only use with grouped column validation. See *Primary Keys* section.
|
|
104
103
|
[--count COLUMNS] Comma separated list of columns for count or * for all columns
|
|
105
104
|
[--sum COLUMNS] Comma separated list of columns for sum or * for all numeric
|
|
106
105
|
[--min COLUMNS] Comma separated list of columns for min or * for all numeric
|
|
107
106
|
[--max COLUMNS] Comma separated list of columns for max or * for all numeric
|
|
108
107
|
[--avg COLUMNS] Comma separated list of columns for avg or * for all numeric
|
|
109
108
|
[--std COLUMNS] Comma separated list of columns for stddev_samp or * for all numeric
|
|
109
|
+
[--exclude-columns or -ec] Flag to indicate the list of columns provided should be excluded and not included.
|
|
110
110
|
[--bq-result-handler or -bqrh PROJECT_ID.DATASET.TABLE]
|
|
111
111
|
BigQuery destination for validation results. Defaults to stdout.
|
|
112
112
|
See: *Validation Reports* section
|
|
@@ -123,7 +123,10 @@ data-validation (--verbose or -v) (--log-level or -ll) validate column
|
|
|
123
123
|
If target filter is not provided, the source filter will run on source and target tables.
|
|
124
124
|
See: *Filters* section
|
|
125
125
|
[--config-file or -c CONFIG_FILE]
|
|
126
|
-
YAML Config File Path to be used for storing validations.
|
|
126
|
+
YAML Config File Path to be used for storing validations and other features.
|
|
127
|
+
See: *Running DVT with YAML Configuration Files* section
|
|
128
|
+
[--config-file-json or -cj CONFIG_FILE_JSON]
|
|
129
|
+
JSON Config File Path to be used for storing validations only for application purposes.
|
|
127
130
|
[--threshold or -th THRESHOLD]
|
|
128
131
|
Float value. Maximum pct_difference allowed for validation to be considered a success. Defaults to 0.0
|
|
129
132
|
[--labels or -l KEY1=VALUE1,KEY2=VALUE2]
|
|
@@ -134,8 +137,8 @@ data-validation (--verbose or -v) (--log-level or -ll) validate column
|
|
|
134
137
|
Comma separated list of statuses to filter the validation results. Supported statuses are (success, fail). If no list is provided, all statuses are returned.
|
|
135
138
|
```
|
|
136
139
|
|
|
137
|
-
The default aggregation type is a 'COUNT *'
|
|
138
|
-
|
|
140
|
+
The default aggregation type is a 'COUNT *', which will run in addition to the validations you specify. To remove this default,
|
|
141
|
+
use [YAML configs](https://github.com/GoogleCloudPlatform/professional-services-data-validator/tree/develop#running-dvt-with-yaml-configuration-files).
|
|
139
142
|
|
|
140
143
|
The [Examples](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/examples.md) page provides many examples of how a tool can be used to run powerful validations without writing any queries.
|
|
141
144
|
|
|
@@ -159,7 +162,7 @@ and finally hashing the row.
|
|
|
159
162
|
|
|
160
163
|
Under the hood, row validation uses
|
|
161
164
|
[Calculated Fields](https://github.com/GoogleCloudPlatform/professional-services-data-validator#calculated-fields) to
|
|
162
|
-
apply functions such as IFNULL() or RTRIM(). These can be edited in the YAML config to customize your row validation.
|
|
165
|
+
apply functions such as IFNULL() or RTRIM(). These can be edited in the YAML or JSON config file to customize your row validation.
|
|
163
166
|
|
|
164
167
|
```
|
|
165
168
|
data-validation (--verbose or -v) (--log-level or -ll) validate row
|
|
@@ -190,7 +193,10 @@ data-validation (--verbose or -v) (--log-level or -ll) validate row
|
|
|
190
193
|
If target filter is not provided, the source filter will run on source and target tables.
|
|
191
194
|
See: *Filters* section
|
|
192
195
|
[--config-file or -c CONFIG_FILE]
|
|
193
|
-
YAML Config File Path to be used for storing validations.
|
|
196
|
+
YAML Config File Path to be used for storing validations and other features.
|
|
197
|
+
See: *Running DVT with YAML Configuration Files* section
|
|
198
|
+
[--config-file-json or -cj CONFIG_FILE_JSON]
|
|
199
|
+
JSON Config File Path to be used for storing validations only for application purposes.
|
|
194
200
|
[--labels or -l KEY1=VALUE1,KEY2=VALUE2]
|
|
195
201
|
Comma-separated key value pair labels for the run.
|
|
196
202
|
[--format or -fmt] Format for stdout output. Supported formats are (text, csv, json, table).
|
|
@@ -267,7 +273,10 @@ data-validation (--verbose or -v) (--log-level or -ll) validate schema
|
|
|
267
273
|
[--service-account or -sa PATH_TO_SA_KEY]
|
|
268
274
|
Service account to use for BigQuery result handler output.
|
|
269
275
|
[--config-file or -c CONFIG_FILE]
|
|
270
|
-
YAML Config File Path to be used for storing validations.
|
|
276
|
+
YAML Config File Path to be used for storing validations and other features.
|
|
277
|
+
See: *Running DVT with YAML Configuration Files* section
|
|
278
|
+
[--config-file-json or -cj CONFIG_FILE_JSON]
|
|
279
|
+
JSON Config File Path to be used for storing validations only for application purposes.
|
|
271
280
|
[--format or -fmt] Format for stdout output. Supported formats are (text, csv, json, table).
|
|
272
281
|
Defaults to table.
|
|
273
282
|
[--filter-status or -fs STATUSES_LIST]
|
|
@@ -311,11 +320,17 @@ data-validation (--verbose or -v) (--log-level or -ll) validate custom-query col
|
|
|
311
320
|
[--max COLUMNS] Comma separated list of columns for max or * for all numeric
|
|
312
321
|
[--avg COLUMNS] Comma separated list of columns for avg or * for all numeric
|
|
313
322
|
[--std COLUMNS] Comma separated list of columns for stddev_samp or * for all numeric
|
|
323
|
+
[--exclude-columns or -ec] Flag to indicate the list of columns provided should be excluded and not included.
|
|
314
324
|
[--bq-result-handler or -bqrh PROJECT_ID.DATASET.TABLE]
|
|
315
325
|
BigQuery destination for validation results. Defaults to stdout.
|
|
316
326
|
See: *Validation Reports* section
|
|
317
327
|
[--service-account or -sa PATH_TO_SA_KEY]
|
|
318
328
|
Service account to use for BigQuery result handler output.
|
|
329
|
+
[--config-file or -c CONFIG_FILE]
|
|
330
|
+
YAML Config File Path to be used for storing validations and other features.
|
|
331
|
+
See: *Running DVT with YAML Configuration Files* section
|
|
332
|
+
[--config-file-json or -cj CONFIG_FILE_JSON]
|
|
333
|
+
JSON Config File Path to be used for storing validations only for application purposes.
|
|
319
334
|
[--labels or -l KEY1=VALUE1,KEY2=VALUE2]
|
|
320
335
|
Comma-separated key value pair labels for the run.
|
|
321
336
|
[--format or -fmt] Format for stdout output. Supported formats are (text, csv, json, table).
|
|
@@ -373,6 +388,11 @@ data-validation (--verbose or -v) (--log-level or -ll) validate custom-query row
|
|
|
373
388
|
See: *Validation Reports* section
|
|
374
389
|
[--service-account or -sa PATH_TO_SA_KEY]
|
|
375
390
|
Service account to use for BigQuery result handler output.
|
|
391
|
+
[--config-file or -c CONFIG_FILE]
|
|
392
|
+
YAML Config File Path to be used for storing validations and other features.
|
|
393
|
+
See: *Running DVT with YAML Configuration Files* section
|
|
394
|
+
[--config-file-json or -cj CONFIG_FILE_JSON]
|
|
395
|
+
JSON Config File Path to be used for storing validations only for application purposes.
|
|
376
396
|
[--labels or -l KEY1=VALUE1,KEY2=VALUE2]
|
|
377
397
|
Comma-separated key value pair labels for the run.
|
|
378
398
|
[--format or -fmt] Format for stdout output. Supported formats are (text, csv, json, table).
|
|
@@ -409,17 +429,19 @@ For example, this flag can be used as follows:
|
|
|
409
429
|
}
|
|
410
430
|
```
|
|
411
431
|
|
|
412
|
-
### YAML Configuration Files
|
|
432
|
+
### Running DVT with YAML Configuration Files
|
|
413
433
|
|
|
414
|
-
|
|
415
|
-
|
|
434
|
+
Running DVT with YAML configuration files is the recommended approach if:
|
|
435
|
+
* you want to customize the configuration for any given validation OR
|
|
436
|
+
* you want to run DVT at scale (i.e. row validations across many partitions)
|
|
437
|
+
Nearly every validation command can take the argument `-c <file-name>` (the `generate-table-partitions` command takes `-cdir <directory-name>`) where one or more yaml files are produced. These yaml files can be modified for custom validations.
|
|
416
438
|
|
|
417
|
-
|
|
439
|
+
The following command creates a YAML file for the validation of the
|
|
418
440
|
`new_york_citibike` table: `data-validation validate column -sc my_bq_conn -tc
|
|
419
441
|
my_bq_conn -tbls bigquery-public-data.new_york_citibike.citibike_trips -c
|
|
420
442
|
citibike.yaml`.
|
|
421
443
|
|
|
422
|
-
The
|
|
444
|
+
The validation config file is saved to the GCS path specified by the `PSO_DV_CONFIG_HOME`
|
|
423
445
|
env variable if that has been set; otherwise, it is saved to wherever the tool is run.
|
|
424
446
|
|
|
425
447
|
You can now edit the YAML file if, for example, the `new_york_citibike` table is
|
|
@@ -444,6 +466,26 @@ View the complete YAML file for a Grouped Column validation on the
|
|
|
444
466
|
[Examples](https://github.com/GoogleCloudPlatform/professional-services-data-validator/blob/develop/docs/examples.md#sample-yaml-config-grouped-column-validation) page.
|
|
445
467
|
|
|
446
468
|
You can view a list of all saved validation YAML files using `data-validation configs list`, and print a YAML config using `data-validation configs get -c citibike.yaml`.
|
|
469
|
+
#### Scaling DVT to run 10's to 1000's of validations concurrently
|
|
470
|
+
The above example `configs run -cdir` shows how you can run multiple validations with one command. If the directory used has been created by `generate-table-partitions`, you will have partition files numbered from `0000.yaml` to `<partno-1>.yaml`, where `<partno>` is the total number of partitions. These can be run as mentioned above and the partitions will be validated in order. This could take a long time if the number of partitions is large.
|
|
471
|
+
|
|
472
|
+
DVT validations can be run concurrently (horizontal scaling) using GKE (Kubernetes Jobs) or Cloud Run Jobs. In order to run DVT in a container, you have to build a docker image, [see instructions](https://github.com/GoogleCloudPlatform/professional-services-data-validator/tree/develop/samples/docker#readme). Set the `PSO_DV_CONFIG_HOME` environment variable to point to a GCS prefix where the connection configuration files are stored. In Cloud Run you can use the option `--set-env-vars` or `--update-env-vars` to pass [the environment variable](https://cloud.google.com/run/docs/configuring/services/environment-variables#setting). We recommend that you use the `bq-result-handler` to save your validation results. In order to validate partitions concurrently, run DVT in Kubernetes or Cloud Run as shown below:
|
|
473
|
+
```
|
|
474
|
+
data-validation (--verbose or -v) (--log-level or -ll) configs run
|
|
475
|
+
[--kube-completions or -kc] Specifies that validation is being run in Kubernetes or Cloud Run in indexed completion mode.
|
|
476
|
+
specifies to DVT that validation being run in indexed completion mode in Kubernetes or as multiple independent tasks in Cloud Run.
|
|
477
|
+
--config-dir or -cdir GCS_DIRECTORY
|
|
478
|
+
where GCS_DIRECTORY = CONFIG_DIR/SOURCE_SCHEMA.SOURCE_TABLE, where CONFIG_DIR, SOURCE_SCHEMA and SOURCE_TABLE are
|
|
479
|
+
the arguments provided to generate-table-partitions to generate the partition yamls. GCS_DIRECTORY is the directory
|
|
480
|
+
where the partition files numbered 0000.yaml to <partno-1>.yaml are stored.
|
|
481
|
+
```
|
|
482
|
+
If you are not familiar with Kubernetes or Cloud Run Jobs, review the [internal docs](docs/internal/kubernetes_jobs.md) for an overview of the orchestration of multiple validations.
|
|
483
|
+
|
|
484
|
+
The Cloud Run and Kubernetes pods must run in a network with access to the database servers. Every Cloud Run job is associated with a [service account](https://cloud.google.com/run/docs/securing/service-identity). You need to ensure that this service account has access to Google Cloud Storage (to read connection configuration and yaml files) and BigQuery (to publish results). If you are using Kubernetes, you will need to use a service account with the same privileges as mentioned for Cloud Run. In Kubernetes, you will need to set up [workload identity](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity) so the DVT container can impersonate the service account.
|
|
485
|
+
|
|
486
|
+
In Cloud Run, the [job](https://cloud.google.com/run/docs/create-jobs) must be run as multiple, independent tasks with the task count set to the number of partitions generated. In Kubernetes, set the number of completions to the number of partitions generated - see [Kubernetes Parallel Jobs](https://kubernetes.io/docs/concepts/workloads/controllers/job/#parallel-jobs). The option `--kube-completions or -kc` tells DVT that many DVT containers are running in a Kubernetes cluster. Each DVT container only validates the specific partition yaml (based on the index assigned by Kubernetes control plane). If the `-kc` option is used and you are not running in indexed mode, you will receive a warning and the container will process all the validations sequentially. If the `-kc` option is used and a config directory is not provided (a `--config-file` is provided instead), a warning is issued.
|
|
487
|
+
|
|
488
|
+
By default, each partition validation is retried up to 3 times if there is an error. In Kubernetes and Cloud Run, you can set the parallelism to the number you want. Keep in mind that if you are validating 1000's of partitions in parallel, you may find that setting the parallelism too high (say 100) may result in timeouts and slow down the validation.
|
|
447
489
|
|
|
448
490
|
### Validation Reports
|
|
449
491
|
|
|
@@ -600,7 +642,7 @@ significant figure.
|
|
|
600
642
|
|
|
601
643
|
Once a calculated field is defined, it can be referenced by other calculated
|
|
602
644
|
fields at any "depth" or higher. Depth controls how many subqueries are executed
|
|
603
|
-
in the resulting query. For example, with the following YAML config
|
|
645
|
+
in the resulting query. For example, with the following YAML config:
|
|
604
646
|
|
|
605
647
|
```yaml
|
|
606
648
|
- calculated_fields:
|
|
@@ -621,7 +663,7 @@ in the resulting query. For example, with the following YAML config...
|
|
|
621
663
|
depth: 1 # calculated one query above
|
|
622
664
|
```
|
|
623
665
|
|
|
624
|
-
is equivalent to the following SQL query
|
|
666
|
+
is equivalent to the following SQL query:
|
|
625
667
|
|
|
626
668
|
```sql
|
|
627
669
|
SELECT
|