-
Notifications
You must be signed in to change notification settings - Fork 407
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
[#1661] feat(core): introduce catalog capability framework #2819
Conversation
0bc6e19
to
695e959
Compare
Could you please help review it, thanks! @jerryshao @diqiu50 |
* some special capabilities, it should override the default implementation of the capabilities. | ||
*/ | ||
@Evolving | ||
public interface HasCapabilities { |
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 the name HasCapabilities
is not so proper here. I would call it Capability
.
If you want to define a HasCapabilities
interface? It should be like:
interface HasCapabilities {
Capability[] hasCapabilies()
}
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.
updated
core/src/main/java/com/datastrato/gravitino/catalog/CapabilitiesHelpers.java
Outdated
Show resolved
Hide resolved
* @return A new instance of HasCapabilities. | ||
*/ | ||
@Evolving | ||
protected HasCapabilities newCaps() { |
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 don't suggest use the abbreviation "caps" here, it is not a common abbreviation.
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.
renamed
TABLE, | ||
COLUMN, | ||
FILESET | ||
} |
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.
Should you also add messaging and partition?
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.
added
|
||
public class CapabilityHelpers { | ||
|
||
public static Column[] applyCapabilities(Column[] columns, Capability capabilities) { |
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 is just one capability, why do you need to use plural?
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 method will apply multiple capabilities to the column, such as default value, not null, case sensitivity, and so on. Therefore I use plural
Column appliedColumn = | ||
applyCapabilities( | ||
Column.of( | ||
addColumn.fieldName()[0], |
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.
Why getting the first element of the fieldName
?
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.
because the first name is the column name, and the others are just nested fields in columns.
What changes were proposed in this pull request?
column not null
capability to show how the framework worksWhy are the changes needed?
Improving code quality
Fix: #1662
Does this PR introduce any user-facing change?
no
How was this patch tested?
existing tests