Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: aopHi!
What could be the best way to emit a field only in case it exists in input data?
Currently I have (however this doesn't work if Field2 is not present):
emit Field1, Field2
Field1 is mandatory, Field2 is not present in all data sets I'm going to run the project for. I'm not going to combine data sets of these two types in a same project but rather to create one standard BRE project template I could use every time for certain type of analysis regardless of existence of Field2 in the data. Due to the template approach I do not want to change the code (=remove "emit Field2" from the statement manually if it doesn't exist).
I just figured I could use the following to be able to run a node succesfully even if Field2 is not present in the data:
emit Field 1
emit wildcard "Field2"
I think this basically does what I'm looking for, however, I'd just like to know whether there's some better way to build this type of emit statement?