Skip to content

Commit

Permalink
Merge pull request #13 from apache/gh-pages
Browse files Browse the repository at this point in the history
Added REPL commands on the landing page
  • Loading branch information
deniskuzZ authored Apr 3, 2024
2 parents f34143e + 00d075f commit 7aca1d4
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 17 deletions.
10 changes: 5 additions & 5 deletions themes/hive/layouts/partials/compaction.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
specific language governing permissions and limitations
under the License. -->

<compaction class="col-md">
<div id="comp" data-termynal data-termynal data-ty-typeDelay="40" data-ty-lineDelay="700">
<span data-ty="input">jdbc:hive2://.../default>ALTER TABLE test COMPACT "MAJOR";</span>
<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://.../default>ALTER TABLE test COMPACT "MINOR";</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://.../default> SHOW COMPACTIONS;</span>
<span data-ty="input">jdbc:hive2://> show compactions;</span>
</div>
</compaction>
22 changes: 11 additions & 11 deletions themes/hive/layouts/partials/explain.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
under the License. -->

<explain>
<div id="explain" data-termynal data-termynal data-ty-typeDelay="40" data-ty-lineDelay="70"><span data-ty="input">jdbc:hive2://localhost:10001/> 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>

<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> 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> HiveProject(ss_net_profit=[$1], sr_net_loss=[$3]) </span>
<span data-ty> &ensp;&ensp;HiveJoin(condition=[=($0, $2)], joinType=[inner]) </span>
<span data-ty> &ensp;&ensp;&ensp;&ensp;HiveProject(ss_item_sk=[$2], ss_net_profit=[$22]) </span>
<span data-ty> &ensp;&ensp;&ensp;&ensp;HiveFilter(condition=[IS NOT NULL($2)]) </span>
<span data-ty> &ensp;&ensp;&ensp;&ensp;&ensp;&ensp;HiveTableScan(table=[[tpcds_text_10, store_sales]], table:alias=[ss]) </span>
<span data-ty> &ensp;&ensp;&ensp;&ensp;HiveProject(sr_item_sk=[$2], sr_net_loss=[$19]) </span>
<span data-ty> &ensp;&ensp;&ensp;&ensp;HiveFilter(condition=[IS NOT NULL($2)]) </span>
<span data-ty> &ensp;&ensp;&ensp;&ensp;&ensp;&ensp;HiveTableScan(table=[[tpcds_text_10, store_returns]], table:alias=[sr]) </span>
<span data-ty>+---------------------------------------------+</span>
</div>
<script src="{{ .Site.BaseURL }}/js/termynal.js" data-termynal-container="#explain"></script>
Expand Down
1 change: 1 addition & 0 deletions themes/hive/layouts/partials/features.html
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ <h2 class="topic-text-style">Query planner and Cost based Optimizer</h2>

<div class="row divs">
<div class="col-md">
{{- partial "repl.html" . -}}
</div>
<div class="col-md feature-border">
<h2 class="topic-text-style">Hive Replication</h2>
Expand Down
31 changes: 31 additions & 0 deletions themes/hive/layouts/partials/repl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<!---
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License. -->

<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://&lt;host&gt;:&lt;port&gt;/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://&lt;host&gt;:&lt;port&gt;/user/replDir/d1'</span>
<span data-ty="input">. . .> );</span>
<span data-ty>Done!</span>
</div>
</replication>
3 changes: 2 additions & 1 deletion themes/hive/static/js/termynal.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,5 @@ if (document.currentScript.hasAttribute('data-termynal-container')) {

var termynal1 = new Termynal('#comp');
var termynal2 = new Termynal('#hs2');
var termynal3 = new Termynal('"#explain');
var termynal3 = new Termynal('#explain');
var termynal4 = new Termynal('#repl');

0 comments on commit 7aca1d4

Please sign in to comment.