Set the first field to map to a specific field in the dataset
Set the second field to map to the same field
Expected: That the first would say "ignore this column" and the second would map to the same field
Actual: Null pointer exception. They both map to the same field.
Cause
Consumers of the ControlFileModel assume that the values in the columns array are
never null. The code that manages collisions (e.g. I select "vendor"
for two different columns) was violating this assumption, setting the previous
value to null. When this value was read later in the flow, we would get a null
pointer exception which would cause this to fail.
This commit also removes the dialog box which incorrectly prompted the user when
he or she had columns in the dataset which were not mapped, and they were trying to
do a replace. Now, we simply inform them that they don't have a mapping and block
until they set a mapping.
QA: Verified that I was able to set and reset various columns. Validated that I can still
update a dataset. Verified that the output of the control file was correct.
Repro
Expected: That the first would say "ignore this column" and the second would map to the same field
Actual: Null pointer exception. They both map to the same field.
Cause
Consumers of the ControlFileModel assume that the values in the columns array are never null. The code that manages collisions (e.g. I select "vendor" for two different columns) was violating this assumption, setting the previous value to null. When this value was read later in the flow, we would get a null pointer exception which would cause this to fail.
This commit also removes the dialog box which incorrectly prompted the user when he or she had columns in the dataset which were not mapped, and they were trying to do a replace. Now, we simply inform them that they don't have a mapping and block until they set a mapping.
QA: Verified that I was able to set and reset various columns. Validated that I can still update a dataset. Verified that the output of the control file was correct.
Reviewed-by: TBD