docs: public static Object valueFromString(String str, Type type)
      {
          if (str == null || str.isEmpty()) {
              return null;
          }
          else if (Types.isArrayType(type)) {
              Type elementType = Types.getElementType(type);
              ImmutableList.Builder<Object> listBuilder = ImmutableList.builder();
              for (String element : Splitter.on(',').split(str)) {
                  listBuilder.add(valueFromString(element, elementType));
              }
              return AccumuloRowSerializer.getBlockFromArray(elementType, listBuilder.build());
          }
          else if (Types.isMapType(type)) {
              Type keyType = Types.getKeyType(type);
              Type valueType = Types.getValueType(type);
              ImmutableMap.Builder<Object, Object> mapBuilder = ImmutableMap.builder();
              for (String element : Splitter.on(',').split(str)) {
                  ImmutableList.Builder<String> builder = ImmutableList.builder();
                  List<String> keyValue = builder.addAll(Splitter.on("->").split(element)).build();
                  checkArgument(keyValue.size() == 2, format("Map element %s has %d entries, not 2", element, keyValue.size()));
  
                  mapBuilder.put(valueFromString(keyValue.get(0), keyType), valueFromString(keyValue.get(1), valueType));
              }
              return AccumuloRowSerializer.getBlockFromMap(type, mapBuilder.build());
          }
          else if (type.equals(BIGINT)) {
              return Long.parseLong(str);
          }
          else if (type.equals(BOOLEAN)) {
              return Boolean.parseBoolean(str);
          }
          else if (type.equals(DATE)) {
              return new Date(DATE_PARSER.parseDateTime(str).getMillis());
          }
          else if (type.equals(DOUBLE)) {
              return Double.parseDouble(str);
          }
          else if (type.equals(INTEGER)) {
              return Integer.parseInt(str);
          }
          else if (type.equals(REAL)) {
              return Float.parseFloat(str);
          }
          else if (type.equals(SMALLINT)) {
              return Short.parseShort(str);
          }
          else if (type.equals(TIME)) {
              return new Time(TIME_PARSER.parseDateTime(str).getMillis());
          }
          else if (type.equals(TIMESTAMP)) {
              return new Timestamp(TIMESTAMP_PARSER.parseDateTime(str).getMillis());
          }
          else if (type.equals(TINYINT)) {
              return Byte.valueOf(str);
          }
          else if (type.equals(VARBINARY)) {
              return str.getBytes(UTF_8);
          }
          else if (type instanceof VarcharType) {
              return str;
          }
          else {
              throw new PrestoException(NOT_SUPPORTED, "Unsupported type " + type);
          }
      }