!126 Add session control for heuristic index

Merge pull request !126 from Han_Weng/add-indexer-session-control
This commit is contained in:
i-robot 2020-08-20 08:36:39 +08:00 committed by Gitee
commit 7e4e39b1ea
13 changed files with 62 additions and 20 deletions

View File

@ -11,7 +11,8 @@ For example, `<path to installtion directory>/bin/index` and must be executed fr
Usage: index [-v] [--debug] [--disableLocking] --table=<table> Usage: index [-v] [--debug] [--disableLocking] --table=<table>
[-c=<configDirPath>] [--column=<columns>[,<columns>...]]... [-c=<configDirPath>] [--column=<columns>[,<columns>...]]...
[--partition=<partitions>[,<partitions>...]]... [--partition=<partitions>[,<partitions>...]]...
[--type=<indexTypes>[,<indexTypes>...]]... <command> [--type=<indexTypes>[,<indexTypes>...]]...
[-I=<indexproperties>[,<indexproperties>...]]<command>
Using this index tool, you can CREATE, SHOW and DELETE indexes. Using this index tool, you can CREATE, SHOW and DELETE indexes.

View File

@ -9,8 +9,8 @@
使用方法index [-v] [--debug] [--disableLocking] --table=<table> 使用方法index [-v] [--debug] [--disableLocking] --table=<table>
[-c=<configDirPath>] [--column=<columns>[,<columns>...]]... [-c=<configDirPath>] [--column=<columns>[,<columns>...]]...
[--partition=<partitions>[,<partitions>...]]... [--partition=<partitions>[,<partitions>...]]...
[--type=<indexTypes>[,<indexTypes>...]]...[-p=<plugins>[, [--type=<indexTypes>[,<indexTypes>...]]...
<plugins>...]]...<command> [-I=<indexproperties>[,<indexproperties>...]]<command>
使用此索引工具,您可以创建、显示和删除索引。 使用此索引工具,您可以创建、显示和删除索引。

View File

@ -127,7 +127,7 @@ public class HivePageSourceProvider
new HdfsEnvironment.HdfsContext(session, hiveSplit.getDatabase(), hiveSplit.getTable()), path); new HdfsEnvironment.HdfsContext(session, hiveSplit.getDatabase(), hiveSplit.getTable()), path);
List<IndexMetadata> indexes = null; List<IndexMetadata> indexes = null;
if (indexCache != null) { if (indexCache != null && session.isHeuristicIndexFilterEnabled()) {
indexes = indexCache.getIndices( indexes = indexCache.getIndices(
session.getCatalog().orElse(null), session.getCatalog().orElse(null),
hiveTable.getSchemaTableName().toString(), hiveSplit, hiveTable.getCompactEffectivePredicate(), hiveTable.getSchemaTableName().toString(), hiveSplit, hiveTable.getCompactEffectivePredicate(),

View File

@ -167,4 +167,10 @@ public class FullConnectorSession
{ {
return SystemSessionProperties.getDynamicFilteringWaitTime(session); return SystemSessionProperties.getDynamicFilteringWaitTime(session);
} }
@Override
public boolean isHeuristicIndexFilterEnabled()
{
return SystemSessionProperties.isHeuristicIndexFilterEnabled(session);
}
} }

View File

@ -26,6 +26,7 @@ import io.prestosql.sql.analyzer.FeaturesConfig.DynamicFilterDataType;
import io.prestosql.sql.analyzer.FeaturesConfig.JoinDistributionType; import io.prestosql.sql.analyzer.FeaturesConfig.JoinDistributionType;
import io.prestosql.sql.analyzer.FeaturesConfig.JoinReorderingStrategy; import io.prestosql.sql.analyzer.FeaturesConfig.JoinReorderingStrategy;
import io.prestosql.sql.analyzer.FeaturesConfig.RedistributeWritesType; import io.prestosql.sql.analyzer.FeaturesConfig.RedistributeWritesType;
import io.prestosql.utils.HetuConfig;
import javax.inject.Inject; import javax.inject.Inject;
@ -141,12 +142,13 @@ public final class SystemSessionProperties
public static final String DYNAMIC_FILTERING_BLOOM_FILTER_FPP = "dynamic_filtering_bloom_filter_fpp"; public static final String DYNAMIC_FILTERING_BLOOM_FILTER_FPP = "dynamic_filtering_bloom_filter_fpp";
public static final String ENABLE_EXECUTION_PLAN_CACHE = "enable_execution_plan_cache"; public static final String ENABLE_EXECUTION_PLAN_CACHE = "enable_execution_plan_cache";
public static final String ENABLE_CROSS_REGION_DYNAMIC_FILTER = "cross-region-dynamic-filter-enabled"; public static final String ENABLE_CROSS_REGION_DYNAMIC_FILTER = "cross-region-dynamic-filter-enabled";
public static final String ENABLE_HEURISTICINDEX_FILTER = "heuristicindex_filter_enabled";
private final List<PropertyMetadata<?>> sessionProperties; private final List<PropertyMetadata<?>> sessionProperties;
public SystemSessionProperties() public SystemSessionProperties()
{ {
this(new QueryManagerConfig(), new TaskManagerConfig(), new MemoryManagerConfig(), new FeaturesConfig()); this(new QueryManagerConfig(), new TaskManagerConfig(), new MemoryManagerConfig(), new FeaturesConfig(), new HetuConfig());
} }
@Inject @Inject
@ -154,7 +156,8 @@ public final class SystemSessionProperties
QueryManagerConfig queryManagerConfig, QueryManagerConfig queryManagerConfig,
TaskManagerConfig taskManagerConfig, TaskManagerConfig taskManagerConfig,
MemoryManagerConfig memoryManagerConfig, MemoryManagerConfig memoryManagerConfig,
FeaturesConfig featuresConfig) FeaturesConfig featuresConfig,
HetuConfig hetuConfig)
{ {
sessionProperties = ImmutableList.of( sessionProperties = ImmutableList.of(
stringProperty( stringProperty(
@ -635,6 +638,11 @@ public final class SystemSessionProperties
ENABLE_EXECUTION_PLAN_CACHE, ENABLE_EXECUTION_PLAN_CACHE,
"Enable execution plan caching", "Enable execution plan caching",
featuresConfig.isEnableExecutionPlanCache(), featuresConfig.isEnableExecutionPlanCache(),
false),
booleanProperty(
ENABLE_HEURISTICINDEX_FILTER,
"Enable heuristic index filter",
hetuConfig.isFilterEnabled(),
false)); false));
} }
@ -1123,4 +1131,9 @@ public final class SystemSessionProperties
{ {
return session.getSystemProperty(ENABLE_EXECUTION_PLAN_CACHE, Boolean.class); return session.getSystemProperty(ENABLE_EXECUTION_PLAN_CACHE, Boolean.class);
} }
public static boolean isHeuristicIndexFilterEnabled(Session session)
{
return session.getSystemProperty(ENABLE_HEURISTICINDEX_FILTER, Boolean.class);
}
} }

View File

@ -18,6 +18,7 @@ import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Streams; import com.google.common.collect.Streams;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
import io.airlift.log.Logger; import io.airlift.log.Logger;
import io.prestosql.Session;
import io.prestosql.execution.Lifespan; import io.prestosql.execution.Lifespan;
import io.prestosql.execution.RemoteTask; import io.prestosql.execution.RemoteTask;
import io.prestosql.execution.SqlStageExecution; import io.prestosql.execution.SqlStageExecution;
@ -75,6 +76,7 @@ public class FixedSourcePartitionedScheduler
OptionalInt concurrentLifespansPerTask, OptionalInt concurrentLifespansPerTask,
NodeSelector nodeSelector, NodeSelector nodeSelector,
List<ConnectorPartitionHandle> partitionHandles, List<ConnectorPartitionHandle> partitionHandles,
Session session,
HeuristicIndexerManager heuristicIndexerManager) HeuristicIndexerManager heuristicIndexerManager)
{ {
requireNonNull(stage, "stage is null"); requireNonNull(stage, "stage is null");
@ -109,6 +111,7 @@ public class FixedSourcePartitionedScheduler
for (PlanNodeId planNodeId : schedulingOrder) { for (PlanNodeId planNodeId : schedulingOrder) {
SplitSource splitSource = splitSources.get(planNodeId); SplitSource splitSource = splitSources.get(planNodeId);
boolean groupedExecutionForScanNode = stageExecutionDescriptor.isScanGroupedExecution(planNodeId); boolean groupedExecutionForScanNode = stageExecutionDescriptor.isScanGroupedExecution(planNodeId);
SourceScheduler sourceScheduler = newSourcePartitionedSchedulerAsSourceScheduler( SourceScheduler sourceScheduler = newSourcePartitionedSchedulerAsSourceScheduler(
stage, stage,
planNodeId, planNodeId,
@ -116,6 +119,7 @@ public class FixedSourcePartitionedScheduler
splitPlacementPolicy, splitPlacementPolicy,
Math.max(splitBatchSize / concurrentLifespans, 1), Math.max(splitBatchSize / concurrentLifespans, 1),
groupedExecutionForScanNode, groupedExecutionForScanNode,
session,
heuristicIndexerManager); heuristicIndexerManager);
if (stageExecutionDescriptor.isStageGroupedExecution() && !groupedExecutionForScanNode) { if (stageExecutionDescriptor.isStageGroupedExecution() && !groupedExecutionForScanNode) {

View File

@ -20,6 +20,7 @@ import com.google.common.collect.Multimap;
import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.Futures;
import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.SettableFuture; import com.google.common.util.concurrent.SettableFuture;
import io.prestosql.Session;
import io.prestosql.execution.Lifespan; import io.prestosql.execution.Lifespan;
import io.prestosql.execution.RemoteTask; import io.prestosql.execution.RemoteTask;
import io.prestosql.execution.SqlStageExecution; import io.prestosql.execution.SqlStageExecution;
@ -27,9 +28,7 @@ import io.prestosql.execution.scheduler.FixedSourcePartitionedScheduler.Bucketed
import io.prestosql.heuristicindex.HeuristicIndexerManager; import io.prestosql.heuristicindex.HeuristicIndexerManager;
import io.prestosql.metadata.InternalNode; import io.prestosql.metadata.InternalNode;
import io.prestosql.metadata.Split; import io.prestosql.metadata.Split;
import io.prestosql.spi.HetuConstant;
import io.prestosql.spi.connector.ConnectorPartitionHandle; import io.prestosql.spi.connector.ConnectorPartitionHandle;
import io.prestosql.spi.service.PropertyService;
import io.prestosql.split.EmptySplit; import io.prestosql.split.EmptySplit;
import io.prestosql.split.SplitSource; import io.prestosql.split.SplitSource;
import io.prestosql.split.SplitSource.SplitBatch; import io.prestosql.split.SplitSource.SplitBatch;
@ -54,6 +53,7 @@ import static com.google.common.util.concurrent.Futures.nonCancellationPropagati
import static io.airlift.concurrent.MoreFutures.addSuccessCallback; import static io.airlift.concurrent.MoreFutures.addSuccessCallback;
import static io.airlift.concurrent.MoreFutures.getFutureValue; import static io.airlift.concurrent.MoreFutures.getFutureValue;
import static io.airlift.concurrent.MoreFutures.whenAnyComplete; import static io.airlift.concurrent.MoreFutures.whenAnyComplete;
import static io.prestosql.SystemSessionProperties.isHeuristicIndexFilterEnabled;
import static io.prestosql.execution.scheduler.ScheduleResult.BlockedReason.MIXED_SPLIT_QUEUES_FULL_AND_WAITING_FOR_SOURCE; import static io.prestosql.execution.scheduler.ScheduleResult.BlockedReason.MIXED_SPLIT_QUEUES_FULL_AND_WAITING_FOR_SOURCE;
import static io.prestosql.execution.scheduler.ScheduleResult.BlockedReason.NO_ACTIVE_DRIVER_GROUP; import static io.prestosql.execution.scheduler.ScheduleResult.BlockedReason.NO_ACTIVE_DRIVER_GROUP;
import static io.prestosql.execution.scheduler.ScheduleResult.BlockedReason.SPLIT_QUEUES_FULL; import static io.prestosql.execution.scheduler.ScheduleResult.BlockedReason.SPLIT_QUEUES_FULL;
@ -95,6 +95,7 @@ public class SourcePartitionedScheduler
private final int splitBatchSize; private final int splitBatchSize;
private final PlanNodeId partitionedNode; private final PlanNodeId partitionedNode;
private final boolean groupedExecution; private final boolean groupedExecution;
private final Session session;
private final HeuristicIndexerManager heuristicIndexerManager; private final HeuristicIndexerManager heuristicIndexerManager;
private final Map<Lifespan, ScheduleGroup> scheduleGroups = new HashMap<>(); private final Map<Lifespan, ScheduleGroup> scheduleGroups = new HashMap<>();
@ -110,12 +111,14 @@ public class SourcePartitionedScheduler
SplitPlacementPolicy splitPlacementPolicy, SplitPlacementPolicy splitPlacementPolicy,
int splitBatchSize, int splitBatchSize,
boolean groupedExecution, boolean groupedExecution,
Session session,
HeuristicIndexerManager heuristicIndexerManager) HeuristicIndexerManager heuristicIndexerManager)
{ {
this.stage = requireNonNull(stage, "stage is null"); this.stage = requireNonNull(stage, "stage is null");
this.partitionedNode = requireNonNull(partitionedNode, "partitionedNode is null"); this.partitionedNode = requireNonNull(partitionedNode, "partitionedNode is null");
this.splitSource = requireNonNull(splitSource, "splitSource is null"); this.splitSource = requireNonNull(splitSource, "splitSource is null");
this.splitPlacementPolicy = requireNonNull(splitPlacementPolicy, "splitPlacementPolicy is null"); this.splitPlacementPolicy = requireNonNull(splitPlacementPolicy, "splitPlacementPolicy is null");
this.session = requireNonNull(session, "session is null");
this.heuristicIndexerManager = requireNonNull(heuristicIndexerManager, "heuristicIndexerManager is null"); this.heuristicIndexerManager = requireNonNull(heuristicIndexerManager, "heuristicIndexerManager is null");
checkArgument(splitBatchSize > 0, "splitBatchSize must be at least one"); checkArgument(splitBatchSize > 0, "splitBatchSize must be at least one");
@ -141,10 +144,11 @@ public class SourcePartitionedScheduler
SplitSource splitSource, SplitSource splitSource,
SplitPlacementPolicy splitPlacementPolicy, SplitPlacementPolicy splitPlacementPolicy,
int splitBatchSize, int splitBatchSize,
Session session,
HeuristicIndexerManager heuristicIndexerManager) HeuristicIndexerManager heuristicIndexerManager)
{ {
SourcePartitionedScheduler sourcePartitionedScheduler = new SourcePartitionedScheduler(stage, partitionedNode, splitSource, SourcePartitionedScheduler sourcePartitionedScheduler = new SourcePartitionedScheduler(stage, partitionedNode, splitSource,
splitPlacementPolicy, splitBatchSize, false, heuristicIndexerManager); splitPlacementPolicy, splitBatchSize, false, session, heuristicIndexerManager);
sourcePartitionedScheduler.startLifespan(Lifespan.taskWide(), NOT_PARTITIONED); sourcePartitionedScheduler.startLifespan(Lifespan.taskWide(), NOT_PARTITIONED);
sourcePartitionedScheduler.noMoreLifespans(); sourcePartitionedScheduler.noMoreLifespans();
@ -184,10 +188,11 @@ public class SourcePartitionedScheduler
SplitPlacementPolicy splitPlacementPolicy, SplitPlacementPolicy splitPlacementPolicy,
int splitBatchSize, int splitBatchSize,
boolean groupedExecution, boolean groupedExecution,
Session session,
HeuristicIndexerManager heuristicIndexerManager) HeuristicIndexerManager heuristicIndexerManager)
{ {
return new SourcePartitionedScheduler(stage, partitionedNode, splitSource, splitPlacementPolicy, return new SourcePartitionedScheduler(stage, partitionedNode, splitSource, splitPlacementPolicy,
splitBatchSize, groupedExecution, heuristicIndexerManager); splitBatchSize, groupedExecution, session, heuristicIndexerManager);
} }
@Override @Override
@ -219,12 +224,11 @@ public class SourcePartitionedScheduler
int overallSplitAssignmentCount = 0; int overallSplitAssignmentCount = 0;
ImmutableSet.Builder<RemoteTask> overallNewTasks = ImmutableSet.builder(); ImmutableSet.Builder<RemoteTask> overallNewTasks = ImmutableSet.builder();
List<ListenableFuture<?>> overallBlockedFutures = new ArrayList<>(); List<ListenableFuture<?>> overallBlockedFutures = new ArrayList<>();
boolean anyBlockedOnPlacements = false; boolean anyBlockedOnPlacements = false;
boolean anyBlockedOnNextSplitBatch = false; boolean anyBlockedOnNextSplitBatch = false;
boolean anyNotBlocked = false; boolean anyNotBlocked = false;
boolean applyFilter = isHeuristicIndexFilterEnabled(session) && PredicateExtractor.isSplitFilterApplicable(stage);
boolean applyFilter = PropertyService.getBooleanProperty(HetuConstant.FILTER_ENABLED)
&& PredicateExtractor.isSplitFilterApplicable(stage);
for (Entry<Lifespan, ScheduleGroup> entry : scheduleGroups.entrySet()) { for (Entry<Lifespan, ScheduleGroup> entry : scheduleGroups.entrySet()) {
Lifespan lifespan = entry.getKey(); Lifespan lifespan = entry.getKey();
@ -247,7 +251,7 @@ public class SourcePartitionedScheduler
SplitBatch nextSplits = getFutureValue(scheduleGroup.nextSplitBatchFuture); SplitBatch nextSplits = getFutureValue(scheduleGroup.nextSplitBatchFuture);
scheduleGroup.nextSplitBatchFuture = null; scheduleGroup.nextSplitBatchFuture = null;
//add split filter to filter out split has no valid rows // add split filter to filter out splits that do not contain valid rows
List<Split> filteredSplit = applyFilter ? SplitUtils.getFilteredSplit(PredicateExtractor.getExpression(stage), List<Split> filteredSplit = applyFilter ? SplitUtils.getFilteredSplit(PredicateExtractor.getExpression(stage),
PredicateExtractor.getFullyQualifiedName(stage), nextSplits, heuristicIndexerManager) : nextSplits.getSplits(); PredicateExtractor.getFullyQualifiedName(stage), nextSplits, heuristicIndexerManager) : nextSplits.getSplits();

View File

@ -342,8 +342,10 @@ public class SqlQueryScheduler
SplitPlacementPolicy placementPolicy = new DynamicSplitPlacementPolicy(nodeSelector, stage::getAllTasks); SplitPlacementPolicy placementPolicy = new DynamicSplitPlacementPolicy(nodeSelector, stage::getAllTasks);
checkArgument(!plan.getFragment().getStageExecutionDescriptor().isStageGroupedExecution()); checkArgument(!plan.getFragment().getStageExecutionDescriptor().isStageGroupedExecution());
stageSchedulers.put(stageId, newSourcePartitionedSchedulerAsStageScheduler(stage, planNodeId, splitSource, stageSchedulers.put(stageId, newSourcePartitionedSchedulerAsStageScheduler(stage, planNodeId, splitSource,
placementPolicy, splitBatchSize, heuristicIndexerManager)); placementPolicy, splitBatchSize, session, heuristicIndexerManager));
bucketToPartition = Optional.of(new int[1]); bucketToPartition = Optional.of(new int[1]);
} }
else if (partitioningHandle.equals(SCALED_WRITER_DISTRIBUTION)) { else if (partitioningHandle.equals(SCALED_WRITER_DISTRIBUTION)) {
@ -404,6 +406,7 @@ public class SqlQueryScheduler
getConcurrentLifespansPerNode(session), getConcurrentLifespansPerNode(session),
nodeScheduler.createNodeSelector(catalogName), nodeScheduler.createNodeSelector(catalogName),
connectorPartitionHandles, connectorPartitionHandles,
session,
heuristicIndexerManager)); heuristicIndexerManager));
} }
else { else {

View File

@ -83,8 +83,8 @@ public final class SessionPropertyManager
public SessionPropertyManager(List<PropertyMetadata<?>> systemSessionProperties, HetuConfig hetuConfig) public SessionPropertyManager(List<PropertyMetadata<?>> systemSessionProperties, HetuConfig hetuConfig)
{ {
SessionPropertyManager.hetuConfig = hetuConfig; SessionPropertyManager.hetuConfig = hetuConfig;
this.addSystemSessionProperties(systemSessionProperties);
this.loadConfigToService(hetuConfig); this.loadConfigToService(hetuConfig);
this.addSystemSessionProperties(systemSessionProperties);
} }
public void addSystemSessionProperties(List<PropertyMetadata<?>> systemSessionProperties) public void addSystemSessionProperties(List<PropertyMetadata<?>> systemSessionProperties)

View File

@ -317,7 +317,8 @@ public class LocalQueryRunner
this.metadata = new MetadataManager( this.metadata = new MetadataManager(
featuresConfig, featuresConfig,
new SessionPropertyManager(new SystemSessionProperties(new QueryManagerConfig(), taskManagerConfig, new MemoryManagerConfig(), featuresConfig)), // new HetuConfig object passed, if split filtering is needed in the runner, a modified HetuConfig object with filter settings manually set must be used.
new SessionPropertyManager(new SystemSessionProperties(new QueryManagerConfig(), taskManagerConfig, new MemoryManagerConfig(), featuresConfig, new HetuConfig())),
new SchemaPropertyManager(), new SchemaPropertyManager(),
new TablePropertyManager(), new TablePropertyManager(),
new ColumnPropertyManager(), new ColumnPropertyManager(),

View File

@ -17,6 +17,7 @@ import com.google.common.base.Supplier;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables; import com.google.common.collect.Iterables;
import io.prestosql.Session;
import io.prestosql.client.NodeVersion; import io.prestosql.client.NodeVersion;
import io.prestosql.connector.CatalogName; import io.prestosql.connector.CatalogName;
import io.prestosql.cost.StatsAndCosts; import io.prestosql.cost.StatsAndCosts;
@ -89,6 +90,7 @@ import static io.prestosql.sql.planner.SystemPartitioningHandle.SOURCE_DISTRIBUT
import static io.prestosql.sql.planner.plan.ExchangeNode.Type.GATHER; import static io.prestosql.sql.planner.plan.ExchangeNode.Type.GATHER;
import static io.prestosql.sql.planner.plan.JoinNode.Type.INNER; import static io.prestosql.sql.planner.plan.JoinNode.Type.INNER;
import static io.prestosql.testing.TestingHandles.TEST_TABLE_HANDLE; import static io.prestosql.testing.TestingHandles.TEST_TABLE_HANDLE;
import static io.prestosql.testing.TestingSession.testSessionBuilder;
import static io.prestosql.testing.assertions.PrestoExceptionAssert.assertPrestoExceptionThrownBy; import static io.prestosql.testing.assertions.PrestoExceptionAssert.assertPrestoExceptionThrownBy;
import static java.lang.Integer.min; import static java.lang.Integer.min;
import static java.util.Objects.requireNonNull; import static java.util.Objects.requireNonNull;
@ -108,6 +110,7 @@ public class TestSourcePartitionedScheduler
private final LocationFactory locationFactory = new MockLocationFactory(); private final LocationFactory locationFactory = new MockLocationFactory();
private final InMemoryNodeManager nodeManager = new InMemoryNodeManager(); private final InMemoryNodeManager nodeManager = new InMemoryNodeManager();
private final FinalizerService finalizerService = new FinalizerService(); private final FinalizerService finalizerService = new FinalizerService();
private static final Session session = testSessionBuilder().build();
SeedStoreManager seedStoreManager = new SeedStoreManager(new FileSystemClientManager()); SeedStoreManager seedStoreManager = new SeedStoreManager(new FileSystemClientManager());
public TestSourcePartitionedScheduler() public TestSourcePartitionedScheduler()
@ -324,7 +327,7 @@ public class TestSourcePartitionedScheduler
Iterables.getOnlyElement(plan.getSplitSources().keySet()), Iterables.getOnlyElement(plan.getSplitSources().keySet()),
Iterables.getOnlyElement(plan.getSplitSources().values()), Iterables.getOnlyElement(plan.getSplitSources().values()),
new DynamicSplitPlacementPolicy(nodeScheduler.createNodeSelector(CONNECTOR_ID), stage::getAllTasks), new DynamicSplitPlacementPolicy(nodeScheduler.createNodeSelector(CONNECTOR_ID), stage::getAllTasks),
2, new HeuristicIndexerManager(new FileSystemClientManager())); 2, session, new HeuristicIndexerManager(new FileSystemClientManager()));
scheduler.schedule(); scheduler.schedule();
}).hasErrorCode(NO_NODES_AVAILABLE); }).hasErrorCode(NO_NODES_AVAILABLE);
} }
@ -449,7 +452,7 @@ public class TestSourcePartitionedScheduler
SplitSource splitSource = Iterables.getOnlyElement(plan.getSplitSources().values()); SplitSource splitSource = Iterables.getOnlyElement(plan.getSplitSources().values());
SplitPlacementPolicy placementPolicy = new DynamicSplitPlacementPolicy(nodeScheduler.createNodeSelector(splitSource.getCatalogName()), stage::getAllTasks); SplitPlacementPolicy placementPolicy = new DynamicSplitPlacementPolicy(nodeScheduler.createNodeSelector(splitSource.getCatalogName()), stage::getAllTasks);
return newSourcePartitionedSchedulerAsStageScheduler(stage, sourceNode, splitSource, return newSourcePartitionedSchedulerAsStageScheduler(stage, sourceNode, splitSource,
placementPolicy, splitBatchSize, new HeuristicIndexerManager(new FileSystemClientManager())); placementPolicy, splitBatchSize, session, new HeuristicIndexerManager(new FileSystemClientManager()));
} }
private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource) private static StageExecutionPlan createPlan(ConnectorSplitSource splitSource)

View File

@ -52,6 +52,7 @@ import io.prestosql.testing.TestingMetadata;
import io.prestosql.transaction.TransactionId; import io.prestosql.transaction.TransactionId;
import io.prestosql.transaction.TransactionInfo; import io.prestosql.transaction.TransactionInfo;
import io.prestosql.transaction.TransactionManager; import io.prestosql.transaction.TransactionManager;
import io.prestosql.utils.HetuConfig;
import org.intellij.lang.annotations.Language; import org.intellij.lang.annotations.Language;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
@ -581,7 +582,8 @@ public class TestAnalyzer
new QueryManagerConfig(), new QueryManagerConfig(),
new TaskManagerConfig(), new TaskManagerConfig(),
new MemoryManagerConfig(), new MemoryManagerConfig(),
new FeaturesConfig().setMaxGroupingSets(2048)))).build(); new FeaturesConfig().setMaxGroupingSets(2048),
new HetuConfig()))).build();
analyze(session, "SELECT a, b, c, d, e, f, g, h, i, j, k, SUM(l)" + analyze(session, "SELECT a, b, c, d, e, f, g, h, i, j, k, SUM(l)" +
"FROM (VALUES (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))\n" + "FROM (VALUES (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))\n" +
"t (a, b, c, d, e, f, g, h, i, j, k, l)\n" + "t (a, b, c, d, e, f, g, h, i, j, k, l)\n" +

View File

@ -74,4 +74,9 @@ public interface ConnectorSession
{ {
return new Duration(0, TimeUnit.MILLISECONDS); return new Duration(0, TimeUnit.MILLISECONDS);
} }
default boolean isHeuristicIndexFilterEnabled()
{
return true;
}
} }