Merge branch 'main' into nosqlbench-1889-altnames

This commit is contained in:
Jonathan Shook 2024-07-26 16:58:16 -05:00
commit 6f91febc25
2 changed files with 17 additions and 6 deletions

View File

@ -69,9 +69,10 @@ public class CqlD4BatchStmtDispenser extends Cqld4BaseOpDispenser {
@NotNull
private LongFunction<Statement> getBatchAccumulator(LongFunction<BatchStatementBuilder> bsb, OpDispenser<? extends Cqld4CqlOp> subopDispenser) {
LongFunction<BatchStatementBuilder> f = l -> {
long base=l*repeat;
BatchStatementBuilder bsa = bsb.apply(l);
for (int i = 0; i < repeat; i++) {
Cqld4CqlOp op = subopDispenser.apply(i+l);
Cqld4CqlOp op = subopDispenser.apply(base+i);
BatchableStatement<?> stmt = (BatchableStatement<?>) op.getStmt();
bsa= bsa.addStatement(stmt);
}

View File

@ -142,12 +142,22 @@ ops:
raw: |
create table if not exist {ksname}.{tblname} ...
# batch statement
# In this case, the word 'testing' is just a place holder due to op template requirements
# Everything under op_template works exactly as it would at the level above it, except that
# op_template is special and activates the batch construction logic.
# All ops within the batch are automatically applied to a virtual cycle which includes the
# repeat value as a step function. For example, with 'repeat: 50',
# - for cycle 0, batch items will be generated as if for cycles 0..49,
# - for cycle 1, batch items will be generated as if for cycles 50..99
# in this way, batch templates are very similar to non-batch templates.
# NOTE: This format is not stable and may change for simplification
example-batch-stmt:
batch:
repeat: 50
op_template:
prepared: |
select three, four from knock.onthedoor where ...
batch: testing
repeat: 50
op_template:
prepared: |
insert into ks.table (key, value) values ({seq_key},{seq_value});
# gremlin statement using the fluent API, as it would be written in a client application
example-fluent-graph-stmt: