I want to output column Address as null if that column is missing in input. In LAE, we do this by default emit (null) as Address
How do I do this in Data360?
Thank you so much.
You can use the todict() method on the built-in fields variable in a Transform node's ConfigureFields script to construct a dictionary representation of the input fields. You can then check to see whether the required fieldname is present as a key in the dictionary. If it is, the required field is present; if not, the field can be added to the output metadata.
If you don't assign a value to the output field it will have a value of Null, but you can explicitly assign a value of Null to the output if you want to do so for completeness.
One way to do this is with a Create Data node and a Cat node combination.
Use the Create Data node to define the required fields, but no need to have any actual records on the output.
The Cat is configured to union the fields on its two inputs. The first input comes from the Create Data node and contains the fields you must have or want to add to the data. The second input on the Cat node then combines those from the first with the fields that already exist on in data.