@Override
    public byte[] toBytes(SamzaSqlRelRecord p) {
      try {
        ObjectMapper mapper = new ObjectMapper();
        // Enable object typing to handle nested records
        mapper.enableDefaultTyping();
        return mapper.writeValueAsString(p).getBytes("UTF-8");
      } catch (Exception e) {
        throw new SamzaException(e);
      }
    }
A serializer for {@link SamzaSqlRelRecord}. This serializer preserves the type information as
{@link SamzaSqlRelRecord} and contains nested {@link SamzaSqlRelRecord}
records.
samza-sql/src/main/java/org/apache/samza/sql/serializers/SamzaSqlRelRecordSerdeFactory.java