refactor: HivePartitionManager.parsePartition to instance method and remove timeZone argument#27284
Merged
gggrace14 merged 1 commit intoprestodb:masterfrom Mar 7, 2026
Merged
Conversation
Contributor
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors HivePartitionManager.parsePartition from a static utility-style method into an instance method (removing the DateTimeZone parameter) and updates internal call sites and tests accordingly. Class diagram for refactored HivePartitionManager.parsePartition instance methodclassDiagram
class HivePartitionManager {
+HivePartitionResult getPartitions(SemiTransactionalHiveMetastore metastore, ConnectorSession session, HiveTableHandle hiveTableHandle, Constraint~ColumnHandle~ constraint)
-List~HivePartition~ getPartitionListFromPartitionNames(ConnectorSession session, SchemaTableName tableName, List~PartitionNameWithVersion~ partitionNames, List~HiveColumnHandle~ partitionColumns, List~Type~ partitionTypes, Constraint~ColumnHandle~ constraint)
-Optional~HivePartition~ parseValuesAndFilterPartition(SchemaTableName tableName, PartitionNameWithVersion partitionNameWithVersion, List~HiveColumnHandle~ partitionColumns, List~Type~ partitionColumnTypes, Constraint~ColumnHandle~ constraint)
+HivePartition parsePartition(SchemaTableName tableName, PartitionNameWithVersion partitionNameWithVersion, List~HiveColumnHandle~ partitionColumns, List~Type~ partitionColumnTypes)
}
class HivePartition {
}
class HiveColumnHandle {
+String getName()
+TypeSignature getTypeSignature()
}
class PartitionNameWithVersion {
}
class Type {
}
class SchemaTableName {
}
class Constraint~ColumnHandle~ {
+TupleDomain~ColumnHandle~ getSummary()
}
class TupleDomain~T~ {
+Optional~Map~ColumnHandle,Domain~~ getDomains()
}
HivePartitionManager --> HivePartition : creates
HivePartitionManager --> HiveColumnHandle : uses
HivePartitionManager --> PartitionNameWithVersion : uses
HivePartitionManager --> Type : uses
HivePartitionManager --> SchemaTableName : uses
HivePartitionManager --> Constraint~ColumnHandle~ : uses
Constraint~ColumnHandle~ --> TupleDomain~ColumnHandle~ : returns
TupleDomain~ColumnHandle~ --> Domain : contains
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
…remove timeZone argument (prestodb#27284) Summary: Convert parsePartition from a static method to an instance method in HivePartitionManager (presto-facebook-trunk), removing the DateTimeZone timeZone parameter. Then parsePartition could use the timeZone member field of the HivePartitionManager instance instead of requiring callers to pass. Update call sites within HivePartitionManager, TestMetastoreHiveStatisticsProvider, and VectorSearchOptimizerUtils. == NO RELEASE NOTE == Reviewed By: skyelves Differential Revision: D95603597
8be7b88 to
eb7aa8c
Compare
feilong-liu
reviewed
Mar 7, 2026
| PartitionNameWithVersion partitionNameWithVersion, | ||
| List<HiveColumnHandle> partitionColumns, | ||
| List<Type> partitionColumnTypes, | ||
| DateTimeZone timeZone) |
Contributor
There was a problem hiding this comment.
I guess this is under the assumption that the timeZone used will always be the timeZone defined in the class?
Contributor
Author
There was a problem hiding this comment.
Yes, exactly. Checked all call sites, and all set this parameter to the timeZone member of the class, except unit tests.
(It's hard for the user to get the timezone configured in prod.)
feilong-liu
approved these changes
Mar 7, 2026
This was referenced Mar 31, 2026
15 tasks
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.
Summary:
Convert parsePartition from a static method to an instance method in
HivePartitionManager (presto-facebook-trunk), removing the DateTimeZone
timeZone parameter. Then parsePartition could use the timeZone member
field of the HivePartitionManager instance instead of requiring callers to pass.
Update call sites within HivePartitionManager,
TestMetastoreHiveStatisticsProvider, and VectorSearchOptimizerUtils.
== NO RELEASE NOTE ==
Differential Revision: D95603597
Summary by Sourcery
Refactor Hive partition parsing to use an instance-level HivePartitionManager method without an explicit time zone parameter and update call sites and tests accordingly.
Enhancements:
Tests: