Field
Field features are great for entity enrichments from one-to-one or many-to-one relations. It is commonly used to enrich an entity with simple, non aggregate fields from related assets or entities.
Main use cases
Add a field feature from a data asset with the same level of granularity as the entity (one-to-one relationship)
Add a field feature from a related entity with one-to-one relationship
Add a feature from a parent entity (many-to-one relationship)
Simple field feature
In this example, we define two simple field
features for the entity customer
:
type
type
The feature type.
In case of field features, it should be set to field
.
name
name
Give the field feature a name.
asset
asset
The data asset with the field to be added as feature to our entity.
asset
should be the full path: "db.schema.name".
join_name
[optional]
join_name
[optional]In case multiple join patterns are defined between an entity and a data asset, join_name
is used to determine which join path to use for a specific feature.
data_type
[optional]
data_type
[optional]Specify the feature data type.
If no data_type specified, Lynk will assume the data type is string
.
The options for data types are:
string
For any type of string data type
number
For any type of number data type. For example: integer, float, decimal etc..
bool
For boolean data type.
datetime
For any type of time-based data type. For example: date, timestamp, datetime etc..
field
field
The name of the field we would like to get from the related asset, in order to enrich our entity.
filters
filters
Understanding Field Features
In case we have a one-to-one relationship between a Data Asset and an Entity, and we need to enrich the entity with a field from the Data Asset - we can simply define which field to enrich the entity by.
To better understand how Field features work, look the following diagram;
The above diagram shows an example when a customer (entity) has one nation (data asset). That means, each customer
can be associated with only one row in db.schema.nations
.
In this case, we took the field nation_name
, and added it to the customer entity as a feature.
Last updated