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 protected
BaseViewBuilder(TableIdentifier identifier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description View
create()
Create the view.View
createOrReplace()
Create or replace the view.View
replace()
Replace the view.ViewBuilder
withDefaultCatalog(java.lang.String catalog)
Set the default catalog to use for the view.ViewBuilder
withDefaultNamespace(Namespace namespace)
Set the default namespace to use for the view.ViewBuilder
withLocation(java.lang.String newLocation)
Sets a location for the viewViewBuilder
withProperties(java.util.Map<java.lang.String,java.lang.String> newProperties)
Add key/value properties to the view.ViewBuilder
withProperty(java.lang.String key, java.lang.String value)
Add a key/value property to the view.ViewBuilder
withQuery(java.lang.String dialect, java.lang.String sql)
Add a view representation for the given dialect and the SQL to the view.ViewBuilder
withSchema(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:VersionBuilder
Set the view schema.- Specified by:
withSchema
in 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:VersionBuilder
Add a view representation for the given dialect and the SQL to the view.- Specified by:
withQuery
in 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:VersionBuilder
Set the default catalog to use for the view.- Specified by:
withDefaultCatalog
in 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:VersionBuilder
Set the default namespace to use for the view.- Specified by:
withDefaultNamespace
in 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:ViewBuilder
Add key/value properties to the view.- Specified by:
withProperties
in 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:ViewBuilder
Add a key/value property to the view.- Specified by:
withProperty
in interfaceViewBuilder
- Parameters:
key
- a keyvalue
- a value- Returns:
- this for method chaining
-
withLocation
public ViewBuilder withLocation(java.lang.String newLocation)
Description copied from interface:ViewBuilder
Sets a location for the view- Specified by:
withLocation
in interfaceViewBuilder
- Parameters:
newLocation
- the location to set for the view- Returns:
- this for method chaining
-
create
public View create()
Description copied from interface:ViewBuilder
Create the view.- Specified by:
create
in interfaceViewBuilder
- Returns:
- the view created
-
replace
public View replace()
Description copied from interface:ViewBuilder
Replace the view.- Specified by:
replace
in interfaceViewBuilder
- Returns:
- the
View
replaced
-
createOrReplace
public View createOrReplace()
Description copied from interface:ViewBuilder
Create or replace the view.- Specified by:
createOrReplace
in interfaceViewBuilder
- Returns:
- the
View
created or replaced
-
-