Skip to content
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

Add support for Azure Blob #641

Open
wants to merge 2 commits into
base: release-0.179-t
Choose a base branch
from
Open

Add support for Azure Blob #641

wants to merge 2 commits into from

Conversation

sanjay990
Copy link
Member

No description provided.

Copy link

@petroav petroav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments only.

Can you change the commit message of e913b4a to Update the version of hadoop-apache2.

Can you squash 415b1f7 and db37ed8? The feature and its unit test should be in a single commit. Also can you re-phrase the commit message to Add configuration variables for authenticating to Azure Blob.

@@ -93,6 +95,8 @@ public HdfsConfigurationUpdater(HiveClientConfig hiveClientConfig, HiveS3Config
this.fileSystemMaxCacheSize = hiveClientConfig.getFileSystemMaxCacheSize();

this.s3AwsAccessKey = s3Config.getS3AwsAccessKey();
this.wasbAccessKey = wasbConfig.getWasbAccessKey();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're cutting the S3 'paragraph' into two by placing the two lines here. I suggest starting another code 'paragraph' just for blob either after or before the S3 'paragraph'.


// set config for Azure Blob
if ((wasbAccessKey != null) && (wasbStorageAccount != null)) {
config.set("fs.azure.account.key." + wasbStorageAccount + ".blob.core.windows.net", wasbAccessKey);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use String.format.

@@ -208,6 +212,11 @@ public void updateConfiguration(PrestoHadoopConfiguration config)
config.setLong(PrestoS3FileSystem.S3_MULTIPART_MIN_PART_SIZE, s3MultipartMinPartSize.toBytes());
config.setBoolean(PrestoS3FileSystem.S3_PIN_CLIENT_TO_CURRENT_REGION, pinS3ClientToCurrentRegion);
config.set(PrestoS3FileSystem.S3_USER_AGENT_PREFIX, s3UserAgentPrefix);

// set config for Azure Blob
if ((wasbAccessKey != null) && (wasbStorageAccount != null)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parentheses around each comparison are unnecessary. Equality comparisons have higher precedence that logical AND.

@@ -91,7 +91,8 @@ public static DistributedQueryRunner createQueryRunner(Iterable<TpchTable<?>> ta

HiveClientConfig hiveClientConfig = new HiveClientConfig();
HiveS3Config s3Config = new HiveS3Config();
HdfsConfiguration hdfsConfiguration = new HiveHdfsConfiguration(new HdfsConfigurationUpdater(hiveClientConfig, s3Config));
HiveWasbConfig wasbConfig = new HiveWasbConfig();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to create a separate variable, just inline it where it is used like you do elsewhere.

Copy link

@cawallin cawallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good % a small addition to the test

public class TestHiveWasbConfig
{
@Test
public void testExplicitPropertyMappings()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add testDefaults

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants