Managing Project Workspaces in Hadoop
Audience: Data Users
Content Summary: This page details how to use the Immuta project workspace in Hive and Impala.
Writing Data to the Workspace
You can write data to a project workspace within an ImmutaSparkSession. Note that you must be acting within the context of a project in order to write to that project's workspace.
In the example below, the consumer1
user is acting under the project Taxi Research
, which contains purpose-restricted Impala data sources: NYC Taxi Trip
and NYC Taxi Fare
. This user will query these data sources from the ImmutaSparkSession and write the resulting DataFrame to parquet files in the Taxi Research
workspace at /user/immuta/workspace/Taxi_Research
.
The user can then verify that the data was written:
Creating a Derived Data Source from Workspace Data
Data written to the project workspace can be easily exposed as a derived data source within the project.
Continuing from the example in the previous section, consumer1
can log in to the Immuta Web UI and start creating a derived data source by navigating to the Overview tab and clicking Create under Create Derived Data Source.
A modal will appear, prompting the user to select the data source(s) that the data was derived from. In this case, the data was derived from NYC Taxi Fare
.
Next, the user will need to enter the path where the data is stored and select the desired backing technology of the derived data source. In this case, the data is stored under /user/immuta/workspace/Taxi_Research/fare_total_sample
.
After the derived data source is created, other members of the project will be able to subscribe to it in the Immuta Web UI and query the data from the project workspace.
Creating a Table in Hive or Impala from Workspace Data without a Derived Data Source
Although best practices dictate that new tables in a project workspace database should be created via derived data sources, users can opt to manually create working tables in the database using Hive or Impala. In this case, users can leverage CREATE TABLE
or CREATE EXTERNAL TABLE
statements. An example for creating the fare_total_sample
table using this method is below.
Querying Workspace Data Natively from Hive or Impala
The native workspace enables users to query data from an Immuta project natively from Hive or Impala, as opposed to using the Immuta Query Engine or the ImmutaSparkSession.
Immuta will manage the Sentry permissions for project users, allowing them to access a database in the Hive Metastore that corresponds to their active project context. In the example below, a project user connects directly to Impala and queries a derived data source table in the taxi_research
project database. Note that this is only possible when the user is acting under the Taxi Research
project context.
Last updated