Queries can be created in the TD Console through the query editor in Data Workbench using the Presto or Hive query engines.

In the TD Console, select the Data Workbench icon.

Select Queries to go to the query editor. You can see a list of previous queries and when they were run. This list is useful if you want to edit or rerun a specific query.

You can also use the Queries page to create a new query.

  1. Select NEW QUERY on the top right of the TD Console to open the query editor.

    After you have opened the query editor, you will see that you have two options for querying the data—Presto and Hive, depending on the use case, the size and type of the query, you will choose which query engine to use.

    Presto is better for ad hoc and shorter batch workloads. Presto provides low-latency SQL access to the data set.

    Hive is better for large or complex batch workloads. Hive is a MapReduce-based SQL engine. This engine is really powerful when you do large data processing and heavy JOINs. Often used for ETL or sessionization.

  2. Select the appropriate query engine option in the drop down menu.

  3. Select the database you want to query.

  4. Select the tables from which you want to query.

  5. Specify if you would like to run it on a regular recurring schedule or just once.

  6. Create your specific query using the appropriate SQL syntax for Presto or Hive. You may preview any table under Table Preview.

  7. Select Save if you want to run it at a later date or select Run if you want to run it immediately.

  8. After the query has run, you see the results under Query Result. You now have the option to Copy or Download the results.

In the query editor, you also have the option to Export Results to various analytics tools. You can also see the history of the query under Run History.

  • No labels