Search code examples
scalagoogle-cloud-datastoregoogle-cloud-dataflow

Why isn't a Dataflow Datastore Query matching a literal string?


Update: "state" wasn't indexed :( I indexed that property and the query ran fine.

When running a Dataflow pipeline with the DirectPipelineRunner, my query doesn't match anything, although I can see the entities in Datastore. When I remove the filter, it finds the entities and runs.

This seems really straightforward. Why isn't the query matching any entities?

    val readyToGoFilter = DatastoreHelper.makeFilter("state",
      PropertyFilter.Operator.EQUAL,
      DatastoreHelper.makeValue("SUBMITTED"))

    val query = Query.newBuilder()
      .addKind(kind)
      .setFilter(readyToGoFilter)
      .build()

    val in = sc
      .withName("FindBatch")
      .datastore(projectId, query)

Solution

  • Arg, "state" wasn't indexed. I indexed that property, and it worked fine.