Simplify athena partition projection code#19807
Merged
dain merged 18 commits intotrinodb:masterfrom Nov 18, 2023
Merged
Conversation
ProjectionFactory implementations are simple stateless classes, and new implementations can not be added due to the mapping to a Java enum, so the multibinder it not needed.
ff1dfae to
f3705cd
Compare
electrum
reviewed
Nov 18, 2023
| package io.trino.plugin.hive; | ||
|
|
||
| import com.google.common.collect.ImmutableList; | ||
| import io.trino.plugin.hive.aws.athena.projection.ProjectionType; |
Member
There was a problem hiding this comment.
We could move this to a top level io.trino.plugin.hive.projection package. The two classes in aws need to be moved to the metastore.glue package anyway.
electrum
approved these changes
Nov 18, 2023
plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/athena/DateProjection.java
Outdated
Show resolved
Hide resolved
Member
There was a problem hiding this comment.
Could use .formatted() for all of these
Member
Author
There was a problem hiding this comment.
The formatting seems off when doing that due to the long error messages in this code base
plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/athena/DateProjectionFactory.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/athena/ProjectionType.java
Outdated
Show resolved
Hide resolved
plugin/trino-hive/src/main/java/io/trino/plugin/hive/aws/athena/PartitionProjectionService.java
Outdated
Show resolved
Hide resolved
f3705cd to
8725617
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This is a large clean up of the partition projection codebase, but does not change the behavior. This change removes unnecessary abstractions and utility methods. and simplifies the codebase by removing complex uses of streaming api. Additionally, the entry point is moved from a metastore decorator to the Hive metastore closure.
Release notes
(x) This is not user-visible or is docs only, and no release notes are required.