Skip to content

Run EMR Trino CLI

  1. SSH to the master node

    Bash
    ssh your_user@<emr-master-node>
    

  2. Start the Trino CLI

    Bash
    trino-cli --catalog hive
    

  3. Validate access by running a basic query

    After you enter the Trino CLI, run a simple query such as creating a schema:

    SQL
    CREATE SCHEMA IF NOT EXISTS <schema_name>
    
    To create schema, you need to configure a policy in Privacera Portal with the following steps:

    1. Navigate to the Privacera Portal.
    2. Go to Access ManagementResourrce Policies.
    3. Select the privacera_hive service.
    4. Click Add New Policy (or edit an existing policy, if applicable).

    The following is an example policy configuration

    Sample Resource Policy:

    • Policy Name: <name of the policy>
    • Hive Database: <schema_name>
    • Permissions: <create>
    • User/Group/Role: <assign your user/group/role>

Expected Behavior

The query execution demonstrates access control enforcement:

  • If the user has the required permissions:

    The query executes successfully and the schema is created.