# Example of Running Trino and Hive Jobs in Coordination Within Workflow

## Prerequisites

1. Download the sample project


```bash
cd ~/Downloads

curl -o nasdaq_analysis.zip \
-L https://gist.github.com/danielnorberg/f839e5f2fd0d1a27d63001f4fd19b947/raw/d2d6dd0e3d419ea5d18b1c1e7ded9ec106c775d4/nasdaq_analysis.zip
```

1. Extract the downloaded project


```bash
unzip nasdaq_analysis.zip
```

1. Enter the workflow project directory


```bash
cd nasdaq_analysis
```

## Review Workflow

As a reminder, here is the workflow from the introductory tutorial that you will be modifying.

```yaml
timezone: UTC

schedule:
  daily>: 07:00:00

_export:
  td:
    database: workflow_temp

+task1:
  td>: queries/daily_open.sql
  create_table: daily_open

+task2:
  td>: queries/monthly_open.sql
  create_table: monthly_open
```

## Run the Workflow As Is

Go to your Treasure Data jobs page, so you can follow along as you run the following workflows. You can access the page here: https://console.treasuredata.com/jobs

Go into the `nasdaq_analysis` directory, and run the following command.

```bash
td wf run --all
```

Include `--all` to make sure that you can run the workflow even if you ran it previously. Treasure Workflows automatically remembers that it has run successfully, and shouldn't need to be run again. You can overwrite this condition by including this condition.

You should see the following job runs in your account.

![](/assets/workflow-presto-presto.e1ceb441d034b86aff2711ecd2bebbaeb97417c256a838bd561a5f6983dbe6a6.142841d8.png)

## Modify So the Dependent Task Executes a Hive Job

Having a query run on Hive is as simple as adding an extra parameter. Modify your workflow file with the following addition of `engine: hive` as a parameter to +task2.

```yaml
+task2:
  td>: queries/monthly_open.sql
  create_table: monthly_open
  engine: hive
```

## Run the Query of the Modified Workflow

```bash
td wf run --all
```

![](/assets/workflow-presto-hive.0a0c9f437f11e08e77a07c0bcc1d7c791de7c7a87e5197d98abfc9c59449356c.142841d8.png)

## Additional Trino and Hive Resources

Reference information can be found here:

* [Treasure Data Hive Function Reference](/products/customer-data-platform/data-workbench/queries/sql-reference/td_hive_function_reference)
* [Hivemall Function Reference](/products/customer-data-platform/data-workbench/queries/sql-reference/td_hivemall_reference)
* [Treasure Data Trino Function Reference](/products/customer-data-platform/data-workbench/queries/sql-reference/td_trino_function_reference)


Additional [Hive documentation](/products/customer-data-platform/data-workbench/queries/hive/quickstart) and [Trino documentation](/products/customer-data-platform/data-workbench/queries/trino/quickstart)