GoogleCloudPlatform / GoogleCloudPlatform/professional-services-data-validator

validate row: Impala cast of booleans differs from Hive behaviour

Open
#1,380 0 comments 0 reactions 0 assignees View on GitHub
priority: p3
Dominant language
Python
Stars
524
Forks
171
Avg merge
5d 15h
Merged PRs (30d)
4

Description

Both Impala and Hive have a boolean data type. During row validation we cast booleans to string but Impala outputs "1" or "0" from the casts, Hive outputs "true" or "false".

See below:

```
$ data-validation -v validate row -sc impala -tc hive --tables-list pso_data_validator.dvt_bool --concat="*" -pk=id
...
╒═══════════════════╤═══════════════════╤═════════════════════════════╤══════════════════════╤════════════════════╤═══════════════════════╤══════════════════╤═════════════════════╤══════════════════════════════════════╕
│ validation_name │ validation_type │ source_table_name │ source_column_name │ source_agg_value │ target_agg_value │ pct_difference │ validation_status │ run_id │
╞═══════════════════╪═══════════════════╪═════════════════════════════╪══════════════════════╪════════════════════╪═══════════════════════╪══════════════════╪═════════════════════╪══════════════════════════════════════╡
│ concat__all │ Row │ pso_data_validator.dvt_bool │ concat__all │ 11111 │ 1truetruetruetrue │ │ fail │ 9cb948bb-0ddf-4aba-a740-0c5460913a4d │
├───────────────────┼───────────────────┼─────────────────────────────┼──────────────────────┼────────────────────┼───────────────────────┼──────────────────┼─────────────────────┼──────────────────────────────────────┤
│ concat__all │ Row │ pso_data_validator.dvt_bool │ concat__all │ 20000 │ 2falsefalsefalsefalse │ │ fail │ 9cb948bb-0ddf-4aba-a740-0c5460913a4d │
╘═══════════════════╧═══════════════════╧═════════════════════════════╧══════════════════════╧════════════════════╧═══════════════════════╧══════════════════╧═════════════════════╧══════════════════════════════════════╛
```

Search for "issue-1380" in `test_impala.py` when working on this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.