Skip to content

Increase domain compaction limits for hive and delta #18024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/main/sphinx/connector/delta-lake.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,7 @@ connector.
can compromise performance. For optimization in that situation, Trino
can compact the large predicates. If necessary, adjust the threshold to
ensure a balance between performance and predicate pushdown.
- ``100``
- ``1000``
* - ``delta.max-outstanding-splits``
- The target number of buffered splits for each table scan in a query,
before the scheduler tries to pause.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class DeltaLakeConfig
private long metadataCacheMaxSize = 1000;
private DataSize dataFileCacheSize = DEFAULT_DATA_FILE_CACHE_SIZE;
private Duration dataFileCacheTtl = new Duration(30, TimeUnit.MINUTES);
private int domainCompactionThreshold = 100;
private int domainCompactionThreshold = 1000;
private int maxOutstandingSplits = 1_000;
private int maxSplitsPerSecond = Integer.MAX_VALUE;
private int maxInitialSplits = 200;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public void testDefaults()
.setDataFileCacheTtl(new Duration(30, MINUTES))
.setMetadataCacheTtl(new Duration(5, TimeUnit.MINUTES))
.setMetadataCacheMaxSize(1000)
.setDomainCompactionThreshold(100)
.setDomainCompactionThreshold(1000)
.setMaxSplitsPerSecond(Integer.MAX_VALUE)
.setMaxOutstandingSplits(1_000)
.setMaxInitialSplits(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public class HiveConfig
private int splitLoaderConcurrency = 64;
private Integer maxSplitsPerSecond;
private DataSize maxInitialSplitSize;
private int domainCompactionThreshold = 100;
private int domainCompactionThreshold = 1000;
private boolean forceLocalScheduling;
private boolean recursiveDirWalkerEnabled;
private boolean ignoreAbsentPartitions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ public ConnectorPageSource createPageSource(

Configuration configuration = hdfsEnvironment.getConfiguration(new HdfsContext(session), new Path(hiveSplit.getPath()));

TupleDomain<HiveColumnHandle> simplifiedDynamicFilter = dynamicFilter
.getCurrentPredicate()
.transformKeys(HiveColumnHandle.class::cast).simplify(domainCompactionThreshold);
Optional<ConnectorPageSource> pageSource = createHivePageSource(
pageSourceFactories,
cursorProviders,
Expand All @@ -164,7 +161,9 @@ public ConnectorPageSource createPageSource(
hiveSplit.getLength(),
hiveSplit.getEstimatedFileSize(),
hiveSplit.getSchema(),
hiveTable.getCompactEffectivePredicate().intersect(simplifiedDynamicFilter),
hiveTable.getCompactEffectivePredicate().intersect(
dynamicFilter.getCurrentPredicate().transformKeys(HiveColumnHandle.class::cast))
.simplify(domainCompactionThreshold),
hiveColumns,
typeManager,
hiveSplit.getBucketConversion(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void testDefaults()
.setMaxInitialSplitSize(DataSize.of(32, Unit.MEGABYTE))
.setSplitLoaderConcurrency(64)
.setMaxSplitsPerSecond(null)
.setDomainCompactionThreshold(100)
.setDomainCompactionThreshold(1000)
.setTargetMaxFileSize(DataSize.of(1, GIGABYTE))
.setForceLocalScheduling(false)
.setMaxConcurrentFileSystemOperations(20)
Expand Down