3

I have an avro schema named CompositeKey with fields of <userId: int, attribute: string>. Another avro schema named SimpleValue.

Using Kafka Streams, I put them into a KeyValueStore using Avro serializer/deserializers.

myKeyValueStore.put(myCompositeKey, mySimpleValue);

Later on, using interactive queries I can get userId, attribute pairs one by one. But I'd like to also get all attributes belonging to a single userId. When I use,

store.range(
    new CompositeKey(userID, lowestPossibleAttribute), 
    new CompositeKey(userID, highestPossibleAttribute))

it does not return all attributes. I guess that is caused because underlying RocksDB sorts them like byte arrays and avro serialization format messes with that.

Is there a way to do this partial range query using Avro in RocksDB? Otherwise I will have to store them with generated strings from Avro schema in the format of "<userId>+<attribute>".

yolgun
  • 196
  • 3
  • 14
  • You cross-posted your question to Confluent's mailing list (FYI other readers: Confluent is the main vendor for all things Apache Kafka), and you have already received first feedback: https://groups.google.com/d/msg/confluent-platform/QQ5TMJzjx20/ZmW3TVfBBwAJ – miguno Jan 16 '17 at 08:53

0 Answers0