> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nx1cloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a lakehouse data transformation rule

> Create a lakehouse transformation rule to transform Iceberg catalog data and schedule Airflow jobs.

Data transformation and preparation rules modify data to meet specific goals. This could include a rule to summarize the data,
remove duplicate rows, or convert the data format.

Unlike a federated rule, a lakehouse rule is specific to an Iceberg catalog.

## Prerequisites

* Appropriate permission: `nx1_engineer`
* A previously ingested dataset

## Select a dataset and describe a transformation rule

<Tabs>
  <Tab title="Web portal" icon="browser">
    The catalog contains metadata about the schema and table.
    The schema describes the data structure, such as the table name, column names, and data types. The table contains the data.

    1. Log in to NexusOne.
    2. On the top navigation bar, hover your mouse over **Data Pipeline** and then select **Engineer**.
    3. Click **Lakehouse**. Default is an Iceberg catalog.
    4. Select a schema and table.

    You describe a rule using natural language so NexusOne can generate an SQL query.

    1. Enter a transformation job name.
    2. Enter a natural language transformation prompt.
    3. Optional: Select the **Show preview?** checkbox if you'd like a preview of your data after running the generated query from the prompt input you have provided.
    4. Click **Transform**. If you selected the preview checkbox in the previous step, then click **Finalize** to proceed to the next step.
  </Tab>

  <Tab title="CLI" icon="square-terminal">
    Use the following `nx1` command to [ask and generate a data engineering query](/cli-reference/nx1/ask).
  </Tab>

  <Tab title="REST API" icon="code">
    Use the following API endpoint to [ask and generate a data engineering query](/api-reference/endpoints/data-engineering/ask-eng).
  </Tab>
</Tabs>

## Schedule a transformation rule

<Tabs>
  <Tab title="Web portal" icon="browser">
    Scheduling a rule allows you to run the rule at specific time intervals using Apache AirFlow.

    1. Select a destination schema.
    2. Select a destination table.
    3. Optional: Select a [DataHub](/platform-components/datahub/datahub-in-nx1) domain.
    4. Optional: Select or create one or more tags to label this rule.
    5. Select a time interval for how often the transformation rule should run.
       Schedule options include `None`, `Every 3 hours`, `Daily`, `Weekly`, `Monthly`, and `Quarterly`. On the first schedule,
       the job/DAG on Apache Airflow automatically runs. Recurrent runs depend on your selected schedule option.
    6. Select a mode for how to store incoming records at the destination table.
       * **Append**: Add new records.
       * **Merge**: Add or update existing records where applicable.
       * **Overwrite**: Replace all existing records.
    7. Click **Schedule**.
  </Tab>

  <Tab title="REST API" icon="code">
    Use the following API endpoint to [schedule a query](/api-reference/endpoints/data-engineering/schedule-query).
  </Tab>
</Tabs>

## Monitor, trigger, or delete a job

<Tabs>
  <Tab title="Web portal" icon="browser">
    When you schedule a rule, it runs as a job in Apache Airflow.
    You can monitor, trigger, or delete the job.

    1. When you schedule a rule, a **View your job** button appears.
    2. Track the job status by clicking **View your job** or navigate to the NexusOne homepage and click **Monitor**.
    3. Use the three dots `...` menu to trigger or delete a job.
    4. If you clicked **Trigger job**, then click the job's name to open its DAG details in Airflow's portal.
  </Tab>

  <Tab title="CLI" icon="square-terminal">
    Use the following `nx1` command to:

    * [View all jobs](/cli-reference/nx1/jobs#list).
    * [View a job](/cli-reference/nx1/jobs#get).
    * [Trigger a job](/cli-reference/nx1/jobs#trigger).
    * [Delete a job](/cli-reference/nx1/jobs#delete).
  </Tab>

  <Tab title="REST API" icon="code">
    Use the following API endpoints to:

    * [View all jobs](/api-reference/endpoints/jobs/get-jobs).
    * [View a job](/api-reference/endpoints/jobs/get-job).
    * [Trigger a job](/api-reference/endpoints/jobs/trigger-job).
    * [Delete a job](/api-reference/endpoints/jobs/delete-job).
  </Tab>
</Tabs>

## Additional resources

* For general instructions about how to ingest a file in NexusOne, refer to [How to ingest a file](/documentation/data-pipeline/tasks/ingest/ingest-a-file).
* For more information about the monitoring feature, refer to [Monitor Overview](/documentation/platform/overview/monitor).
* For more information about roles or permissions, refer to [Govern Overview](/documentation/govern/overview).
