[fix](external)using saved member variables for 2.1 (#46156) (#46400)

bp: #46156
This commit is contained in:
wuwenchi
2025-01-04 09:01:14 +08:00
committed by GitHub
parent db224ba15f
commit 8b45258ae6
3 changed files with 6 additions and 8 deletions

View File

@ -337,7 +337,7 @@ public abstract class FileQueryScanNode extends FileScanNode {
FileSplit fileSplit = (FileSplit) splitAssignment.getSampleSplit();
TFileType locationType = fileSplit.getLocationType();
totalFileSize = fileSplit.getLength() * selectedSplitNum;
long maxWaitTime = ConnectContext.get().getSessionVariable().getFetchSplitsMaxWaitTime();
long maxWaitTime = sessionVariable.getFetchSplitsMaxWaitTime();
// Not accurate, only used to estimate concurrency.
// Here, we must take the max of 1, because
// in the case of multiple BEs, `numApproximateSplits() / backendPolicy.numBackends()` may be 0,
@ -560,10 +560,9 @@ public abstract class FileQueryScanNode extends FileScanNode {
@Override
public int getNumInstances() {
if (ConnectContext.get() != null
&& ConnectContext.get().getSessionVariable().getEnablePipelineXEngine()
&& ConnectContext.get().getSessionVariable().isIgnoreStorageDataDistribution()) {
return ConnectContext.get().getSessionVariable().getParallelExecInstanceNum();
if (sessionVariable.getEnablePipelineXEngine()
&& sessionVariable.isIgnoreStorageDataDistribution()) {
return sessionVariable.getParallelExecInstanceNum();
}
return scanRangeLocations.size();
}

View File

@ -254,7 +254,7 @@ public class HiveScanNode extends FileQueryScanNode {
}
partitionInit = true;
}
int numPartitions = ConnectContext.get().getSessionVariable().getNumPartitionsInBatchMode();
int numPartitions = sessionVariable.getNumPartitionsInBatchMode();
return numPartitions >= 0 && prunedPartitions.size() >= numPartitions;
}

View File

@ -38,7 +38,6 @@ import org.apache.doris.datasource.hive.HivePartition;
import org.apache.doris.datasource.hive.source.HiveScanNode;
import org.apache.doris.datasource.hudi.HudiSchemaCacheValue;
import org.apache.doris.planner.PlanNodeId;
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.qe.SessionVariable;
import org.apache.doris.spi.Split;
import org.apache.doris.statistics.StatisticalType;
@ -448,7 +447,7 @@ public class HudiScanNode extends HiveScanNode {
}
partitionInit = true;
}
int numPartitions = ConnectContext.get().getSessionVariable().getNumPartitionsInBatchMode();
int numPartitions = sessionVariable.getNumPartitionsInBatchMode();
return numPartitions >= 0 && prunedPartitions.size() >= numPartitions;
}