-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Enable instance and custom credential provider for glue #1363
Enable instance and custom credential provider for glue #1363
Conversation
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/prestosql/cla. |
I just submitted CLA to [email protected] |
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastore.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/HdfsEnvironment.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/HiveHdfsConfiguration.java
Outdated
Show resolved
Hide resolved
@@ -131,6 +135,7 @@ | |||
private static final String PUBLIC_ROLE_NAME = "public"; | |||
private static final String DEFAULT_METASTORE_USER = "presto"; | |||
private static final String WILDCARD_EXPRESSION = ""; | |||
private static final String GLUE_CREDENTIALS_PROVIDER = "presto.glue.credentials-provider"; |
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.
GLUE_CREDENTIALS_PROVIDER
config property is not set anywhere
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.
it's defined in hdfs config xml
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.
It's odd that we put Glue specific config in hdfs-config.xml
.
I would rather pass the class name similar as:
public String getS3EncryptionMaterialsProvider()
{
return s3EncryptionMaterialsProvider;
}
@Config("hive.s3.encryption-materials-provider")
@ConfigDescription("Use a custom encryption materials provider for S3 data encryption")
public HiveS3Config setS3EncryptionMaterialsProvider(String s3EncryptionMaterialsProvider)
{
this.s3EncryptionMaterialsProvider = s3EncryptionMaterialsProvider;
return this;
}
from HiveS3Config
this(hdfsEnvironment, glueConfig, createAsyncGlueClient(glueConfig)); | ||
} | ||
|
||
public GlueHiveMetastore(HdfsEnvironment hdfsEnvironment, GlueHiveMetastoreConfig glueConfig, AWSGlueAsync glueClient) |
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.
I think you can set credential provider class name directly in GlueHiveMetastoreConfig
. No need for passthrough via Configuration
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.
I am trying to follow the convention in document
This class must implement the AWSCredentialsProvider interface and provide a two-argument constructor that takes a java.net.URI and a Hadoop org.apache.hadoop.conf.Configuration as arguments.
https://prestosql.io/docs/current/connector/hive.html#amazon-s3-configuration
^^ see custom s3 credential provider.
shall we use the same pattern for glue ?
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please submit the signed CLA to [email protected]. For more information, see https://github.com/prestosql/cla. |
@Praveen2112 @sopel39 I resolved comments except hdfs configuration one |
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastore.java
Outdated
Show resolved
Hide resolved
@@ -131,6 +135,7 @@ | |||
private static final String PUBLIC_ROLE_NAME = "public"; | |||
private static final String DEFAULT_METASTORE_USER = "presto"; | |||
private static final String WILDCARD_EXPRESSION = ""; | |||
private static final String GLUE_CREDENTIALS_PROVIDER = "presto.glue.credentials-provider"; |
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.
It's odd that we put Glue specific config in hdfs-config.xml
.
I would rather pass the class name similar as:
public String getS3EncryptionMaterialsProvider()
{
return s3EncryptionMaterialsProvider;
}
@Config("hive.s3.encryption-materials-provider")
@ConfigDescription("Use a custom encryption materials provider for S3 data encryption")
public HiveS3Config setS3EncryptionMaterialsProvider(String s3EncryptionMaterialsProvider)
{
this.s3EncryptionMaterialsProvider = s3EncryptionMaterialsProvider;
return this;
}
from HiveS3Config
@sopel39 ready for review. |
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.
lgtm + minor comment
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastore.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastore.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastoreConfig.java
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastoreConfig.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastoreConfig.java
Outdated
Show resolved
Hide resolved
@sopel39 ready for review. |
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastoreConfig.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/io/prestosql/plugin/hive/metastore/glue/GlueHiveMetastoreConfig.java
Outdated
Show resolved
Hide resolved
Add two configs for glue credentials 1. Use instance credential hive.metastore.glue.use-instance-credentials=true 2. Use custom credentials provider hive.metastore.glue.aws-credentials-provider where value is fully qualified class name
For future:
|
Cherry-pick of trinodb/trino#1363, trinodb/trino#741 and trinodb/trino#3689 Add config hive.metastore.glue.aws-credentials-provider for glue credential provider. where value is fully qualified class name of custom aws credential provider implementation. Co-authored-by: Li Yu <[email protected]> Co-authored-by: Anoop Johnson <[email protected]> Co-authored-by: Ashhar Hasan <[email protected]>
Cherry-pick of trinodb/trino#1363 Add a config for glue credential hive.metastore.glue.aws-credentials-provider where value is fully qualified class name. Co-authored-by: Li Yu <[email protected]>
Add two configs for glue credential provider
Use instance credential(glue configuration property)
hive.metastore.glue.use-instance-credentials=true
Use custom credential class(hdfs configuration)
presto.glue.credentials-provider
where value is fully qualified class name of
custom aws credential provider implementation