JingsongLi commented on code in PR #2512:
URL: https://github.com/apache/incubator-paimon/pull/2512#discussion_r1429385990
##########
paimon-common/src/main/java/org/apache/paimon/CoreOptions.java:
##########
@@ -459,7 +459,9 @@ public class CoreOptions implements Serializable {
text(
"3. \"millis-to-micro\":
Pads the sequence field that indicates time with precision of milli-second to
micro-second."),
text(
- "4. Composite pattern: for
example, \"second-to-micro,row-kind-flag\"."))
+ "4. \"inc-seq\": Pads the
sequence field with auto increase sequence."),
+ text(
+ "5. Composite pattern: for
example, \"second-to-micro,row-kind-flag\"."))
Review Comment:
`inc-seq, row-kind-flag` is supported? I think maybe this should be most
popular composite pattern
##########
paimon-core/src/main/java/org/apache/paimon/mergetree/MergeTreeWriter.java:
##########
@@ -89,14 +93,22 @@ public MergeTreeWriter(
boolean commitForceCompact,
ChangelogProducer changelogProducer,
@Nullable CommitIncrement increment,
- WriterMetrics writerMetrics) {
+ WriterMetrics writerMetrics,
+ boolean incSeqPadding) {
this.writeBufferSpillable = writeBufferSpillable;
this.sortMaxFan = sortMaxFan;
this.ioManager = ioManager;
this.keyType = writerFactory.keyType();
this.valueType = writerFactory.valueType();
this.compactManager = compactManager;
- this.newSequenceNumber = maxSequenceNumber + 1;
+ this.incSeqPadding = incSeqPadding;
+ if (maxSequenceNumber == -1) {
+ this.nextIncSequenceNumber = 0;
+ } else if (incSeqPadding) {
+ this.nextIncSequenceNumber = (maxSequenceNumber & INC_SEQ_MASK) +
INC;
Review Comment:
We should merge this into `SequenceGenerator`. There should be some refactor.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]