honor review

pull/15008/head
Alberto Romeu 5 years ago
parent 8c1381d408
commit 1c0d934726

@ -1,17 +1,18 @@
## Column names normalization
When importing data with the Import API the resulting dataset in CARTO might have different column names than the original dataset.
When data is uploaded into CARTO using the Import API, the resulting dataset in CARTO might have different column names than the original dataset.
This is because as part of the import workflow there's a process to normalize the column names to avoid having unsupported column names. Some of the actions taken when normalizing column names are:
This is because as part of the import workflow there's a process to normalize the column names to avoid unsupported column names in the datasets created after the import process finishes. Some of the actions taken when normalizing column names are:
- Remove accents
- Remove multiple underscores and hyphens
- Convert multiple consecutive underscores and hyphens to a single underscore
- Remove unsupported characters ([]{}&%$+, etc.)
- Remove white spaces
- Avoid duplicated column names
- Avoid column names longer than 63 characters
- Avoid reserved words
- Force lower case names
- Force column names to start by a character
### Some examples of column name normalization
@ -35,9 +36,9 @@ Find below a table with some examples of column names and how they are normalize
### Changing column names
In some cases you may want to preserve some of the column names in your original data. For example, let's say you have a column name `nucleos__1` which indeed is a valid column name for PostgreSQL and the Import API renamed it as `nucleos_1`. In the case you want to preserve `nucleos__1` as the column name, right after the import process finished you can update the column name using the [CARTO SQL API](https://carto.com/developers/sql-api/) with a query like this:
In some cases you may want to preserve some of the column names in your original data. For example, let's say you have a column name `column__1` which indeed is a valid column name for PostgreSQL and the Import API renamed it as `column_1`. In the case you want to preserve `column__1` as the column name, right after the import process finished you can update the column name using the [CARTO SQL API](https://carto.com/developers/sql-api/) with a query like this:
```sql
ALTER TABLE test_1 RENAME COLUMN nucleos_1 to nucleos__1;
ALTER TABLE test_1 RENAME COLUMN column_1 to column__1;
SELECT CDB_TableMetadataTouch('test_1');
```

Loading…
Cancel
Save