v2/googlecloud-to-googlecloud/src/main/java/com/google/cloud/teleport/v2/utils/FirestoreConverters.java [716:742]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private JsonArray arraySchema(ArrayValue arrayValue) {
      Set<JsonObject> entities = new HashSet<>();
      Set<String> primitives = new HashSet<>();
      Set<JsonArray> subArrays = new HashSet<>();

      arrayValue.getValuesList().stream()
          .forEach(
              value -> {
                switch (value.getValueTypeCase()) {
                  case ENTITY_VALUE:
                    entities.add(entitySchema(value.getEntityValue()));
                    break;
                  case ARRAY_VALUE:
                    subArrays.add(arraySchema(value.getArrayValue()));
                    break;
                  default:
                    primitives.add(value.getValueTypeCase().toString());
                    break;
                }
              });

      JsonArray jsonArray = new JsonArray();
      entities.stream().forEach(jsonArray::add);
      primitives.stream().forEach(jsonArray::add);
      subArrays.stream().forEach(jsonArray::add);
      return jsonArray;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



v1/src/main/java/com/google/cloud/teleport/templates/common/DatastoreConverters.java [699:725]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    private JsonArray arraySchema(ArrayValue arrayValue) {
      Set<JsonObject> entities = new HashSet<>();
      Set<String> primitives = new HashSet<>();
      Set<JsonArray> subArrays = new HashSet<>();

      arrayValue.getValuesList().stream()
          .forEach(
              value -> {
                switch (value.getValueTypeCase()) {
                  case ENTITY_VALUE:
                    entities.add(entitySchema(value.getEntityValue()));
                    break;
                  case ARRAY_VALUE:
                    subArrays.add(arraySchema(value.getArrayValue()));
                    break;
                  default:
                    primitives.add(value.getValueTypeCase().toString());
                    break;
                }
              });

      JsonArray jsonArray = new JsonArray();
      entities.stream().forEach(jsonArray::add);
      primitives.stream().forEach(jsonArray::add);
      subArrays.stream().forEach(jsonArray::add);
      return jsonArray;
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



