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.
- field1=value1_field2=value2
- {"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:
- Are there any official doc to state what are the possible formats?
- 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.