-
Notifications
You must be signed in to change notification settings - Fork 350
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
[#5070] improvement(core): Add check for the full name of the metadata object #5075
Conversation
void checkAndImportEntity(String metalake, MetadataObject metadataObject, GravitinoEnv env) { | ||
MetadataObjectUtil.checkMetadataObject(metalake, metadataObject, env); | ||
} |
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.
The checkAndImportEntity(...)
function only have one line code.
We can directly call MetadataObjectUtil.checkMetadataObject(metalake, metadataObject, env)
.
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 is convenient to test. Because we can spy this method easily.
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.
Fixed.
public static void checkMetadataObject(String metalake, MetadataObject object, GravitinoEnv env) { | ||
NameIdentifier identifier = toEntityIdent(metalake, object); |
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 we doesn't need GravitinoEnv env
params in the checkMetadataObject(...)
function.
We can directly call GravitinoEnv.getInstance()
in the function body.
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.
Using env
as a method parameter will make the mock test easy to achieve.
} | ||
break; | ||
|
||
case COLUMN: |
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.
Do we support checking columns or not? If the answer is 'No', you can remove case COLUMN:
here.
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.
OK.
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
What changes were proposed in this pull request?
Add check for full name of the metadata object.
Why are the changes needed?
Fix: #5070
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Add UTs.