Package org.apache.iceberg.view
Class BaseMetastoreViewCatalog.BaseViewBuilder
- java.lang.Object
-
- org.apache.iceberg.view.BaseMetastoreViewCatalog.BaseViewBuilder
-
- All Implemented Interfaces:
VersionBuilder<ViewBuilder>,ViewBuilder
- Enclosing class:
- BaseMetastoreViewCatalog
protected class BaseMetastoreViewCatalog.BaseViewBuilder extends java.lang.Object implements ViewBuilder
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBaseViewBuilder(TableIdentifier identifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Viewcreate()Create the view.ViewcreateOrReplace()Create or replace the view.Viewreplace()Replace the view.ViewBuilderwithDefaultCatalog(java.lang.String catalog)Set the default catalog to use for the view.ViewBuilderwithDefaultNamespace(Namespace namespace)Set the default namespace to use for the view.ViewBuilderwithLocation(java.lang.String newLocation)Sets a location for the viewViewBuilderwithProperties(java.util.Map<java.lang.String,java.lang.String> newProperties)Add key/value properties to the view.ViewBuilderwithProperty(java.lang.String key, java.lang.String value)Add a key/value property to the view.ViewBuilderwithQuery(java.lang.String dialect, java.lang.String sql)Add a view representation for the given dialect and the SQL to the view.ViewBuilderwithSchema(Schema newSchema)Set the view schema.
-
-
-
Constructor Detail
-
BaseViewBuilder
protected BaseViewBuilder(TableIdentifier identifier)
-
-
Method Detail
-
withSchema
public ViewBuilder withSchema(Schema newSchema)
Description copied from interface:VersionBuilderSet the view schema.- Specified by:
withSchemain interfaceVersionBuilder<ViewBuilder>- Parameters:
newSchema- The schema to use for this view version- Returns:
- this for method chaining
-
withQuery
public ViewBuilder withQuery(java.lang.String dialect, java.lang.String sql)
Description copied from interface:VersionBuilderAdd a view representation for the given dialect and the SQL to the view.- Specified by:
withQueryin interfaceVersionBuilder<ViewBuilder>- Parameters:
dialect- The dialect of the view representationsql- The SQL of the view representation- Returns:
- this for method chaining
-
withDefaultCatalog
public ViewBuilder withDefaultCatalog(java.lang.String catalog)
Description copied from interface:VersionBuilderSet the default catalog to use for the view.- Specified by:
withDefaultCatalogin interfaceVersionBuilder<ViewBuilder>- Parameters:
catalog- The default catalog to use when the SQL does not contain a catalog- Returns:
- this for method chaining
-
withDefaultNamespace
public ViewBuilder withDefaultNamespace(Namespace namespace)
Description copied from interface:VersionBuilderSet the default namespace to use for the view.- Specified by:
withDefaultNamespacein interfaceVersionBuilder<ViewBuilder>- Parameters:
namespace- The default namespace to use when the SQL does not contain a namespace- Returns:
- this for method chaining
-
withProperties
public ViewBuilder withProperties(java.util.Map<java.lang.String,java.lang.String> newProperties)
Description copied from interface:ViewBuilderAdd key/value properties to the view.- Specified by:
withPropertiesin interfaceViewBuilder- Parameters:
newProperties- key/value properties- Returns:
- this for method chaining
-
withProperty
public ViewBuilder withProperty(java.lang.String key, java.lang.String value)
Description copied from interface:ViewBuilderAdd a key/value property to the view.- Specified by:
withPropertyin interfaceViewBuilder- Parameters:
key- a keyvalue- a value- Returns:
- this for method chaining
-
withLocation
public ViewBuilder withLocation(java.lang.String newLocation)
Description copied from interface:ViewBuilderSets a location for the view- Specified by:
withLocationin interfaceViewBuilder- Parameters:
newLocation- the location to set for the view- Returns:
- this for method chaining
-
create
public View create()
Description copied from interface:ViewBuilderCreate the view.- Specified by:
createin interfaceViewBuilder- Returns:
- the view created
-
replace
public View replace()
Description copied from interface:ViewBuilderReplace the view.- Specified by:
replacein interfaceViewBuilder- Returns:
- the
Viewreplaced
-
createOrReplace
public View createOrReplace()
Description copied from interface:ViewBuilderCreate or replace the view.- Specified by:
createOrReplacein interfaceViewBuilder- Returns:
- the
Viewcreated or replaced
-
-