Import entities from a CSV
Create many entities of one type at once from a CSV file. The import only adds: a name that already exists is skipped, never overwritten. It runs in the background and ends with a report of what it created and what it skipped.
You need the glossary:edit permission.
Where to find it
The Import CSV button shows beside the create button (New term on the Business terms page) in three places:
| Place | Types you can pick |
|---|---|
| Governance → Business terms | Business terms and business categories |
| The Entities tab of a catalog's page (Governance → Catalogs, open a catalog) | Types you made in DataDios (not business terms or categories) |
| The general entity table (the Catalog tab on the Lineage page, and My catalog on Governance → Catalogs) | Types you made in DataDios, plus business terms and categories |
On the entity tables, you can pick the types in the table above. A type that a data source writes (a table, a column) cannot be imported. A field that is read-only, written by a scan, admin-only, holds a person or a JSON value, or refers to no type or to several types, cannot come from a CSV; the field is not offered.
Import in the app
- Click Import CSV, choose the type (Import as) and the
.csvfile. - Click Next: map columns.
- Map columns. Each CSV column is matched to a field, or set to Skip. DataDios guesses from the header names. Name and any required field of the type that has no default must be mapped; until they are, Import stays off and says which column to map. A field takes one column.
- Click Import. A progress bar shows the rows done. You can close the window; the import keeps running. The list reloads when it finishes (if you closed the window, reload it yourself).
There is no review of each row. The server creates what it can and reports the rest at the end.
The CSV format
- The first row is the header. Each later row makes one entity. Blank lines are ignored, but they count in the row numbers of the report.
- A header name appears once only. If two columns share a name, rename one.
- Each mapped column goes to the field you choose. The field is the attribute's name, so a business
term's definition is
glossary_definition. - A field that holds several values takes them in one cell, separated by
;, not by commas. A comma stays part of the value. - A field that refers to another entity takes that entity's name, not its guid. The referenced entity must already exist and the field must allow one type only.
- A business term's
glossary_categoryis the category's name. A category inside another category is found by its name too (unlike the curation API, which wants the guid). If several share the name, the one with exactly that spelling wins, then a top-level one, then the oldest. A category in another catalog is never found. A name that is not found goes under a category called General, and the report says so.
Example, importing business terms:
name,definition,synonyms,category
Net revenue,Revenue after returns and discounts,Net sales;Revenue (net),Finance
Churn,Share of customers lost in a period,Attrition,Sales
Mapping: name → Name, definition → glossary_definition, synonyms →
glossary_synonyms, category → glossary_category.
Catalog scope
Rows are made outside any catalog unless a catalog is named. Imported from a catalog's own page, they are made in that catalog. Imported from the general table or from the Business terms page, they are made outside any catalog, whatever Catalog filter is on. A name is skipped only if it already exists in the same place: the same catalog, or, outside any catalog, among the rows outside any catalog. Names compare without case. A reference name is looked up in the catalog first, then outside it.
The result report
The job ends with Created N · Skipped M. Each skipped row falls under one reason:
| Reason | Meaning |
|---|---|
missing_name | The name cell is empty |
duplicate_in_file | The name appeared earlier in the file |
already_exists | An entity of that type already has the name in the same place (see Catalog scope) |
invalid_value | A value is wrong for its field, the name is too long, or a required field has no value and no default |
unknown_reference | A reference names no entity that exists |
general_category_failed | The General category could not be made |
catalog_unavailable | The catalog was deleted while the import ran |
Each reason lists the count and the first 50 rows, by row number and name. If a server fault stops the job midway, it fails, and the rows already made stay.
Limits
- At most 25,000 rows in a file, else
413 request_too_large. - At most 25 MB in a file, else
413 request_too_large. Split a bigger file. The 8 MB limit on the other entity pages is for JSON bodies; a CSV upload has its own, larger limit. - One type per file.
Import through the API
POST /entities/bulk-create-jobs, multipart form:
| Field | |
|---|---|
file | The CSV |
entity_type | The type's guid. business_term and business_category also work |
column_mapping | JSON {field: column header}. name is required. A required field with no default that you leave unmapped makes each row skip as invalid_value (the app stops this earlier) |
catalog_id | Optional. The guid of the catalog to make the rows in, 1 to 64 characters, else 400 |
curl -X POST "$BASE/entities/bulk-create-jobs" \
-H "Authorization: Bearer $TOKEN" \
-F "file=@terms.csv" \
-F "entity_type=business_term" \
-F 'column_mapping={"name":"name","glossary_definition":"definition","glossary_category":"category"}'
The call answers 202 with DATA.request_id. Poll POST /async_status_check with that
request_id and the job type entity_bulk_create. The status holds created, skipped_total,
skipped (per reason: count and sample), notes, and rows_done of rows_total.
A request is refused before the 202, with the cause in DATA.reason:
| Reason | Status | When |
|---|---|---|
invalid_request | 400 | The mapping has no name, names a field twice, names an unknown field or a column the file does not have; a mapped field holds a person or JSON; the type is one a data source writes; no entity_type, no file, a file that is not a CSV, bad JSON |
scan_only | 400 | A mapped field is written by a scan |
not_admin | 403 | The field is admin-only and you are not an admin |
ref_name_needs_one_type | 400 | A mapped reference field allows several types |
unknown_value_type | 400 | A mapped reference field allows no type |
| not found | 404 | The type guid or catalog_id does not exist |