Nulltf
Descriptionâ
set default value for null field
tip
This transform only supported by engine Spark.
Optionsâ
name | type | required | default value |
---|---|---|---|
fields | array | no | - |
fields [list]â
A list of fields whose default value will be set. The default value of the field can be set in the form of "field:value", If no set, the default value will be set according to the field type.
Examplesâ
the configuration
nulltf {
fields {
name: "",
price: 0,
num: 100,
flag: false,
dt_timestamp: "2022-05-18 13:51:40.603",
dt_date: "2022-05-19"
}
}
before use nulltf transform
+-----+-----+----+-----+--------------------+----------+
| name|price| num| flag| dt_timestamp| dt_date|
+-----+-----+----+-----+--------------------+----------+
|åį§°1| 22.5| 100|false|2022-05-20 14:34:...|2022-05-20|
| null| 22.5| 100|false|2022-05-20 14:35:...|2022-05-20|
|åį§°1| null| 100|false|2022-05-20 14:35:...|2022-05-20|
|åį§°1| 22.5|null|false|2022-05-20 14:36:...|2022-05-20|
|åį§°1| 22.5| 100| null|2022-05-20 14:36:...|2022-05-20|
|åį§°1| 22.5| 100|false| null|2022-05-20|
|åį§°1| 22.5| 100|false|2022-05-20 14:37:...| null|
+-----+-----+----+-----+--------------------+----------+
after use nulltf transform
+-----+-----+----+-----+--------------------+----------+
| name|price| num| flag| dt_timestamp| dt_date|
+-----+-----+----+-----+--------------------+----------+
|åį§°1| 22.5|100|false|2022-05-20 14:34:...|2022-05-20|
| | 22.5|100|false|2022-05-20 14:35:...|2022-05-20|
|åį§°1| 0.0|100|false|2022-05-20 14:35:...|2022-05-20|
|åį§°1| 22.5|100|false|2022-05-20 14:36:...|2022-05-20|
|åį§°1| 22.5|100|false|2022-05-20 14:36:...|2022-05-20|
|åį§°1| 22.5|100|false|2022-05-18 13:51:...|2022-05-20|
|åį§°1| 22.5|100|false|2022-05-20 14:37:...|2022-05-19|
+-----+-----+---+-----+--------------------+----------+