Catalog interface for Spark. To access this, use SparkSession.catalog.

1.0.0

Kent Yao yao@apache.org

  const spark = await SparkSession.builder().appName("catalog").getOrCreate();
const catalog = spark.catalog;
const currentDatabase = await catalog.currentDatabase();
console.log(currentDatabase);

Constructors

Properties

Methods

  • Returns the current database (namespace) in this session.

    Returns Promise<string>

    A Promise that resolves with the current database name.

  • Sets the current database (namespace) in this session.

    Parameters

    • dbName: string

      The database name to set as the current database.

    Returns Promise<void>

    A Promise that resolves with no value.

  • Get the database (namespace) with the specified name (can be qualified with catalog). This throws an AnalysisException when the database (namespace) cannot be found.

    Parameters

    • dbName: string

      The name of the database to get.

    Returns Promise<Database>

    A Promise that resolves with the database.

  • Check if the database with the specified name exists.

    Parameters

    • dbName: string

      The name of the database to check.

    Returns Promise<boolean>

    A Promise that resolves with a boolean indicating if the database exists.