v2/googlecloud-to-googlecloud/src/main/java/com/google/cloud/teleport/v2/utils/FirestoreConverters.java [606:629]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public PCollection<String> expand(PBegin begin) {
      return begin
          .apply(
              "ReadFromDatastore",
              DatastoreIO.v1()
                  .read()
                  .withProjectId(projectId())
                  .withLiteralGqlQuery(gqlQuery())
                  .withNamespace(namespace()))
          .apply("ParseEntitySchema", ParDo.of(new EntityToSchemaJson()))
          .apply("CountUniqueSchemas", Count.<String>perElement())
          .apply(
              "Jsonify",
              ParDo.of(
                  new DoFn<KV<String, Long>, String>() {
                    @ProcessElement
                    public void processElement(ProcessContext c) {
                      JsonObject out = new JsonObject();
                      out.addProperty("schema", c.element().getKey());
                      out.addProperty("count", c.element().getValue());
                      c.output(out.toString());
                    }
                  }));
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



v1/src/main/java/com/google/cloud/teleport/templates/common/DatastoreConverters.java [589:612]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    public PCollection<String> expand(PBegin begin) {
      return begin
          .apply(
              "ReadFromDatastore",
              DatastoreIO.v1()
                  .read()
                  .withProjectId(projectId())
                  .withLiteralGqlQuery(gqlQuery())
                  .withNamespace(namespace()))
          .apply("ParseEntitySchema", ParDo.of(new EntityToSchemaJson()))
          .apply("CountUniqueSchemas", Count.<String>perElement())
          .apply(
              "Jsonify",
              ParDo.of(
                  new DoFn<KV<String, Long>, String>() {
                    @ProcessElement
                    public void processElement(ProcessContext c) {
                      JsonObject out = new JsonObject();
                      out.addProperty("schema", c.element().getKey());
                      out.addProperty("count", c.element().getValue());
                      c.output(out.toString());
                    }
                  }));
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



