[feature](vec) Support update stmt in vec query engine (#8296)

This commit is contained in:
HappenLee
2022-03-07 14:03:55 +08:00
committed by GitHub
parent 3b159a9820
commit 477b87cb28
5 changed files with 12 additions and 2 deletions

View File

@ -30,6 +30,7 @@ import org.apache.doris.catalog.OlapTable;
import org.apache.doris.common.AnalysisException;
import org.apache.doris.common.IdGenerator;
import org.apache.doris.common.UserException;
import org.apache.doris.common.util.VectorizedUtil;
import org.apache.doris.planner.DataPartition;
import org.apache.doris.planner.OlapScanNode;
import org.apache.doris.planner.OlapTableSink;
@ -86,6 +87,9 @@ public class UpdatePlanner extends Planner {
/* END */
olapScanNode.init(analyzer);
olapScanNode.finalize(analyzer);
if (VectorizedUtil.isVectorized()) {
olapScanNode.convertToVectoriezd();
}
scanNodeList.add(olapScanNode);
// 2. gen olap table sink
OlapTableSink olapTableSink = new OlapTableSink(targetTable, computeTargetTupleDesc(), null);

View File

@ -34,6 +34,7 @@ import org.apache.doris.common.QuotaExceedException;
import org.apache.doris.common.UserException;
import org.apache.doris.common.util.DebugUtil;
import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.common.util.VectorizedUtil;
import org.apache.doris.metric.MetricRepo;
import org.apache.doris.qe.Coordinator;
import org.apache.doris.qe.QeProcessorImpl;
@ -141,6 +142,7 @@ public class UpdateStmtExecutor {
coordinator = new Coordinator(Catalog.getCurrentCatalog().getNextId(), queryId, analyzer.getDescTbl(),
updatePlanner.getFragments(), updatePlanner.getScanNodes(), TimeUtils.DEFAULT_TIME_ZONE, false);
coordinator.setQueryType(TQueryType.LOAD);
coordinator.setExecVecEngine(VectorizedUtil.isVectorized());
QeProcessorImpl.INSTANCE.registerQuery(queryId, coordinator);
analyzer.getContext().getExecutor().setCoord(coordinator);

View File

@ -669,7 +669,7 @@ public class HashJoinNode extends PlanNode {
}
@Override
void convertToVectoriezd() {
public void convertToVectoriezd() {
if (!otherJoinConjuncts.isEmpty()) {
votherJoinConjunct = convertConjunctsToAndCompoundPredicate(otherJoinConjuncts);
initCompoundPredicate(votherJoinConjunct);

View File

@ -860,7 +860,7 @@ abstract public class PlanNode extends TreeNode<PlanNode> {
return sb.toString();
}
void convertToVectoriezd() {
public void convertToVectoriezd() {
if (!conjuncts.isEmpty()) {
vconjunct = convertConjunctsToAndCompoundPredicate(conjuncts);
initCompoundPredicate(vconjunct);

View File

@ -301,6 +301,10 @@ public class Coordinator {
this.queryOptions.setQueryType(type);
}
public void setExecVecEngine(boolean vec) {
this.queryOptions.setEnableVectorizedEngine(vec);
}
public Status getExecStatus() {
return queryStatus;
}