Package org.apache.gravitino.rel
Interface ViewChange
- All Known Implementing Classes:
ViewChange.RemoveProperty,ViewChange.RenameView,ViewChange.ReplaceView,ViewChange.SetProperty
The ViewChange interface defines a change that can be applied to a view via
ViewCatalog.alterView(org.apache.gravitino.NameIdentifier, ViewChange...).-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA ViewChange to remove a view property.static final classA ViewChange to rename a view.static final classA ViewChange that atomically replaces the view body (columns, representations, default catalog, default schema and comment).static final classA ViewChange to set a view property. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ViewChangeremoveProperty(String property) Create a ViewChange for removing a view property.static ViewChangeCreate a ViewChange for renaming a view.static ViewChangereplaceView(Column[] columns, Representation[] representations, String defaultCatalog, String defaultSchema, String comment) Create a ViewChange that atomically replaces the view body, i.e.static ViewChangesetProperty(String property, String value) Create a ViewChange for setting a view property.
-
Method Details
-
rename
Create a ViewChange for renaming a view.- Parameters:
newName- The new view name.- Returns:
- A ViewChange for the rename.
-
setProperty
Create a ViewChange for setting a view property.If the property already exists, it will be replaced with the new value.
- Parameters:
property- The property name.value- The new property value.- Returns:
- A ViewChange for the addition.
-
removeProperty
Create a ViewChange for removing a view property.If the property does not exist, the change will succeed.
- Parameters:
property- The property name.- Returns:
- A ViewChange for the removal.
-
replaceView
static ViewChange replaceView(Column[] columns, Representation[] representations, @Nullable String defaultCatalog, @Nullable String defaultSchema, @Nullable String comment) Create a ViewChange that atomically replaces the view body, i.e. its columns, representations, default catalog, default schema and comment. Properties and the view name are not affected by this change.The provided values are treated as a full replacement: any existing columns, representations and defaults are discarded. Callers that only intend to change a subset of the body should read the current values first and pass them back unchanged.
- Parameters:
columns- The new output columns of the view.representations- The new representations of the view. At least one representation is expected.defaultCatalog- The new default catalog, ornullto unset it.defaultSchema- The new default schema, ornullto unset it.comment- The new comment, ornullto unset it.- Returns:
- A ViewChange for the replacement.
-