Code review comment: Currently there is no `single_replica_load` option in nereids. This PR is for fixing a problem. If there is a need, we can create a new PR for that feature.

Code before review:
private DataSink createDataSink() throws AnalysisException {
if (dataSink != null) {
return dataSink;
}
if (targetTable instanceof OlapTable) {
OlapTableSink sink;
final boolean enableSingleReplicaLoad =
analyzer.getContext().getSessionVariable().isEnableMemtableOnSinkNode()
? false : analyzer.getContext().getSessionVariable().isEnableSingleReplicaInsert();
if (isGroupCommitStreamLoadSql) {
sink = new GroupCommitBlockSink((OlapTable) targetTable, olapTuple,
targetPartitionIds, enableSingleReplicaLoad,
ConnectContext.get().getSessionVariable().getGroupCommit(), 0);
} else {
sink = new OlapTableSink((OlapTable) targetTable, olapTuple, targetPartitionIds,
enableSingleReplicaLoad);
}
dataSink = sink;
sink.setPartialUpdateInputColumns(isPartialUpdate, partialUpdateCols);
dataPartition = dataSink.getOutputPartition();
} else if (targetTable instanceof BrokerTable) {
BrokerTable table = (BrokerTable) targetTable;
BrokerDesc brokerDesc = new BrokerDesc(table.getBrokerName(), table.getBrokerProperties());
dataSink = new ExportSink(
table.getWritablePath(),
table.getColumnSeparator(),
table.getLineDelimiter(),
brokerDesc);
dataPartition = dataSink.getOutputPartition();
} else if (targetTable instanceof JdbcTable) {
List<String> insertCols = new ArrayList<>();
Set<String> targetColumnNames = targetColumns.stream()
.map(Column::getName)
.collect(Collectors.toSet());
for (Column column : targetTable.getFullSchema()) {
if (targetColumnNames.contains(column.getName())) {
insertCols.add(column.getName());
}
}
dataSink = new JdbcTableSink((JdbcTable) targetTable, insertCols);
dataPartition = DataPartition.UNPARTITIONED;
} else {
dataSink = DataSink.createDataSink(targetTable);
dataPartition = DataPartition.UNPARTITIONED;
}
return dataSink;
}

Line under review: enableSingleReplicaLoad);

Code after addressing the review:
private DataSink createDataSink() throws AnalysisException {
if (dataSink != null) {
return dataSink;
}
if (targetTable instanceof OlapTable) {
OlapTableSink sink;
final boolean enableSingleReplicaLoad =
analyzer.getContext().getSessionVariable().isEnableMemtableOnSinkNode()
? false : analyzer.getContext().getSessionVariable().isEnableSingleReplicaInsert();
if (isGroupCommitStreamLoadSql) {
sink = new GroupCommitBlockSink((OlapTable) targetTable, olapTuple,
targetPartitionIds, enableSingleReplicaLoad,
ConnectContext.get().getSessionVariable().getGroupCommit(), 0);
} else {
sink = new OlapTableSink((OlapTable) targetTable, olapTuple, targetPartitionIds,
enableSingleReplicaLoad);
}
dataSink = sink;
sink.setPartialUpdateInputColumns(isPartialUpdate, partialUpdateCols);
dataPartition = dataSink.getOutputPartition();
} else if (targetTable instanceof BrokerTable) {
BrokerTable table = (BrokerTable) targetTable;
BrokerDesc brokerDesc = new BrokerDesc(table.getBrokerName(), table.getBrokerProperties());
dataSink = new ExportSink(
table.getWritablePath(),
table.getColumnSeparator(),
table.getLineDelimiter(),
brokerDesc);
dataPartition = dataSink.getOutputPartition();
} else if (targetTable instanceof JdbcTable) {
List<String> insertCols = new ArrayList<>();
Set<String> targetColumnNames = targetColumns.stream()
.map(Column::getName)
.collect(Collectors.toSet());
for (Column column : targetTable.getFullSchema()) {
if (targetColumnNames.contains(column.getName())) {
insertCols.add(column.getName());
}
}
dataSink = new JdbcTableSink((JdbcTable) targetTable, insertCols);
dataPartition = DataPartition.UNPARTITIONED;
} else {
dataSink = DataSink.createDataSink(targetTable);
dataPartition = DataPartition.UNPARTITIONED;
}
return dataSink;
}