public class CatalogImpl extends Catalog
Catalog.| Constructor and Description |
|---|
CatalogImpl(SparkSession sparkSession) |
| Modifier and Type | Method and Description |
|---|---|
void |
cacheTable(java.lang.String tableName)
Caches the specified table in-memory.
|
void |
clearCache()
Removes all cached tables from the in-memory cache.
|
Dataset<Row> |
createExternalTable(java.lang.String tableName,
java.lang.String path)
:: Experimental ::
Creates an external table from the given path and returns the corresponding DataFrame.
|
Dataset<Row> |
createExternalTable(java.lang.String tableName,
java.lang.String source,
java.util.Map<java.lang.String,java.lang.String> options)
:: Experimental ::
Creates an external table from the given path based on a data source and a set of options.
|
Dataset<Row> |
createExternalTable(java.lang.String tableName,
java.lang.String source,
scala.collection.immutable.Map<java.lang.String,java.lang.String> options)
:: Experimental ::
(Scala-specific)
Creates an external table from the given path based on a data source and a set of options.
|
Dataset<Row> |
createExternalTable(java.lang.String tableName,
java.lang.String path,
java.lang.String source)
:: Experimental ::
Creates an external table from the given path based on a data source
and returns the corresponding DataFrame.
|
Dataset<Row> |
createExternalTable(java.lang.String tableName,
java.lang.String source,
StructType schema,
java.util.Map<java.lang.String,java.lang.String> options)
:: Experimental ::
Create an external table from the given path based on a data source, a schema and
a set of options.
|
Dataset<Row> |
createExternalTable(java.lang.String tableName,
java.lang.String source,
StructType schema,
scala.collection.immutable.Map<java.lang.String,java.lang.String> options)
:: Experimental ::
(Scala-specific)
Create an external table from the given path based on a data source, a schema and
a set of options.
|
java.lang.String |
currentDatabase()
Returns the current default database in this session.
|
void |
dropTempView(java.lang.String viewName)
Drops the temporary view with the given view name in the catalog.
|
protected boolean |
isCached(Dataset<?> qName)
Returns true if the
Dataset is currently cached in-memory. |
boolean |
isCached(java.lang.String tableName)
Returns true if the table is currently cached in-memory.
|
Dataset<Column> |
listColumns(java.lang.String tableName)
Returns a list of columns for the given table in the current database.
|
Dataset<Column> |
listColumns(java.lang.String dbName,
java.lang.String tableName)
Returns a list of columns for the given table in the specified database.
|
Dataset<Database> |
listDatabases()
Returns a list of databases available across all sessions.
|
Dataset<Function> |
listFunctions()
Returns a list of functions registered in the current database.
|
Dataset<Function> |
listFunctions(java.lang.String dbName)
Returns a list of functions registered in the specified database.
|
Dataset<Table> |
listTables()
Returns a list of tables in the current database.
|
Dataset<Table> |
listTables(java.lang.String dbName)
Returns a list of tables in the specified database.
|
static <T extends org.apache.spark.sql.catalyst.DefinedByConstructorParams> |
makeDataset(scala.collection.Seq<T> data,
SparkSession sparkSession,
scala.reflect.api.TypeTags.TypeTag<T> evidence$1) |
void |
setCurrentDatabase(java.lang.String dbName)
Sets the current default database in this session.
|
void |
uncacheTable(java.lang.String tableName)
Removes the specified table from the in-memory cache.
|
public CatalogImpl(SparkSession sparkSession)
public static <T extends org.apache.spark.sql.catalyst.DefinedByConstructorParams> Dataset<T> makeDataset(scala.collection.Seq<T> data, SparkSession sparkSession, scala.reflect.api.TypeTags.TypeTag<T> evidence$1)
public java.lang.String currentDatabase()
currentDatabase in class Catalogpublic void setCurrentDatabase(java.lang.String dbName)
throws AnalysisException
setCurrentDatabase in class CatalogdbName - (undocumented)AnalysisExceptionpublic Dataset<Database> listDatabases()
listDatabases in class Catalogpublic Dataset<Table> listTables()
listTables in class Catalogpublic Dataset<Table> listTables(java.lang.String dbName) throws AnalysisException
listTables in class CatalogdbName - (undocumented)AnalysisExceptionpublic Dataset<Function> listFunctions()
listFunctions in class Catalogpublic Dataset<Function> listFunctions(java.lang.String dbName) throws AnalysisException
listFunctions in class CatalogdbName - (undocumented)AnalysisExceptionpublic Dataset<Column> listColumns(java.lang.String tableName) throws AnalysisException
listColumns in class CatalogtableName - (undocumented)AnalysisExceptionpublic Dataset<Column> listColumns(java.lang.String dbName, java.lang.String tableName) throws AnalysisException
listColumns in class CatalogdbName - (undocumented)tableName - (undocumented)AnalysisExceptionpublic Dataset<Row> createExternalTable(java.lang.String tableName, java.lang.String path)
createExternalTable in class CatalogtableName - (undocumented)path - (undocumented)public Dataset<Row> createExternalTable(java.lang.String tableName, java.lang.String path, java.lang.String source)
createExternalTable in class CatalogtableName - (undocumented)path - (undocumented)source - (undocumented)public Dataset<Row> createExternalTable(java.lang.String tableName, java.lang.String source, java.util.Map<java.lang.String,java.lang.String> options)
createExternalTable in class CatalogtableName - (undocumented)source - (undocumented)options - (undocumented)public Dataset<Row> createExternalTable(java.lang.String tableName, java.lang.String source, scala.collection.immutable.Map<java.lang.String,java.lang.String> options)
createExternalTable in class CatalogtableName - (undocumented)source - (undocumented)options - (undocumented)public Dataset<Row> createExternalTable(java.lang.String tableName, java.lang.String source, StructType schema, java.util.Map<java.lang.String,java.lang.String> options)
createExternalTable in class CatalogtableName - (undocumented)source - (undocumented)schema - (undocumented)options - (undocumented)public Dataset<Row> createExternalTable(java.lang.String tableName, java.lang.String source, StructType schema, scala.collection.immutable.Map<java.lang.String,java.lang.String> options)
createExternalTable in class CatalogtableName - (undocumented)source - (undocumented)schema - (undocumented)options - (undocumented)public void dropTempView(java.lang.String viewName)
dropTempView in class CatalogviewName - the name of the view to be dropped.public boolean isCached(java.lang.String tableName)
public void cacheTable(java.lang.String tableName)
cacheTable in class CatalogtableName - (undocumented)public void uncacheTable(java.lang.String tableName)
uncacheTable in class CatalogtableName - (undocumented)public void clearCache()
clearCache in class Catalogprotected boolean isCached(Dataset<?> qName)
Dataset is currently cached in-memory.
qName - (undocumented)