What is/are the possible partitioner formats for an AWS MSK custom partitioner to S3?

28 Views Asked by At

I have a custom partitioner which implements io.confluent.connect.storage.partitioner.Partitioner

In the below override method, I saw something in the existing code.

public class TradeArchiveEntryPartitioner implements Partitioner {
...
    @Override
    public String encodePartition(SinkRecord sinkRecord) {
        return "field1" + "=" + sinkRecord.value().getString("field1") + "/" + "field2" + "=" + sinkRecord.value().getString("field2");
    }
...
}

, which creates partitions based on certain fields. And it looks good.

But after some searching and study, it looks like that the followings may also be accepted.

  1. field1=value1_field2=value2
  2. {"field1": "value1", "field2": "value2"}

The return value is just a string and I cannot find a doc to state what are the possible string formats it is accepting.

Hence, my questions are:

  1. Are there any official doc to state what are the possible formats?
  2. Is there any escape char? I mean let say if the value contains "=", how can I escape it or it is not supported?

Any help is highly appreciated.

0

There are 0 best solutions below