Added use of BinaryEncoder to support UNION fields.