# Mapping Expressions on Read and on Write

> Source: https://docs.synthesized.io/tdk/latest/user_guide/020_guides/managing_data_properties/value_mapping
> For the complete documentation index, see [llms.txt](https://docs.synthesized.io/llms.txt).

Allows transforming columns as they are being read from the input database and written to the output database.

For example, a column might need a cast to a different type on read and then a cast back to the original type on write. The following configuration might be provided to address that:

```yaml
tables:
  - table_name_with_schema: "test_schema.test_table"
    mode: "MASKING"
    transformations:
      - columns: ["my_binary_column"]
        mapping:
          read: "cast(? as char)"
          write: "cast(? as binary)"
```

The `my_binary_column` will be cast to `char` type on read and the result of transformation will be cast back to `binary` type on write.
