-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Implement Parallel Partition Pruning for Glue Hive Metastore #1465
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package io.prestosql.plugin.hive.metastore.glue; | ||
|
|
||
| import javax.inject.Qualifier; | ||
|
|
||
| import java.lang.annotation.Retention; | ||
| import java.lang.annotation.Target; | ||
|
|
||
| import static java.lang.annotation.ElementType.FIELD; | ||
| import static java.lang.annotation.ElementType.METHOD; | ||
| import static java.lang.annotation.ElementType.PARAMETER; | ||
| import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
|
||
| @Retention(RUNTIME) | ||
| @Target({FIELD, PARAMETER, METHOD}) | ||
| @Qualifier | ||
| public @interface ForGlueHiveMetastore {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ | |
| import io.airlift.configuration.ConfigDescription; | ||
| import io.airlift.configuration.ConfigSecuritySensitive; | ||
|
|
||
| import javax.validation.constraints.Max; | ||
| import javax.validation.constraints.Min; | ||
|
|
||
| import java.util.Optional; | ||
|
|
@@ -33,6 +34,8 @@ public class GlueHiveMetastoreConfig | |
| private Optional<String> awsCredentialsProvider = Optional.empty(); | ||
| private boolean useInstanceCredentials; | ||
| private Optional<String> catalogId = Optional.empty(); | ||
| private int partitionSegments = 5; | ||
| private int getPartitionThreads = 20; | ||
|
|
||
| public Optional<String> getGlueRegion() | ||
| { | ||
|
|
@@ -163,4 +166,33 @@ public GlueHiveMetastoreConfig setAwsCredentialsProvider(String awsCredentialsPr | |
| this.awsCredentialsProvider = Optional.ofNullable(awsCredentialsProvider); | ||
| return this; | ||
| } | ||
|
|
||
| @Min(1) | ||
| @Max(10) | ||
electrum marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| public int getPartitionSegments() | ||
| { | ||
| return partitionSegments; | ||
| } | ||
|
|
||
| @Config("hive.metastore.glue.partitions-segments") | ||
| @ConfigDescription("Number of segments for partitioned Glue tables") | ||
| public GlueHiveMetastoreConfig setPartitionSegments(int partitionSegments) | ||
| { | ||
| this.partitionSegments = partitionSegments; | ||
| return this; | ||
| } | ||
|
|
||
| @Min(1) | ||
| public int getGetPartitionThreads() | ||
| { | ||
| return getPartitionThreads; | ||
| } | ||
|
|
||
| @Config("hive.metastore.glue.get-partition-threads") | ||
| @ConfigDescription("Number of threads for parallel partition fetches from Glue") | ||
|
||
| public GlueHiveMetastoreConfig setGetPartitionThreads(int getPartitionThreads) | ||
| { | ||
| this.getPartitionThreads = getPartitionThreads; | ||
| return this; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: per code style, if there are too many params to put on one line, we put every on a separate line:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs updating