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

Hadoop: Log where the missing metadata file is located #11643

Merged
merged 1 commit into from
Dec 12, 2024

Conversation

manuzhang
Copy link
Collaborator

Currently, in HadoopTableOperations when the metadata file is missing, we can't know where it's located. This PR adds metadata location to the exception message. Besides, a UT is added for metedata file missing.

cc @pvary

@github-actions github-actions bot added the core label Nov 25, 2024
.isInstanceOf(ValidationException.class)
.hasMessage(
"Metadata file for version 3 is missing under "
+ (new Path(tableLocation, "metadata")));
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't this already defined with the metadataDir variable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

metadataDir is of type File, whose toString result is different from that of Path

Copy link
Contributor

Choose a reason for hiding this comment

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

what about metadataDir.toPath().toString()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

toPath doesn't change the output.

Copy link
Contributor

@nastra nastra Dec 12, 2024

Choose a reason for hiding this comment

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

I'm not sure what exactly you mean by output here. I'm guessing you don't have a file URI and are therefore missing the file: prefix. In that case you could still replace this with metadataDir.toURI().
I'm ok either way, but I'd at least remove the outer () to have new Path(tableLocation, "metadata")

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. metadataDir.toURI() will have a trailing /

@manuzhang
Copy link
Collaborator Author

@nastra any more comments?

@manuzhang manuzhang force-pushed the log_missing_hadoop_meta branch from eb017a4 to 047fc2b Compare December 12, 2024 09:34
@nastra nastra merged commit 6c05f35 into apache:main Dec 12, 2024
49 checks passed
@manuzhang manuzhang deleted the log_missing_hadoop_meta branch December 12, 2024 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants