> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/app/generation/generators/generator-reference/valid-address.md).

# Valid Address

Generates real address components from a selected country. The country is either selected specifically or read from another column in the same record.

Currently supports addresses in the United States, Brazil, and Mexico.

* Brazilian addresses are derived from the [Cadastro Nacional de Endereços para Fins Estatísticos (CNEFE), Censo Demográfico 2022](https://ftp.ibge.gov.br/Cadastro_Nacional_de_Enderecos_para_Fins_Estatisticos/Censo_Demografico_2022/), which is published by the Instituto Brasileiro de Geografia e Estatística (IBGE). Municipality and state names are from the IBGE localities service.
* United States streets, house number ranges, counties, and street geometry are derived from the [U.S. Census Bureau's 2025 TIGER/Line Shapefiles](https://www2.census.gov/geo/tiger/TIGER2025/).

All of the address components are real values. This is different from the [Address](/app/generation/generators/generator-reference/address.md) generator, where street values are always generated and do not represent real streets.

## Characteristics

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Consistency</strong></td><td valign="top">Yes, can be made self-consistent or consistent with another column.</td></tr><tr><td valign="top"><strong>Linking</strong></td><td valign="top">Yes, can be linked.</td></tr><tr><td valign="top"><strong>Differential privacy</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Data-free</strong></td><td valign="top">No.</td></tr><tr><td valign="top"><strong>Allowed for primary keys</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Allowed for unique columns</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Uses format-preserving encryption (FPE)</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Privacy ranking</strong></td><td valign="top"><ul><li>3 if not consistent</li><li>4 if consistent</li></ul></td></tr><tr><td valign="top"><strong>Generator ID (for the API)</strong></td><td valign="top">​<code>ValidAddressGenerator</code></td></tr></tbody></table>

## How to configure

### Linking columns

From the **Link To** dropdown list, select the columns to link this column to. When the columns are linked, Structural ensures that all linked columns contain values that belong to the same address. Columns that are not linked do not contain values from the same address.

Note that when you link columns, all of the columns use the same country. If you change the country configuration in one linked column, it is automatically updated in all of the other linked columns.

### Identifying the country where the address is located <a href="#address-country" id="address-country"></a>

To identify the country where the address is located, you can either:

* Name a specific country
* Identify another column in the same table that contains the country. The column must contain either the English name of the country, the ISO alpha-2 or alpha-3 code, or the local name (Brasil, México).

#### Selecting a specific country <a href="#country-specific" id="country-specific"></a>

To identify the country where the address is located, one option is to select a specific country.

To select a specific country:

1. Click **Fixed**.
2. From the **Country** dropdown, select the country.

#### Reading the country from another column <a href="#country-column" id="country-column"></a>

Another option is to identify another column in the same table that contains the country. The column must contain either the English name of the country, the ISO alpha-2 or alpha-3 code, or the local name (Brasil, México). It cannot be a linked column.

To get the country from another column:

1. Click **From column**.
2. From the **Column** dropdown, select the column to use.

If the selected column has an assigned generator, then Structural reads the country value after the generator is applied. If the Valid Address generator is consistent, then to ensure that consistency, the country column generator must either always produce the same value (for example, use the Constant generator), or must also be consistent.

If the selected column does not contain a valid name or identifier of a supported country, then Structural applies the fallback generator to all of the linked columns.

### Identifying the address component <a href="#address-component" id="address-component"></a>

From the **Address Component** dropdown list, select the component that the column contains.

If you selected a specific country for the addresses, then the available components are specific to that country, and use the address component terms that are used in that country.

If the country is read from a column, then the available address components are:

* **Street address -** The full street address
* **Street name -** The street name only, without the identifying type. For example, for `Main St.`, the street name value is `Main`.
* **Street type -** The street type. For example, `St.`, `Ave`, `Rd.`, `AVENIDA`, `RUA`, `Calle`.\
  \
  When the street does not have a specific type (for example, Broadway), or includes an additional designation (for example, 25th Ave NW), then the street name column contains the entire street name.
* **Building number -** The street number for the address.
* **Secondary address -** Any additional address information, such as an apartment or suite number. If a row contains multiple secondary address columns, each column is given a different value.\
  \
  Also, unlike other components:
  * This is not necessarily a real value for the address.
  * If the value in the source column is empty, then it remains empty in the destination.
* **Neighborhood -** The neighborhood within the city. The value is empty for addresses in the United States.
* **City -** The city.
* **County -** The county where the address is located. The value is empty for Brazilian addresses.
* **State -** The name of the state where the address is located.
* **State abbreviation -** The abbreviation of the state.
* **Postal code -** The postal code for the address. For numeric columns, any hyphens and leading zeroes are dropped.
* **Latitude -** The latitude at which the address is located.\
  \
  For both latitude and longitude, the precision is 6 decimal places.
  * For the United States, coordinates are on the center line of the street.
  * For Brazil, the coordinates are the household coordinates.
  * For Mexico, the coordinates are the point or building that is mapped in OpenStreetMap.
* **Longitude -** The longitude at which the address is located.
* **Full address -** The complete address, in the standard format for the selected country.

### Selecting the fallback generator <a href="#fallback-generator" id="fallback-generator"></a>

{% hint style="info" %}
In Databricks and Spark SDK workspaces, you cannot select a fallback generator. Rows for which there is not a valid country value always use the Null option.
{% endhint %}

When you configure the generator to use a column value for the country, but that column does not contain a valid country value, then Structural uses the fallback generator setting to determine what to do with the linked column values.

The default value is **Null**, which indicates to replace all of the linked source values with null values.

The other options are:

* **Constant** - Indicates to apply the Constant generator. When you select this option, Structural displays a field to provide the constant value to use. You specify a constant value in the configuration for each linked column.
* **Fail on error** - Indicates to fail the data generation.

### Setting the type of consistency <a href="#consistency-type" id="consistency-type"></a>

If consistency is enabled, then by default, the generator is self-consistent.

To make the generator consistent with another column, from the **Consistent to** dropdown list, select the column.

When the Valid Address generator is consistent with itself, then:

* For a non-linked column, the same value in the source database is always mapped to the same destination value. For example, for a column that contains a state name, `Alabama` might always be mapped to `Illinois`.
* For linked columns, the same collection of source values is always mapped to the same collection of destination values. For example, for linked columns that contain city, state, and postal code, then every row that contains the values `Boston`, `Massachusetts`, `02103` might always be mapped to `Chicago`, `Illinois`, `60076`.

When the Valid Address generator is consistent with another column, then the same value in the other column always results in the same destination value for the address column. This includes source rows that contain null source values. For example, if the address column is consistent with a name column, then every instance of John Smith in the name column in the source database results in the same address value in the destination database.

### Setting case sensitivity for consistency <a href="#consistency-case-sensitivity" id="consistency-case-sensitivity"></a>

When consistency is enabled, use the **Case-sensitive** toggle to indicate whether the consistency is case-sensitive.

By default, consistency is case-sensitive.

* For a non-linked column, the comparison is for the individual column value. For example, the values `Anytown` and `ANYTOWN` are considered different values. `Anytown` might always be replaced with `Chicago`, and `ANYTOWN` might be replaced with `Atlanta`.
* For linked columns, the comparison is across all of the column values. For example, for linked columns that contain city, state, and postal code, a row that contains `Boston`, `Massachusetts`, `02103` does not match a row that contains `BOSTON`, `Massachusetts`, `02103`. The rows would not be replaced with the same set of values.

To make the consistency case-insensitive, toggle **Case-sensitive** to the off position. When the consistency is case-insensitive, then:

* For a non-linked column, `Anytown` and `ANYTOWN` are considered the same value and have the same replacement.
* For linked columns, `Boston`, `Massachusetts`, `02103` and `BOSTON`, `Massachusetts`, `02103` are considered the same address and are replaced with the same set of values.

### Enabling Structural data encryption <a href="#data-encryption" id="data-encryption"></a>

If [Structural data encryption](/app/generation/generators-assign-config/generators-data-encryption-config.md) is enabled, then to use it for this column, in the advanced options section, toggle **Use data encryption process** to the on position.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tonic.ai/app/generation/generators/generator-reference/valid-address.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
