Skip to content

Commit

Permalink
Take into account current database in table methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Or committed Mar 16, 2016
1 parent 5bf695c commit 39a153c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,13 @@ abstract class SessionCatalog(catalog: ExternalCatalog) {
// sessions as their metadata is persisted in the underlying catalog.
// ----------------------------------------------------------------------------

// Methods that interact with metastore tables only.
// ----------------------------------------------------
// | Methods that interact with metastore tables only |
// ----------------------------------------------------

/**
* Create a metastore table in the database specified in `tableDefinition`.
* If no such table is specified, create it in the current database.
* If no such database is specified, create it in the current database.
*/
def createTable(
currentDb: String,
Expand All @@ -78,17 +80,23 @@ abstract class SessionCatalog(catalog: ExternalCatalog) {
/**
* Alter the metadata of an existing metastore table identified by `tableDefinition`.
*
* If no database is specified in `tableDefinition`, assume the table is in the
* current database.
*
* Note: If the underlying implementation does not support altering a certain field,
* this becomes a no-op.
*/
def alterTable(tableDefinition: CatalogTable): Unit
def alterTable(currentDb: String, tableDefinition: CatalogTable): Unit

/**
* Retrieve the metadata of an existing metastore table.
* If no database is specified, assume the table is in the current database.
*/
def getTable(name: TableIdentifier): CatalogTable
def getTable(currentDb: String, name: TableIdentifier): CatalogTable

// Methods that interact with temporary tables and metastore tables.
// -------------------------------------------------------------
// | Methods that interact with temporary and metastore tables |
// -------------------------------------------------------------

/**
* Create a temporary table.
Expand Down Expand Up @@ -208,7 +216,9 @@ abstract class SessionCatalog(catalog: ExternalCatalog) {
// their metadata is persisted in the underlying catalog.
// ----------------------------------------------------------------------------

// Methods that interact with metastore functions only.
// -------------------------------------------------------
// | Methods that interact with metastore functions only |
// -------------------------------------------------------

def createFunction(currentDb: String, funcDefinition: CatalogFunction): Unit

Expand All @@ -223,7 +233,9 @@ abstract class SessionCatalog(catalog: ExternalCatalog) {
*/
def alterFunction(currentDb: String, funcDefinition: CatalogFunction): Unit

// Methods that interact with temporary functions and metastore functions.
// ----------------------------------------------------------------
// | Methods that interact with temporary and metastore functions |
// ----------------------------------------------------------------

def createTempFunction(funcDefinition: CatalogFunction): Unit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ case class CatalogTablePartition(
* future once we have a better understanding of how we want to handle skewed columns.
*/
case class CatalogTable(
// TODO: just use TableIdentifier here
specifiedDatabase: Option[String],
name: String,
tableType: CatalogTableType,
Expand Down

0 comments on commit 39a153c

Please sign in to comment.