[Refactor](opt) Opt rf and remove unless code (#30900)
Opt rf and remove unless code
This commit is contained in:
@ -108,8 +108,6 @@ public final class RuntimeFilter {
|
||||
|
||||
private boolean bitmapFilterNotIn = false;
|
||||
|
||||
private boolean useRemoteRfOpt = true;
|
||||
|
||||
private TMinMaxRuntimeFilterType tMinMaxRuntimeFilterType;
|
||||
|
||||
private boolean bloomFilterSizeCalculatedByNdv = false;
|
||||
@ -207,17 +205,6 @@ public final class RuntimeFilter {
|
||||
this.bitmapFilterNotIn = bitmapFilterNotIn;
|
||||
}
|
||||
|
||||
public void computeUseRemoteRfOpt() {
|
||||
for (RuntimeFilterTarget target : targets) {
|
||||
useRemoteRfOpt = useRemoteRfOpt && hasRemoteTargets && runtimeFilterType == TRuntimeFilterType.BLOOM
|
||||
&& target.expr instanceof SlotRef;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getUseRemoteRfOpt() {
|
||||
return useRemoteRfOpt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Serializes a runtime filter to Thrift.
|
||||
*/
|
||||
@ -229,12 +216,8 @@ public final class RuntimeFilter {
|
||||
tFilter.setIsBroadcastJoin(isBroadcastJoin);
|
||||
tFilter.setHasLocalTargets(hasLocalTargets);
|
||||
tFilter.setHasRemoteTargets(hasRemoteTargets);
|
||||
boolean optRemoteRf = true;
|
||||
for (RuntimeFilterTarget target : targets) {
|
||||
tFilter.putToPlanIdToTargetExpr(target.node.getId().asInt(), target.expr.treeToThrift());
|
||||
// TODO: now only support SlotRef
|
||||
optRemoteRf = optRemoteRf && hasRemoteTargets && runtimeFilterType == TRuntimeFilterType.BLOOM
|
||||
&& target.expr instanceof SlotRef;
|
||||
}
|
||||
tFilter.setType(runtimeFilterType);
|
||||
tFilter.setBloomFilterSizeBytes(filterSizeBytes);
|
||||
@ -245,7 +228,7 @@ public final class RuntimeFilter {
|
||||
if (runtimeFilterType.equals(TRuntimeFilterType.MIN_MAX)) {
|
||||
tFilter.setMinMaxType(tMinMaxRuntimeFilterType);
|
||||
}
|
||||
tFilter.setOptRemoteRf(optRemoteRf);
|
||||
tFilter.setOptRemoteRf(hasRemoteTargets);
|
||||
tFilter.setBloomFilterSizeCalculatedByNdv(bloomFilterSizeCalculatedByNdv);
|
||||
return tFilter;
|
||||
}
|
||||
|
||||
@ -3676,8 +3676,7 @@ public class Coordinator implements CoordInterface {
|
||||
continue;
|
||||
}
|
||||
List<FRuntimeFilterTargetParam> fParams = ridToTargetParam.get(rf.getFilterId());
|
||||
rf.computeUseRemoteRfOpt();
|
||||
if (rf.getUseRemoteRfOpt()) {
|
||||
if (rf.hasRemoteTargets()) {
|
||||
Map<TNetworkAddress, TRuntimeFilterTargetParamsV2> targetParamsV2 = new HashMap<>();
|
||||
for (FRuntimeFilterTargetParam targetParam : fParams) {
|
||||
if (targetParamsV2.containsKey(targetParam.targetFragmentInstanceAddr)) {
|
||||
@ -3810,8 +3809,7 @@ public class Coordinator implements CoordInterface {
|
||||
continue;
|
||||
}
|
||||
List<FRuntimeFilterTargetParam> fParams = ridToTargetParam.get(rf.getFilterId());
|
||||
rf.computeUseRemoteRfOpt();
|
||||
if (rf.getUseRemoteRfOpt()) {
|
||||
if (rf.hasRemoteTargets()) {
|
||||
Map<TNetworkAddress, TRuntimeFilterTargetParamsV2> targetParamsV2 = new HashMap<>();
|
||||
for (FRuntimeFilterTargetParam targetParam : fParams) {
|
||||
if (targetParamsV2.containsKey(targetParam.targetFragmentInstanceAddr)) {
|
||||
|
||||
Reference in New Issue
Block a user