Class Schema

java.lang.Object
dev.frostlake.metastore.SqlObject
dev.frostlake.metastore.model.Schema
All Implemented Interfaces:
Taggable

public class Schema extends SqlObject
  • Constructor Details

    • Schema

      public Schema(String name)
  • Method Details

    • getDataRetentionTimeInDays

      public Integer getDataRetentionTimeInDays()
    • setDataRetentionTimeInDays

      public void setDataRetentionTimeInDays(Integer dataRetentionTimeInDays)
    • getDatabaseName

      public String getDatabaseName()
    • setDatabaseName

      public void setDatabaseName(String databaseName)
    • qualifiedName

      public String qualifiedName(String memberName)
      database.schema.member — the fully spelled name a DDL miss is reported under.
    • isTransientObject

      public boolean isTransientObject()
    • setTransientObject

      public void setTransientObject(boolean value)
    • addTable

      public void addTable(Table table)
    • dropTable

      public void dropTable(String name)
    • getTable

      public Table getTable(String name)
    • tableExact

      public Table tableExact(String name)
      The table a SQL reference names, matched EXACTLY. Live reports a miss as Object 'DB.SCHEMA.MIXEDTBL' does not exist or not authorized. — "Object", not "Table".
    • getTable

      public Table getTable(String name, String reportedName, String reportedKind)
      The table, or a miss reported as reportedKind 'reportedName'. A DDL statement always spells the name in full, while a query or DML statement echoes what the writer wrote and calls a missing FROM-clause name an Object — so the caller, which knows the statement, chooses both.
    • hasTable

      public boolean hasTable(String name)
    • getTables

      public List<Table> getTables()
    • addView

      public void addView(View view)
    • dropView

      public void dropView(String name)
    • getView

      public View getView(String name)
    • hasView

      public boolean hasView(String name)
      Whether a view of this name exists, without the throwing lookup getView(java.lang.String) performs.
    • getViews

      public List<View> getViews()
    • addMaterializedView

      public void addMaterializedView(MaterializedView materializedView)
    • dropMaterializedView

      public void dropMaterializedView(String name)
    • getMaterializedView

      public MaterializedView getMaterializedView(String name)
    • hasMaterializedView

      public boolean hasMaterializedView(String name)
    • getMaterializedViews

      public List<MaterializedView> getMaterializedViews()
    • addDynamicTable

      public void addDynamicTable(DynamicTable dt)
    • dropDynamicTable

      public void dropDynamicTable(String name)
    • getDynamicTable

      public DynamicTable getDynamicTable(String name)
    • hasDynamicTable

      public boolean hasDynamicTable(String name)
    • getDynamicTables

      public List<DynamicTable> getDynamicTables()
    • addContact

      public void addContact(Contact contact)
    • dropContact

      public void dropContact(String name)
    • getContact

      public Contact getContact(String name)
    • hasContact

      public boolean hasContact(String name)
    • getContacts

      public List<Contact> getContacts()
    • addJoinPolicy

      public void addJoinPolicy(JoinPolicy policy)
    • dropJoinPolicy

      public void dropJoinPolicy(String name)
    • getJoinPolicy

      public JoinPolicy getJoinPolicy(String name)
    • hasJoinPolicy

      public boolean hasJoinPolicy(String name)
    • getJoinPolicies

      public List<JoinPolicy> getJoinPolicies()
    • renameJoinPolicy

      public void renameJoinPolicy(String oldName, String newName)
    • addAggregationPolicy

      public void addAggregationPolicy(AggregationPolicy policy)
    • dropAggregationPolicy

      public void dropAggregationPolicy(String name)
    • getAggregationPolicy

      public AggregationPolicy getAggregationPolicy(String name)
    • hasAggregationPolicy

      public boolean hasAggregationPolicy(String name)
    • getAggregationPolicies

      public List<AggregationPolicy> getAggregationPolicies()
    • renameAggregationPolicy

      public void renameAggregationPolicy(String oldName, String newName)
    • addProjectionPolicy

      public void addProjectionPolicy(ProjectionPolicy policy)
    • dropProjectionPolicy

      public void dropProjectionPolicy(String name)
    • getProjectionPolicy

      public ProjectionPolicy getProjectionPolicy(String name)
    • hasProjectionPolicy

      public boolean hasProjectionPolicy(String name)
    • getProjectionPolicies

      public List<ProjectionPolicy> getProjectionPolicies()
    • renameProjectionPolicy

      public void renameProjectionPolicy(String oldName, String newName)
    • addMaskingPolicy

      public void addMaskingPolicy(MaskingPolicy policy)
    • dropMaskingPolicy

      public void dropMaskingPolicy(String name)
    • getMaskingPolicy

      public MaskingPolicy getMaskingPolicy(String name)
    • hasMaskingPolicy

      public boolean hasMaskingPolicy(String name)
    • getMaskingPolicies

      public List<MaskingPolicy> getMaskingPolicies()
    • renameMaskingPolicy

      public void renameMaskingPolicy(String oldName, String newName)
    • addRowAccessPolicy

      public void addRowAccessPolicy(RowAccessPolicy policy)
    • dropRowAccessPolicy

      public void dropRowAccessPolicy(String name)
    • getRowAccessPolicy

      public RowAccessPolicy getRowAccessPolicy(String name)
    • hasRowAccessPolicy

      public boolean hasRowAccessPolicy(String name)
    • getRowAccessPolicies

      public List<RowAccessPolicy> getRowAccessPolicies()
    • renameRowAccessPolicy

      public void renameRowAccessPolicy(String oldName, String newName)
    • addProcedure

      public void addProcedure(Procedure procedure)
    • dropProcedure

      public void dropProcedure(String name)
    • dropProcedureBySignature

      public void dropProcedureBySignature(String name, List<DataType> argumentTypes)
    • getProcedure

      public Procedure getProcedure(String name)
    • getProcedureBySignature

      public Procedure getProcedureBySignature(String name, List<DataType> argumentTypes)
    • getProcedures

      public List<Procedure> getProcedures()
    • getProcedureOverloads

      public List<Procedure> getProcedureOverloads(String name)
    • addFunction

      public void addFunction(Function function)
    • dropFunction

      public void dropFunction(String name)
    • dropFunctionBySignature

      public void dropFunctionBySignature(String name, List<DataType> argumentTypes)
    • getFunction

      public Function getFunction(String name)
    • getFunctionBySignature

      public Function getFunctionBySignature(String name, List<DataType> argumentTypes)
    • getFunctions

      public List<Function> getFunctions()
    • getFunctionOverloads

      public List<Function> getFunctionOverloads(String name)
    • hasFunctionSignature

      public boolean hasFunctionSignature(String name, List<Parameter> parameters)
      Whether a function of that name already carries this signature (see addFunction(dev.frostlake.metastore.model.Function)).
    • hasProcedureSignature

      public boolean hasProcedureSignature(String name, List<Parameter> parameters)
      Whether a procedure of that name already carries this signature (see addProcedure(dev.frostlake.metastore.model.Procedure)).
    • addStream

      public void addStream(Stream stream)
    • dropStream

      public void dropStream(String name)
    • getStream

      public Stream getStream(String name)
    • getStreams

      public List<Stream> getStreams()
    • addTask

      public void addTask(Task task)
    • dropTask

      public void dropTask(String name)
    • hasTask

      public boolean hasTask(String name)
    • getTask

      public Task getTask(String name)
    • getTasks

      public List<Task> getTasks()
    • addPipe

      public void addPipe(Pipe pipe)
    • dropPipe

      public void dropPipe(String name)
    • getPipe

      public Pipe getPipe(String name)
    • getPipes

      public List<Pipe> getPipes()
    • addSequence

      public void addSequence(Sequence sequence)
    • dropSequence

      public void dropSequence(String name)
    • getSequence

      public Sequence getSequence(String name)
    • getSequences

      public List<Sequence> getSequences()
    • addFileFormat

      public void addFileFormat(FileFormat fileFormat)
    • dropFileFormat

      public void dropFileFormat(String name)
    • getFileFormat

      public FileFormat getFileFormat(String name)
    • hasFileFormat

      public boolean hasFileFormat(String name)
    • getFileFormats

      public List<FileFormat> getFileFormats()
    • clone

      public Schema clone()
      Create a deep clone of this schema Note: Table data cloning must be handled separately at the storage engine level
      Overrides:
      clone in class Object
    • addStage

      public void addStage(Stage stage)
    • dropStage

      public void dropStage(String name)
    • getStage

      public Stage getStage(String name)
    • hasStage

      public boolean hasStage(String name)
    • hasStageExact

      public boolean hasStageExact(String name)
      Whether a stage of EXACTLY this name is here - the check a create makes, where a name that differs only in case is a different stage.
    • getStages

      public List<Stage> getStages()
    • addCortexSearchService

      public void addCortexSearchService(CortexSearchService service)
    • dropCortexSearchService

      public void dropCortexSearchService(String name)
    • getCortexSearchService

      public CortexSearchService getCortexSearchService(String name)
    • hasCortexSearchService

      public boolean hasCortexSearchService(String name)
    • getCortexSearchServices

      public List<CortexSearchService> getCortexSearchServices()
    • addTag

      public void addTag(Tag tag)
    • dropTag

      public void dropTag(String name)
    • getTag

      public Tag getTag(String name)
    • hasTag

      public boolean hasTag(String name)
    • getTags

      public List<Tag> getTags()
    • renameTag

      public void renameTag(String oldName, String newName)
    • rejectNameHeldByOtherKind

      public void rejectNameHeldByOtherKind(String name, RelationKind kind, boolean temporary)
      The kinds that share one namespace in a schema: a table, a view, a materialized view, a dynamic table and a stream (live-verified). A create over a name another of them holds is refused with the holder's kind, Object 'KT' already exists as TABLE, before the body is compiled and before an OR REPLACE drops anything; IF NOT EXISTS does not skip it.

      A TEMPORARY table is the exception: it may take the name of a view, a materialized view or a dynamic table, and it then shadows it. A stream's name it may not take. A TEMPORARY view may take a table's name the same way.

      Parameters:
      name - the name being created
      kind - the kind being created
      temporary - whether the create says TEMPORARY
    • relationKindOf

      public RelationKind relationKindOf(String name)
      The kind holding that name, or null when none of the five does. A temporary object counts: a DROP reaches the session's own objects as a read does.
    • holdsRelation

      public boolean holdsRelation(String name, RelationKind kind)
      Whether that kind holds the name here, a temporary object of it included.
    • hasTemporaryTable

      public boolean hasTemporaryTable(String name)
      Whether a TEMPORARY table of this name is here, shadowing whatever else holds the name.
    • getObjectType

      public String getObjectType()
      Description copied from class: SqlObject
      Get the type of this SQL object (e.g., "TABLE", "VIEW", "DATABASE") Subclasses should override to provide their specific type
      Specified by:
      getObjectType in class SqlObject
      Returns:
      The object type as a string