Class BaseMetastoreCatalog

    • Constructor Detail

      • BaseMetastoreCatalog

        public BaseMetastoreCatalog()
    • Method Detail

      • createTable

        public Table createTable​(TableIdentifier identifier,
                                 Schema schema,
                                 PartitionSpec spec,
                                 java.lang.String location,
                                 java.util.Map<java.lang.String,​java.lang.String> properties)
        Description copied from interface: Catalog
        Create a table.
        Specified by:
        createTable in interface Catalog
        Parameters:
        identifier - a table identifier
        schema - a schema
        spec - a partition spec
        location - a location for the table; leave null if unspecified
        properties - a string map of table properties
        Returns:
        a Table instance
      • newCreateTableTransaction

        public Transaction newCreateTableTransaction​(TableIdentifier identifier,
                                                     Schema schema,
                                                     PartitionSpec spec,
                                                     java.lang.String location,
                                                     java.util.Map<java.lang.String,​java.lang.String> properties)
        Description copied from interface: Catalog
        Start a transaction to create a table.
        Specified by:
        newCreateTableTransaction in interface Catalog
        Parameters:
        identifier - a table identifier
        schema - a schema
        spec - a partition spec
        location - a location for the table; leave null if unspecified
        properties - a string map of table properties
        Returns:
        a Transaction to create the table
      • newReplaceTableTransaction

        public Transaction newReplaceTableTransaction​(TableIdentifier identifier,
                                                      Schema schema,
                                                      PartitionSpec spec,
                                                      java.lang.String location,
                                                      java.util.Map<java.lang.String,​java.lang.String> properties,
                                                      boolean orCreate)
        Description copied from interface: Catalog
        Start a transaction to replace a table.
        Specified by:
        newReplaceTableTransaction in interface Catalog
        Parameters:
        identifier - a table identifier
        schema - a schema
        spec - a partition spec
        location - a location for the table; leave null if unspecified
        properties - a string map of table properties
        orCreate - whether to create the table if not exists
        Returns:
        a Transaction to replace the table
      • loadTable

        public Table loadTable​(TableIdentifier identifier)
        Description copied from interface: Catalog
        Load a table.
        Specified by:
        loadTable in interface Catalog
        Parameters:
        identifier - a table identifier
        Returns:
        instance of Table implementation referred by tableIdentifier
      • isValidIdentifier

        protected boolean isValidIdentifier​(TableIdentifier tableIdentifier)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • name

        protected abstract java.lang.String name()
      • defaultWarehouseLocation

        protected abstract java.lang.String defaultWarehouseLocation​(TableIdentifier tableIdentifier)
      • dropTableData

        protected static void dropTableData​(FileIO io,
                                            TableMetadata metadata)
        Drops all data and metadata files referenced by TableMetadata.

        This should be called by dropTable implementations to clean up table files once the table has been dropped in the metastore.

        Parameters:
        io - a FileIO to use for deletes
        metadata - the last valid TableMetadata instance for a dropped table.
      • fullTableName

        protected static java.lang.String fullTableName​(java.lang.String catalogName,
                                                        TableIdentifier identifier)