-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Don't truncate min/max for iceberg delete files #12671
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
findepi
merged 1 commit into
trinodb:master
from
homar:homar/cleanup_unused_delete_files_during_iceberg_optimize
Jun 8, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,6 +16,7 @@ | |
| import com.google.common.base.Splitter; | ||
| import com.google.common.collect.ImmutableMap; | ||
| import com.google.common.collect.ImmutableSet; | ||
| import io.airlift.units.DataSize; | ||
| import io.trino.orc.OrcDataSink; | ||
| import io.trino.orc.OrcDataSource; | ||
| import io.trino.orc.OrcDataSourceId; | ||
|
|
@@ -131,10 +132,10 @@ public IcebergFileWriter createDataFileWriter( | |
| { | ||
| switch (fileFormat) { | ||
| case PARQUET: | ||
| // TODO use metricsConfig | ||
| return createParquetWriter(outputPath, icebergSchema, jobConf, session, hdfsContext); | ||
| // TODO use metricsConfig https://github.com/trinodb/trino/issues/9791 | ||
| return createParquetWriter(MetricsConfig.getDefault(), outputPath, icebergSchema, jobConf, session, hdfsContext); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a GH Issue to support metrics mode for Parquet? If not, can you make one Either way, link it here |
||
| case ORC: | ||
| return createOrcWriter(metricsConfig, outputPath, icebergSchema, jobConf, session, storageProperties); | ||
| return createOrcWriter(metricsConfig, outputPath, icebergSchema, jobConf, session, storageProperties, getOrcStringStatisticsLimit(session)); | ||
| default: | ||
| throw new TrinoException(NOT_SUPPORTED, "File format not supported: " + fileFormat); | ||
| } | ||
|
|
@@ -150,15 +151,16 @@ public IcebergFileWriter createPositionDeleteWriter( | |
| { | ||
| switch (fileFormat) { | ||
| case PARQUET: | ||
| return createParquetWriter(outputPath, POSITION_DELETE_SCHEMA, jobConf, session, hdfsContext); | ||
| return createParquetWriter(FULL_METRICS_CONFIG, outputPath, POSITION_DELETE_SCHEMA, jobConf, session, hdfsContext); | ||
| case ORC: | ||
| return createOrcWriter(FULL_METRICS_CONFIG, outputPath, POSITION_DELETE_SCHEMA, jobConf, session, storageProperties); | ||
| return createOrcWriter(FULL_METRICS_CONFIG, outputPath, POSITION_DELETE_SCHEMA, jobConf, session, storageProperties, DataSize.ofBytes(Integer.MAX_VALUE)); | ||
| default: | ||
| throw new TrinoException(NOT_SUPPORTED, "File format not supported: " + fileFormat); | ||
| } | ||
| } | ||
|
|
||
| private IcebergFileWriter createParquetWriter( | ||
| MetricsConfig metricsConfig, | ||
| Path outputPath, | ||
| Schema icebergSchema, | ||
| JobConf jobConf, | ||
|
|
@@ -187,6 +189,7 @@ private IcebergFileWriter createParquetWriter( | |
| .build(); | ||
|
|
||
| return new IcebergParquetFileWriter( | ||
| metricsConfig, | ||
| hdfsEnvironment.doAs(session.getIdentity(), () -> fileSystem.create(outputPath)), | ||
| rollbackAction, | ||
| fileColumnTypes, | ||
|
|
@@ -211,7 +214,8 @@ private IcebergFileWriter createOrcWriter( | |
| Schema icebergSchema, | ||
| JobConf jobConf, | ||
| ConnectorSession session, | ||
| Map<String, String> storageProperties) | ||
| Map<String, String> storageProperties, | ||
| DataSize stringStatisticsLimit) | ||
| { | ||
| try { | ||
| FileSystem fileSystem = hdfsEnvironment.getFileSystem(session.getIdentity(), outputPath, jobConf); | ||
|
|
@@ -261,7 +265,7 @@ private IcebergFileWriter createOrcWriter( | |
| .withStripeMaxSize(getOrcWriterMaxStripeSize(session)) | ||
| .withStripeMaxRowCount(getOrcWriterMaxStripeRows(session)) | ||
| .withDictionaryMaxMemory(getOrcWriterMaxDictionaryMemory(session)) | ||
| .withMaxStringStatisticsLimit(getOrcStringStatisticsLimit(session)), | ||
| .withMaxStringStatisticsLimit(stringStatisticsLimit), | ||
| IntStream.range(0, fileColumnNames.size()).toArray(), | ||
| ImmutableMap.<String, String>builder() | ||
| .put(PRESTO_VERSION_NAME, nodeVersion.toString()) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.