Package org.apache.spark.sql.catalog
Class Catalog
- Inheritdoc:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateExternalTable(String tableName, String path) Creates a table from the given path and returns the corresponding DataFrame.createExternalTable(String tableName, String path, String source) Creates a table from the given path based on a data source and returns the corresponding DataFrame.Creates a table from the given path based on a data source and a set of options.createExternalTable(String tableName, String source, StructType schema, Map<String, String> options) Create a table from the given path based on a data source, a schema and a set of options.createExternalTable(String tableName, String source, StructType schema, scala.collection.immutable.Map<String, String> options) (Scala-specific) Create a table from the given path based on a data source, a schema and a set of options.createExternalTable(String tableName, String source, scala.collection.immutable.Map<String, String> options) (Scala-specific) Creates a table from the given path based on a data source and a set of options.createTable(String tableName, String path) Creates a table from the given path and returns the corresponding DataFrame.createTable(String tableName, String path, String source) Creates a table from the given path based on a data source and returns the corresponding DataFrame.Creates a table based on the dataset in a data source and a set of options.createTable(String tableName, String source, String description, scala.collection.immutable.Map<String, String> options) (Scala-specific) Creates a table based on the dataset in a data source and a set of options.Creates a table based on the dataset in a data source and a set of options.createTable(String tableName, String source, StructType schema, String description, Map<String, String> options) Create a table based on the dataset in a data source, a schema and a set of options.createTable(String tableName, String source, StructType schema, String description, scala.collection.immutable.Map<String, String> options) (Scala-specific) Create a table based on the dataset in a data source, a schema and a set of options.createTable(String tableName, String source, StructType schema, Map<String, String> options) Create a table based on the dataset in a data source, a schema and a set of options.createTable(String tableName, String source, StructType schema, scala.collection.immutable.Map<String, String> options) (Scala-specific) Create a table based on the dataset in a data source, a schema and a set of options.createTable(String tableName, String source, scala.collection.immutable.Map<String, String> options) (Scala-specific) Creates a table based on the dataset in a data source and a set of options.abstract Dataset<CatalogMetadata>Returns a list of catalogs available in this session.abstract Dataset<CatalogMetadata>listCatalogs(String pattern) Returns a list of catalogs which name match the specify pattern and available in this session.listColumns(String tableName) Returns a list of columns for the given table/view or temporary view.listColumns(String dbName, String tableName) Returns a list of columns for the given table/view in the specified database under the Hive Metastore.Returns a list of databases (namespaces) available within the current catalog.listDatabases(String pattern) Returns a list of databases (namespaces) which name match the specify pattern and available within the current catalog.Returns a list of functions registered in the current database (namespace).listFunctions(String dbName) Returns a list of functions registered in the specified database (namespace) (the name can be qualified with catalog).listFunctions(String dbName, String pattern) Returns a list of functions registered in the specified database (namespace) which name match the specify pattern (the name can be qualified with catalog).Returns a list of tables/views in the current database (namespace).listTables(String dbName) Returns a list of tables/views in the specified database (namespace) (the name can be qualified with catalog).listTables(String dbName, String pattern) Returns a list of tables/views in the specified database (namespace) which name match the specify pattern (the name can be qualified with catalog).Methods inherited from class org.apache.spark.sql.api.Catalog
cacheTable, cacheTable, clearCache, currentCatalog, currentDatabase, databaseExists, dropGlobalTempView, dropTempView, functionExists, functionExists, getDatabase, getFunction, getFunction, getTable, getTable, isCached, recoverPartitions, refreshByPath, refreshTable, setCurrentCatalog, setCurrentDatabase, tableExists, tableExists, uncacheTable
-
Constructor Details
-
Catalog
public Catalog()
-
-
Method Details
-
createExternalTable
Description copied from class:CatalogCreates a table from the given path and returns the corresponding DataFrame. It will use the default data source configured by spark.sql.sources.default.- Overrides:
createExternalTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.path- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createExternalTable
Description copied from class:CatalogCreates a table from the given path based on a data source and returns the corresponding DataFrame.- Overrides:
createExternalTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.path- (undocumented)source- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createExternalTable
public Dataset<Row> createExternalTable(String tableName, String source, Map<String, String> options) Description copied from class:CatalogCreates a table from the given path based on a data source and a set of options. Then, returns the corresponding DataFrame.- Overrides:
createExternalTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createExternalTable
public Dataset<Row> createExternalTable(String tableName, String source, scala.collection.immutable.Map<String, String> options) Description copied from class:Catalog(Scala-specific) Creates a table from the given path based on a data source and a set of options. Then, returns the corresponding DataFrame.- Overrides:
createExternalTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createExternalTable
public Dataset<Row> createExternalTable(String tableName, String source, StructType schema, Map<String, String> options) Description copied from class:CatalogCreate a table from the given path based on a data source, a schema and a set of options. Then, returns the corresponding DataFrame.- Overrides:
createExternalTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)schema- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createExternalTable
public Dataset<Row> createExternalTable(String tableName, String source, StructType schema, scala.collection.immutable.Map<String, String> options) Description copied from class:Catalog(Scala-specific) Create a table from the given path based on a data source, a schema and a set of options. Then, returns the corresponding DataFrame.- Overrides:
createExternalTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)schema- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createTable
Description copied from class:CatalogCreates a table from the given path and returns the corresponding DataFrame. It will use the default data source configured by spark.sql.sources.default.- Specified by:
createTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.path- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createTable
Description copied from class:CatalogCreates a table from the given path based on a data source and returns the corresponding DataFrame.- Specified by:
createTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.path- (undocumented)source- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createTable
public abstract Dataset<Row> createTable(String tableName, String source, scala.collection.immutable.Map<String, String> options) Description copied from class:Catalog(Scala-specific) Creates a table based on the dataset in a data source and a set of options. Then, returns the corresponding DataFrame.- Specified by:
createTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createTable
public abstract Dataset<Row> createTable(String tableName, String source, String description, scala.collection.immutable.Map<String, String> options) Description copied from class:Catalog(Scala-specific) Creates a table based on the dataset in a data source and a set of options. Then, returns the corresponding DataFrame.- Specified by:
createTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)description- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createTable
public abstract Dataset<Row> createTable(String tableName, String source, StructType schema, scala.collection.immutable.Map<String, String> options) Description copied from class:Catalog(Scala-specific) Create a table based on the dataset in a data source, a schema and a set of options. Then, returns the corresponding DataFrame.- Specified by:
createTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)schema- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createTable
public abstract Dataset<Row> createTable(String tableName, String source, StructType schema, String description, scala.collection.immutable.Map<String, String> options) Description copied from class:Catalog(Scala-specific) Create a table based on the dataset in a data source, a schema and a set of options. Then, returns the corresponding DataFrame.- Specified by:
createTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)schema- (undocumented)description- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createTable
Description copied from class:CatalogCreates a table based on the dataset in a data source and a set of options. Then, returns the corresponding DataFrame.- Overrides:
createTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createTable
public Dataset<Row> createTable(String tableName, String source, String description, Map<String, String> options) Description copied from class:CatalogCreates a table based on the dataset in a data source and a set of options. Then, returns the corresponding DataFrame.- Overrides:
createTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)description- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createTable
public Dataset<Row> createTable(String tableName, String source, StructType schema, Map<String, String> options) Description copied from class:CatalogCreate a table based on the dataset in a data source, a schema and a set of options. Then, returns the corresponding DataFrame.- Overrides:
createTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)schema- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
createTable
public Dataset<Row> createTable(String tableName, String source, StructType schema, String description, Map<String, String> options) Description copied from class:CatalogCreate a table based on the dataset in a data source, a schema and a set of options. Then, returns the corresponding DataFrame.- Overrides:
createTablein classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table. If no database identifier is provided, it refers to a table in the current database.source- (undocumented)schema- (undocumented)description- (undocumented)options- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
listCatalogs
Description copied from class:CatalogReturns a list of catalogs available in this session.- Specified by:
listCatalogsin classCatalog<Dataset>- Returns:
- (undocumented)
- Inheritdoc:
-
listCatalogs
Description copied from class:CatalogReturns a list of catalogs which name match the specify pattern and available in this session.- Specified by:
listCatalogsin classCatalog<Dataset>- Parameters:
pattern- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
listColumns
Description copied from class:CatalogReturns a list of columns for the given table/view or temporary view.- Specified by:
listColumnsin classCatalog<Dataset>- Parameters:
tableName- is either a qualified or unqualified name that designates a table/view. It follows the same resolution rule with SQL: search for temp views first then table/views in the current database (namespace).- Returns:
- (undocumented)
- Inheritdoc:
-
listColumns
Description copied from class:CatalogReturns a list of columns for the given table/view in the specified database under the Hive Metastore.To list columns for table/view in other catalogs, please use
listColumns(tableName)with qualified table/view name instead.- Specified by:
listColumnsin classCatalog<Dataset>- Parameters:
dbName- is an unqualified name that designates a database.tableName- is an unqualified name that designates a table/view.- Returns:
- (undocumented)
- Inheritdoc:
-
listDatabases
Description copied from class:CatalogReturns a list of databases (namespaces) available within the current catalog.- Specified by:
listDatabasesin classCatalog<Dataset>- Returns:
- (undocumented)
- Inheritdoc:
-
listDatabases
Description copied from class:CatalogReturns a list of databases (namespaces) which name match the specify pattern and available within the current catalog.- Specified by:
listDatabasesin classCatalog<Dataset>- Parameters:
pattern- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
listFunctions
Description copied from class:CatalogReturns a list of functions registered in the current database (namespace). This includes all temporary functions.- Specified by:
listFunctionsin classCatalog<Dataset>- Returns:
- (undocumented)
- Inheritdoc:
-
listFunctions
Description copied from class:CatalogReturns a list of functions registered in the specified database (namespace) (the name can be qualified with catalog). This includes all built-in and temporary functions.- Specified by:
listFunctionsin classCatalog<Dataset>- Parameters:
dbName- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
listFunctions
Description copied from class:CatalogReturns a list of functions registered in the specified database (namespace) which name match the specify pattern (the name can be qualified with catalog). This includes all built-in and temporary functions.- Specified by:
listFunctionsin classCatalog<Dataset>- Parameters:
dbName- (undocumented)pattern- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
listTables
Description copied from class:CatalogReturns a list of tables/views in the current database (namespace). This includes all temporary views.- Specified by:
listTablesin classCatalog<Dataset>- Returns:
- (undocumented)
- Inheritdoc:
-
listTables
Description copied from class:CatalogReturns a list of tables/views in the specified database (namespace) (the name can be qualified with catalog). This includes all temporary views.- Specified by:
listTablesin classCatalog<Dataset>- Parameters:
dbName- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-
listTables
Description copied from class:CatalogReturns a list of tables/views in the specified database (namespace) which name match the specify pattern (the name can be qualified with catalog). This includes all temporary views.- Specified by:
listTablesin classCatalog<Dataset>- Parameters:
dbName- (undocumented)pattern- (undocumented)- Returns:
- (undocumented)
- Inheritdoc:
-