{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"redocly_category":"Products","product_name":"Data Workbench","type":"markdown"},"seo":{"title":"Hive Quickstart","description":"Treasure Data Product Documentation · Collect and Unify · Segment and Activate · Experiment and Analyze · Decisioning Automate with AI Scale and Trust.","siteUrl":"https://docs.treasuredata.com","lang":"en-US","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"hive-quickstart","__idx":0},"children":["Hive Quickstart"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://hive.apache.org/"},"children":["Apache Hive"]}," is a data warehouse system built on top of"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://hadoop.apache.org"},"children":["Apache Hadoop"]}," that facilitates easy data summarization,"," ","ad-hoc queries, and the analysis of large datasets stored in various databases and"," ","file systems that integrate with Hadoop."," ","Hive offers a simple way to apply structure to large amounts of unstructured data"," ","and then perform batch SQL-like queries on that data."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Treasure Data Hive service (TD Hive) provides batch data processing on data stored in Treasure Data’s data lake,"," ","based on Apache Hive. Treasure Data operates compute clusters for running Hive jobs."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Customer Data Platform (CDP) application uses Hive jobs for some of its internal operations,"," ","and you can also run your own Hive jobs. You can submit SELECT or DML queries using the Hive query language (HiveQL),"," ","using Treasure Console, API calls, the TD Toolbelt, or from Treasure workflows. The service queues, executes the queries,"," ","and returns the results. You can also design your system so that results are delivered to destinations"," ","specified in your Result Output."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"apache-hive-and-td-hive-differences","__idx":1},"children":["Apache Hive and TD Hive Differences"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TD Hive supports the flexible schema capabilities of the TD platform; schema can be inferred from data loaded into tables or can be set explicitly."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treasure Data supports HiveQL semantics, but unlike Apache Hive, Treasure Data allows the user to set and modify the schema at any time. We do not require that a table schema be defined upfront."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"accessing-hive","__idx":2},"children":["Accessing Hive"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can access Hive using the following:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Treasure Console"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["TD Toolbelt"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["REST API"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"treasure-console","__idx":3},"children":["Treasure Console"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the Treasure Console"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Data Workbench"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Queries"]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/345090.de1e51b9284b079634025bc992c1cb036c6294932e248c711fa72f0469f6d2dd.89112c51.png","alt":"image","title":"#box-shadow=0px 0px 2px 1px blue"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Click ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["New Query"]}," button",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/345092.a637e42e590f7a9c6f56508896620c3f65844fcb5ba968466d5c5821bcd134b0.89112c51.png","alt":"image","title":"#box-shadow=0px 0px 2px 1px blue"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Select the query type of ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Hive"]},", write a query on the editor and click \"Run\" button"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["After you run your query, you can check the query processing log"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"td-toolbelt","__idx":4},"children":["TD Toolbelt"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use the Toolbelt command-line (CLI) client to submit Hive queries."]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure that ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/tools/cli-and-sdks/quickstart"},"children":["TD Toolbelt"]}," is installed."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Execute ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["td query"]}," command like the following:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"header":{"controls":{"copy":{}}},"source":"td query -w -T hive -d testdb \"SELECT code, COUNT(1) FROM www_access GROUP BY code\"\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"rest-api","__idx":5},"children":["REST API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You can use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/td_api_v3-public/jobs/createjob"},"children":["POST /v3/job/issue/hive/:database"]}," endpoint to submit Hive queries."]}]},"headings":[{"value":"Hive Quickstart","id":"hive-quickstart","depth":1},{"value":"Apache Hive and TD Hive Differences","id":"apache-hive-and-td-hive-differences","depth":2},{"value":"Accessing Hive","id":"accessing-hive","depth":2},{"value":"Treasure Console","id":"treasure-console","depth":3},{"value":"TD Toolbelt","id":"td-toolbelt","depth":3},{"value":"REST API","id":"rest-api","depth":3}],"frontmatter":{"seo":{"title":"Hive Quickstart"}},"lastModified":"2026-06-01T11:27:28.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/products/customer-data-platform/data-workbench/queries/hive/quickstart","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}