Skip to content

[#5648] improvement(iceberg): generate credential according to the data path and metadata path#5698

Merged
xunliu merged 5 commits intoapache:mainfrom
orenccl:improvement/credential
Nov 28, 2024
Merged

[#5648] improvement(iceberg): generate credential according to the data path and metadata path#5698
xunliu merged 5 commits intoapache:mainfrom
orenccl:improvement/credential

Conversation

@orenccl
Copy link
Collaborator

@orenccl orenccl commented Nov 28, 2024

What changes were proposed in this pull request?

This PR updates the credential generation process to also consider write.data.path and write.metadata.path.

Why are the changes needed?

To provide greater flexibility for users.
Fixes: #5648

Does this PR introduce any user-facing change?

No.

How was this patch tested?

  • Used Spark to create a table via Gravitino Iceberg REST server to AWS S3 and verified that write.data.path and write.metadata.path are working as expected.
  • Added unit tests to check if table properties include write.data.path and write.metadata.path.

image

credentialProvider,
new String[] {
loadTableResponse.tableMetadata().location(),
loadTableResponse.tableMetadata().property(TableProperties.WRITE_DATA_LOCATION, ""),
Copy link
Contributor

Choose a reason for hiding this comment

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

it's odd to pass an empty path if the specific properties is not set, could you add a check before adding the extra paths?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

propertiesMap.get(TableProperties.WRITE_METADATA_LOCATION),
String.format(
"Expected write.metadata.path to be '%s', but was '%s'",
writeMetaDataPath, propertiesMap.get(TableProperties.WRITE_METADATA_LOCATION)));
Copy link
Contributor

Choose a reason for hiding this comment

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

could you try to write and read some data?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated

@orenccl
Copy link
Collaborator Author

orenccl commented Nov 28, 2024

Seems like occasional error
image

@FANNG1 FANNG1 closed this Nov 28, 2024
@FANNG1 FANNG1 reopened this Nov 28, 2024
}

@Test
void testWritePathCredential() {
Copy link
Contributor

Choose a reason for hiding this comment

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

could you rename the test name to testCredentialWithMultiLocations?

Copy link
Collaborator Author

@orenccl orenccl Nov 28, 2024

Choose a reason for hiding this comment

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

Updated

@FANNG1
Copy link
Contributor

FANNG1 commented Nov 28, 2024

Great work @orenccl , I verified feature succussfully in my local environment, LGTM except one minor comments, could you fix it?

@orenccl
Copy link
Collaborator Author

orenccl commented Nov 28, 2024

I think the CI is broken, maybe wait till tomorrow 🤷‍♂️😂

@FANNG1 FANNG1 closed this Nov 28, 2024
@FANNG1 FANNG1 reopened this Nov 28, 2024
Copy link
Member

@xunliu xunliu left a comment

Choose a reason for hiding this comment

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

hi @orenccl Thank you for your contributions.

@xunliu xunliu merged commit 8cda4d4 into apache:main Nov 28, 2024
@orenccl orenccl deleted the improvement/credential branch December 22, 2024 09:25
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.

[Improvement] generate credential according to the data path and metadata path

3 participants