Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala
Original file line number Diff line number Diff line change
Expand Up @@ -775,25 +775,25 @@ class SQLContext(@transient val sparkContext: SparkContext)
DataFrame(this, catalog.lookupRelation(Seq(tableName)))

/**
* Returns a [[DataFrame]] containing names of existing tables in the given database.
* The returned DataFrame has two columns, tableName and isTemporary (a column with BooleanType
* Returns a [[DataFrame]] containing names of existing tables in the current database.
* The returned DataFrame has two columns, tableName and isTemporary (a Boolean
* indicating if a table is a temporary one or not).
*/
def tables(): DataFrame = {
createDataFrame(catalog.getTables(None)).toDataFrame("tableName", "isTemporary")
}

/**
* Returns a [[DataFrame]] containing names of existing tables in the current database.
* The returned DataFrame has two columns, tableName and isTemporary (a column with BooleanType
* Returns a [[DataFrame]] containing names of existing tables in the given database.
* The returned DataFrame has two columns, tableName and isTemporary (a Boolean
* indicating if a table is a temporary one or not).
*/
def tables(databaseName: String): DataFrame = {
createDataFrame(catalog.getTables(Some(databaseName))).toDataFrame("tableName", "isTemporary")
}

/**
* Returns an array of names of tables in the current database.
* Returns the names of tables in the current database as an array.
*/
def tableNames(): Array[String] = {
catalog.getTables(None).map {
Expand All @@ -802,7 +802,7 @@ class SQLContext(@transient val sparkContext: SparkContext)
}

/**
* Returns an array of names of tables in the given database.
* Returns the names of tables in the given database as an array.
*/
def tableNames(databaseName: String): Array[String] = {
catalog.getTables(Some(databaseName)).map {
Expand Down