Project UDFs (Databricks)

You can switch project contexts and view a list of your current project or available projects through UDFs in Spark.

Available functions

Virtual tables

To view a list of your current project or available projects in a Spark job, you can query these virtual tables.

Switch Your Project Using UDFs

  1. View your available projects by running the following query in Spark: select * from immuta.list_projects. In the resulting table, note the values listed in the id column; this value will be used at the parameter in the following step.

  2. Run select immuta.set_current_project(<id>). This UDF must be called in its own notebook cell to ensure the changes take effect.

Your project context will be switched, and that project's data sources and workspaces will now be visible. To set your project context to None, run select immuta.set_current_project() with no parameters.

Note: Since the UDFs are not actually registered with the FunctionRegistry, if you call DESCRIBE FUNCTION immuta.set_current_project, you won't get back the documentation for the UDF.

Copyright © 2014-2024 Immuta Inc. All rights reserved.