Schema schema = transform.rowType.schema();
StoreAdapter adapter = store.createAdapter(session, schema);
context = new SimpleQueryContext(adapter);
QueryBindings bindings = context.createBindings();
if (doDelete) {
Row origOldRow = new RowDataRow(transform.rowType, oldRowData);
bindings.setRow(OperatorAssembler.CREATE_AS_BINDING_POSITION, origOldRow);
try {
runPlan(context, transform.deleteOperator, bindings);
} catch (NoSuchRowException e) {
LOG.debug("row not present: {}", origOldRow);
}
}
if (doWrite) {
Row origOldRow = new RowDataRow(transform.rowType, newRowData);
bindings.setRow(OperatorAssembler.CREATE_AS_BINDING_POSITION, origOldRow);
try {
runPlan(context, transform.insertOperator, bindings);
} catch (NoSuchRowException e) {
LOG.debug("row not present: {}", origOldRow);
}
}
break;
}
case GROUP:
Schema schema = transform.rowType.schema();
StoreAdapter adapter = store.createAdapter(session, schema);
context = new SimpleQueryContext(adapter);
QueryBindings bindings = context.createBindings();
if(doDelete) {
Row origOldRow = new RowDataRow(transform.rowType, oldRowData);
Row newOldRow = transformRow(context, bindings, transform, origOldRow);
try {
adapter.deleteRow(newOldRow, false);
} catch(NoSuchRowException e) {
LOG.debug("row not present: {}", newOldRow);
}
}
if(doWrite) {
Row origNewRow = new RowDataRow(transform.rowType, newRowData);
Row newNewRow = transformRow(context, bindings, transform, origNewRow);
adapter.writeRow(newNewRow, transform.tableIndexes, transform.groupIndexes);
}
break;
}