| <!doctype html><html><!doctype html> |
| <html> |
| <head> |
| <meta name=generator content="Hugo 0.91.2"> |
| <meta charset=utf-8> |
| <meta http-equiv=x-ua-compatible content="IE=edge"> |
| <meta name=viewport content="width=device-width,initial-scale=1"> |
| <meta name=description content> |
| <meta name=author content> |
| <title>Apache Hive</title> |
| <link rel=icon href=/images/hive.svg sizes=any type=image/svg+xml> |
| <link rel=stylesheet href=https://hive.apache.org/css/hive-theme.css> |
| <link rel=stylesheet href=https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css> |
| <link href=https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css rel=stylesheet integrity=sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC crossorigin=anonymous> |
| <link rel=stylesheet href=https://hive.apache.org/css/termynal.css> |
| <link rel=apple-touch-icon sizes=180x180 href=https://hive.apache.org/images/apple-touch-icon.png> |
| <link rel=icon type=image/png sizes=32x32 href=https://hive.apache.org/images/favicon-32x32.png> |
| <link rel=icon type=image/png sizes=16x16 href=https://hive.apache.org/images/favicon-16x16.png> |
| <link rel=manifest href=https://hive.apache.org/images/site.webmanifest> |
| <link rel=mask-icon href=https://hive.apache.org/images/safari-pinned-tab.svg color=#5bbad5> |
| <meta name=msapplication-TileColor content="#da532c"> |
| <meta name=theme-color content="#ffffff"> |
| </head> |
| <body> |
| <body> |
| <header> |
| <menu style=background:#000;margin:0> |
| <nav class="navbar navbar-expand-lg navbar-dark bg-black"> |
| <div class=container-fluid> |
| <a href=https://hive.apache.org> <img src=https://hive.apache.org/images/hive.svg width=60 height=35 alt="Apache Software Foundation"></a> |
| <a class="header-text navbar-brand" href=https://hive.apache.org>Apache Hive</a> |
| <button class=navbar-toggler type=button data-bs-toggle=collapse data-bs-target=#navbarSupportedContent aria-controls=navbarSupportedContent aria-expanded=false aria-label="Toggle navigation"> |
| <span class=navbar-toggler-icon></span> |
| </button> |
| <div class="collapse navbar-collapse" id=navbarSupportedContent> |
| <ul class="navbar-nav me-auto mb-2 mb-lg-0"> |
| <li class="nav-item dropdown"> |
| <a class="nav-link dropdown-toggle" href=/Release id=navbarDropdown role=button data-bs-toggle=dropdown aria-expanded=false> |
| Release |
| </a> |
| <ul class=dropdown-menu aria-labelledby=navbarDropdown> |
| <li><a class=dropdown-item href=https://hive.apache.org/general/downloads>Release</a></li> |
| <li><a class=dropdown-item href=https://hive.apache.org/general/hcatalogdownloads/>Hcatalog</a></li> |
| </ul> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link dropdown-toggle" href=/Document id=navbarDropdown role=button data-bs-toggle=dropdown aria-expanded=false> |
| Documentation |
| </a> |
| <ul class=dropdown-menu aria-labelledby=navbarDropdown> |
| <li><a class=dropdown-item href=https://hive.apache.org/docs/javadocs/>Javadocs</a></li> |
| <li><a class=dropdown-item href=https://cwiki.apache.org/confluence/display/Hive/LanguageManual>Language Manual</a></li> |
| <li><a class=dropdown-item href=https://cwiki.apache.org/confluence/display/Hive/>Wiki</a></li> |
| </ul> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link dropdown-toggle" href=/general id=navbarDropdown role=button data-bs-toggle=dropdown aria-expanded=false> |
| General |
| </a> |
| <ul class=dropdown-menu aria-labelledby=navbarDropdown> |
| <li><a class=dropdown-item href=https://www.apache.org/licenses/LICENSE-2.0.html>License</a></li> |
| <li><a class=dropdown-item href=https://hive.apache.org/general/privacypolicy/>Privacy Policy</a></li> |
| </ul> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link dropdown-toggle" href=# id=navbarDropdown role=button data-bs-toggle=dropdown aria-expanded=false> |
| Development |
| </a> |
| <ul class=dropdown-menu aria-labelledby=navbarDropdown> |
| <li><a class=dropdown-item href=https://hive.apache.org/development/gettingstarted/>Getting Started</a></li> |
| <li><a class=dropdown-item href=https://hive.apache.org/development/quickstart/>Quickstart with Docker</a></li> |
| <li><a class=dropdown-item href=https://cwiki.apache.org/confluence/display/Hive/DesignDocs>Design Docs</a></li> |
| <li><a class=dropdown-item href=https://issues.apache.org/jira/projects/HIVE/issues>Hive JIRA</a></li> |
| <li><a class=dropdown-item href=https://cwiki.apache.org/confluence/display/Hive/HiveDeveloperFAQ>Hive Developer FAQ</a></li> |
| <li><a class=dropdown-item href=https://cwiki.apache.org/confluence/display/Hive/Hive+PreCommit+Patch+Testing>Precommit Patch Testing</a></li> |
| <li><a class=dropdown-item href=https://hive.apache.org/development/versioncontrol/>Version Control</a></li> |
| </ul> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link dropdown-toggle" href=# id=navbarDropdown role=button data-bs-toggle=dropdown aria-expanded=false> |
| Community |
| </a> |
| <ul class=dropdown-menu aria-labelledby=navbarDropdown> |
| <li><a class=dropdown-item href=https://cwiki.apache.org/confluence/display/Hive/BecomingACommitter>Becoming A Committer</a></li> |
| <li><a class=dropdown-item href=https://cwiki.apache.org/confluence/display/Hive/HowToContribute>How To Contribute</a></li> |
| <li><a class=dropdown-item href=https://cwiki.apache.org/confluence/display/Hive/Home#Home-ResourcesforContributors>Resources for Contributors</a></li> |
| <li><a class=dropdown-item href=https://hive.apache.org/community/mailinglists/>Mailing Lists</a></li> |
| <li><a class=dropdown-item href=https://hive.apache.org/community/issuetracking/>Issue Tracking</a></li> |
| <li><a class=dropdown-item href=https://hive.apache.org/community/people/>People</a></li> |
| <li> |
| <hr class=dropdown-divider> |
| </li> |
| <li><a class=dropdown-item href=https://cwiki.apache.org/confluence/display/Hive/Bylaws>By Laws</a></li> |
| <li><a class=dropdown-item href=https://cwiki.apache.org/confluence/display/Hive/HowToRelease>How To Release</a></li> |
| </ul> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class=nav-link href=https://hive.blog.apache.org/ id=navbarDropdown role=button aria-expanded=false> |
| Blogs |
| </a> |
| </li> |
| <li class="nav-item dropdown"> |
| <a class="nav-link dropdown-toggle" href=# id=navbarDropdown role=button data-bs-toggle=dropdown aria-expanded=false> |
| ASF |
| </a> |
| <ul class=dropdown-menu aria-labelledby=navbarDropdown> |
| <li><a class=dropdown-item href=https://www.apache.org/foundation/contributing.html>Donations</a></li> |
| <li><a class=dropdown-item href=https://www.apache.org/foundation/sponsorship.html>Sponsorship</a></li> |
| <li><a class=dropdown-item href=https://www.apache.org/foundation/thanks.html>Thanks</a></li> |
| <li><a class=dropdown-item href=https://www.apache.org/>Website</a></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| </nav> |
| </menu> |
| </header> |
| <div class=content> |
| <banner> |
| <div id=large-header class=large-header> |
| <canvas id=canvas></canvas> |
| <div class=main-title> |
| <a href=https://hive.apache.org><img src=https://hive.apache.org/images/hive.svg width=550 height=300 alt="Apache Software Foundation"></a> |
| <h1 class="text-outline black-text">Apache Hive </h1> |
| <h4 class=thin> The Apache Hive ™ is a distributed, fault-tolerant data warehouse system that enables analytics at a massive scale and |
| facilitates reading, writing, and managing petabytes of data residing in distributed storage using SQL.</h4> |
| <a href=https://github.com/apache/hive class=icon-block> |
| <button class="custom-button banner-button-style" role=button>Github <i class="fab fa-github" style=font-size:35px></i></button> |
| </a> |
| <a href=https://hive.apache.org/community/mailinglists/ class=icon-block> |
| <button class="custom-button banner-button-style" role=button>Mail <i class="fa-solid fa-envelope" style=font-size:35px></i></button> |
| </a> |
| <a href=https://hub.docker.com/r/apache/hive class=icon-block> |
| <button class="custom-button banner-button-style" role=button>Docker <i class="fab fa-docker" style=font-size:35px></i></button> |
| </a> |
| <a href=https://issues.apache.org/jira/projects/HIVE/issues class=icon-block> |
| <button class="custom-button banner-button-style" role=button>Community <i class="fa-solid fa-comments" style=font-size:35px></i></button> |
| </a> |
| </div> |
| </div> |
| <script src=https://hive.apache.org/js/script.js></script> |
| </banner> |
| <features class="container text-style white-background"> |
| <div> |
| <div class="row feature-intro"> |
| <div class="row section-header-style"> |
| <h2 class=section-header-text style=text-align:center>What is Hive?</h2> |
| </div> |
| <p> |
| Apache Hive is a distributed, fault-tolerant data warehouse system that enables analytics at a massive scale. |
| Hive Metastore(HMS) provides a central repository of metadata that can easily be analyzed to make informed, |
| data driven decisions, and therefore it is a critical component of many data lake architectures. |
| Hive is built on top of Apache Hadoop and supports storage on S3, adls, gs etc though hdfs. |
| Hive allows users to read, write, and manage petabytes of data using SQL. |
| </p> |
| </div> |
| <div class="row section-header-style"> |
| <h2 class=section-header-text style=text-align:center>Key Features</h2> |
| </div> |
| <div class="row divs"> |
| <hs2terminal class=col-md> |
| <div id=hs2 data-termynal data-termynal data-ty-typedelay=40 data-ty-linedelay=700> |
| <span data-ty=input>beeline -u "jdbc:hive2://host:10001/default"</span> |
| <span data-ty>Connected to: Apache Hive </span> |
| <span data-ty></span> |
| <span data-ty=input>jdbc:hive2://host:10001/>select count(*) from test_t1;</span> |
| <span data-ty></span> |
| </div> |
| </hs2terminal> |
| <div class="col-md feature-border"> |
| <h2 class=topic-text-style>Hive-Server 2 (HS2)</h2> |
| <p> |
| HS2 supports multi-client concurrency and authentication. |
| It is designed to provide better support for open API clients like JDBC and ODBC. |
| </p> |
| <a href=https://cwiki.apache.org/confluence/display/Hive/HiveServer2+Overview class=icon-block> |
| <button class="custom-button feature-button-style" role=button>Learn More</button> |
| </a> |
| </div> |
| </div> |
| <div class="row divs"> |
| <div class="col-md feature-border"> |
| <h2 class=topic-text-style>Hive Metastore Server (HMS)</h2> |
| <p> |
| The Hive Metastore (HMS) is a central repository of metadata for Hive tables and partitions in a relational database, |
| and provides clients (including Hive, Impala and Spark) access to this information using the metastore service API. |
| It has become a building block for data lakes that utilize the diverse world of open-source software, such as Apache Spark and Presto. |
| In fact, a whole ecosystem of tools, open-source and otherwise, are built around the Hive Metastore, some of which this diagram illustrates. |
| </p> |
| <a href=https://cwiki.apache.org/confluence/display/hive/design class=icon-block> |
| <button class="custom-button feature-button-style" role=button>Learn More</button> |
| </a> |
| </div> |
| <div class=col-md> |
| <a href=https://cwiki.apache.org/confluence/display/hive/design> |
| <img src=https://hive.apache.org/images/HMS.jpg width=600 height=400 alt="Apache Software Foundation"></a> |
| </a> |
| </div> |
| </div> |
| <div class="row divs"> |
| <div class=col-md> |
| <a href=https://cwiki.apache.org/confluence/display/hive/hive+transactions> |
| <img src=https://hive.apache.org/images/hiveAcid.svg width=300 height=300 alt="Apache Software Foundation"></a> |
| </a> |
| </div> |
| <div class="col-md feature-border"> |
| <h2 class=topic-text-style>Hive ACID</h2> |
| <p> |
| Hive provides full ACID support for <a href=https://orc.apache.org/>ORC</a> tables and insert only support to all other formats. |
| </p> |
| <a href=https://cwiki.apache.org/confluence/display/hive/hive+transactions class=icon-block> |
| <button class="custom-button feature-button-style" role=button>Learn More</button> |
| </a> |
| </div> |
| </div> |
| <div class="row divs"> |
| <div class="col-md feature-border"> |
| <h2 class=topic-text-style>Hive Data Compaction</h2> |
| <p> |
| Query-based and MR-based data compactions are supported out-of-the-box. |
| </p> |
| <a href=https://cwiki.apache.org/confluence/display/hive/languagemanual+ddl#LanguageManualDDL-AlterTable/PartitionCompact class=icon-block> |
| <button class="custom-button feature-button-style" role=button>Learn More</button> |
| </a> |
| </div> |
| <div class=col-md> |
| <compaction> |
| <div id=comp data-termynal data-ty-typedelay=40 data-ty-linedelay=70> |
| <span data-ty=input>jdbc:hive2://> alter table test_t1 compact "MAJOR";</span> |
| <span data-ty>Done!</span> |
| <span data-ty=input>jdbc:hive2://> alter table test_t1 compact "MINOR";</span> |
| <span data-ty>Done!</span> |
| <span data-ty=input>jdbc:hive2://> show compactions;</span> |
| </div> |
| </compaction> |
| </div> |
| </div> |
| <div class="row divs"> |
| <div class=col-md> |
| <a href=https://iceberg.apache.org/docs/latest/hive/> |
| <img src=https://hive.apache.org/images/hiveIceberg.png width=500 height=250 alt="Apache Software Foundation"></a> |
| </a> |
| </div> |
| <div class="col-md feature-border"> |
| <h2 class=topic-text-style>Hive Iceberg</h2> |
| <p> |
| Hive provides out of the box support for Apache Iceberg Tables, a cloud-native, |
| high-performance open table format, via Hive StorageHandler. |
| </p> |
| <a href=https://iceberg.apache.org/docs/latest/hive/ class=icon-block> |
| <button class="custom-button feature-button-style" role=button>Learn More</button> |
| </a> |
| </div> |
| </div> |
| <div class="row divs"> |
| <div class="col-md feature-border"> |
| <h2 class=topic-text-style>Security and Observability</h2> |
| <p> |
| Apache Hive supports kerberos auth and integrates with Apache Ranger and Apache Atlas for security and |
| observability. |
| </p> |
| <a href=https://atlas.apache.org/1.2.0/Hook-Hive.html class=icon-block> |
| <button class="custom-button feature-button-style" role=button>Learn More</button> |
| </a> |
| </div> |
| <div class=col-md> |
| <img src=https://hive.apache.org/images/ker.jpeg width=200 height=150 alt="Apache Software Foundation"></a> |
| <img src=https://hive.apache.org/images/atlas.png width=400 height=100 alt="Apache Software Foundation"></a> |
| <img src=https://hive.apache.org/images/ranger.png width=400 height=100 alt="Apache Software Foundation"></a> |
| </div> |
| </div> |
| <div class="row divs"> |
| <div class=col-md> |
| <img src=https://hive.apache.org/images/llap.png width=600 height=350 alt="Apache Software Foundation"></a> |
| </div> |
| <div class="col-md feature-border"> |
| <h2 class=topic-text-style>Hive LLAP</h2> |
| <p> |
| Apache Hive enables interactive and subsecond SQL through Low Latency Analytical Processing (LLAP), |
| introduced in Hive 2.0 that makes Hive faster by using persistent query infrastructure and optimized data caching |
| </p> |
| <a href=https://cwiki.apache.org/confluence/display/Hive/LLAP class=icon-block> |
| <button class="custom-button feature-button-style" role=button>Learn More</button> |
| </a> |
| </div> |
| </div> |
| <div class="row divs"> |
| <div class="col-md feature-border"> |
| <h2 class=topic-text-style>Query planner and Cost based Optimizer</h2> |
| <p> |
| Hive uses Apache Calcite's cost based query optimizer (CBO) and query execution framework to optimize sql queries. |
| </p> |
| <a href=https://cwiki.apache.org/confluence/display/Hive/Cost-based+optimization+in+Hive class=icon-block> |
| <button class="custom-button feature-button-style" role=button>Learn More</button> |
| </a> |
| </div> |
| <div class=col-md> |
| <explain> |
| <div id=explain data-termynal data-ty-typedelay=40 data-ty-linedelay=70 style=text-align:left> |
| <span data-ty=input>jdbc:hive2://> explain cbo select ss.ss_net_profit, sr.sr_net_loss from store_sales ss join store_returns sr on (ss.ss_item_sk=sr.sr_item_sk) limit 5 ;</span> |
| <span data-ty>+---------------------------------------------+</span> |
| <span data-ty> Explain </span></span> |
| <span data-ty>+---------------------------------------------+</span> |
| <span data-ty> CBO PLAN: </span> |
| <span data-ty> HiveSortLimit(fetch=[5]) </span> |
| <span data-ty> HiveProject(ss_net_profit=[$1], sr_net_loss=[$3]) </span> |
| <span data-ty>   HiveJoin(condition=[=($0, $2)], joinType=[inner]) </span> |
| <span data-ty>     HiveProject(ss_item_sk=[$2], ss_net_profit=[$22]) </span> |
| <span data-ty>     HiveFilter(condition=[IS NOT NULL($2)]) </span> |
| <span data-ty>       HiveTableScan(table=[[tpcds_text_10, store_sales]], table:alias=[ss]) </span> |
| <span data-ty>     HiveProject(sr_item_sk=[$2], sr_net_loss=[$19]) </span> |
| <span data-ty>     HiveFilter(condition=[IS NOT NULL($2)]) </span> |
| <span data-ty>       HiveTableScan(table=[[tpcds_text_10, store_returns]], table:alias=[sr]) </span> |
| <span data-ty>+---------------------------------------------+</span> |
| </div> |
| <script src=https://hive.apache.org/js/termynal.js data-termynal-container=#explain></script> |
| </explain> |
| </div> |
| </div> |
| <div class="row divs"> |
| <div class=col-md> |
| <replication class=col-md> |
| <div id=repl data-termynal data-ty-typedelay=40 data-ty-linedelay=70 style=width:830px> |
| <span data-ty=input>jdbc:hive2://> repl dump src with (</span> |
| <span data-ty=input>. . .> 'hive.repl.dump.version'= '2',</span> |
| <span data-ty=input>. . .> 'hive.repl.rootdir'= 'hdfs://<host>:<port>/user/replDir/d1'</span> |
| <span data-ty=input>. . .> );</span> |
| <span data-ty>Done!</span> |
| <span data-ty=input>jdbc:hive2://> repl load src into tgt with (</span> |
| <span data-ty=input>. . .> 'hive.repl.rootdir'= 'hdfs://<host>:<port>/user/replDir/d1'</span> |
| <span data-ty=input>. . .> );</span> |
| <span data-ty>Done!</span> |
| </div> |
| </replication> |
| </div> |
| <div class="col-md feature-border"> |
| <h2 class=topic-text-style>Hive Replication</h2> |
| <p> |
| Hive supports bootstap and incremental replication for backup and recovery. |
| </p> |
| <a href=https://cwiki.apache.org/confluence/display/Hive/Replication class=icon-block> |
| <button class="custom-button feature-button-style" role=button>Learn More</button> |
| </a> |
| </div> |
| </div> |
| </div> |
| </features> |
| </div> |
| <footer class="black-background static-bottom" style=padding:30px> |
| <div class=row> |
| <div class=col-3> |
| <a href=https://www.apache.org/> |
| <img src=https://hive.apache.org/images/asf_logo.png width=270 height=100 alt="Apache Software Foundation"></a> |
| </a> |
| </div> |
| <div class=col-9> |
| <p class=footer-text>Apache is a non-profit organization helping open-source |
| software projects released under the Apache |
| <a href=https://www.apache.org/licenses/>license</a> |
| and managed with |
| <a href=https://www.apache.org/foundation/how-it-works.html> |
| open governance</a> and |
| <a href=https://privacy.apache.org/policies/privacy-policy-public.html> |
| privacy policy</a>. See upcoming |
| <a href=https://www.apache.org/events/current-event>Apache Events</a>. |
| If you discover any |
| <a href=https://www.apache.org/security/>security</a> vulnerabilities, please |
| report them privately. Finally, |
| <a href=https://www.apache.org/foundation/sponsorship.html>thanks |
| </a> to the sponsors who |
| <a href=https://www.apache.org/foundation/contributing.html> |
| donate</a> to the Apache Foundation. |
| </p> |
| </div> |
| </div> |
| <div class="copyright row"> |
| <a href=https://hive.apache.org style=color:grey> |
| The contents of this website are © 2023 Apache Software Foundation under the terms of the Apache License v2. Apache Hive and its logo are trademarks of the Apache Software Foundation. |
| </a> |
| </div> |
| </footer> |
| <script src=https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js integrity=sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM crossorigin=anonymous></script> |
| </body> |
| </html> |