-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathshow-partitions.html
104 lines (90 loc) · 4.56 KB
/
show-partitions.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>3.6. SHOW PARTITIONS — Presto 0.58 Documentation</title>
<link rel="stylesheet" href="../_static/presto.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '0.58',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="top" title="Presto 0.58 Documentation" href="../index.html" />
<link rel="up" title="3. SQL Statement Syntax" href="../sql.html" />
<link rel="next" title="3.7. SHOW TABLES" href="show-tables.html" />
<link rel="prev" title="3.5. SHOW COLUMNS" href="show-columns.html" />
</head>
<body>
<div class="header">
<h1 class="heading"><a href="../index.html">
<span>Presto 0.58 Documentation</span></a></h1>
<h2 class="heading"><span>3.6. SHOW PARTITIONS</span></h2>
</div>
<div class="topnav">
<p class="nav">
<span class="left">
« <a href="show-columns.html">3.5. SHOW COLUMNS</a>
</span>
<span class="right">
<a href="show-tables.html">3.7. SHOW TABLES</a> »
</span>
</p>
</div>
<div class="content">
<div class="section" id="show-partitions">
<h1>3.6. SHOW PARTITIONS</h1>
<div class="section" id="synopsis">
<h2>Synopsis</h2>
<div class="highlight-none"><div class="highlight"><pre>SHOW PARTITIONS FROM table [ WHERE ... ] [ ORDER BY ... ] [ LIMIT ... ]
</pre></div>
</div>
</div>
<div class="section" id="description">
<h2>Description</h2>
<p>List the partitions in <tt class="docutils literal"><span class="pre">table</span></tt>, optionally filtered using the <tt class="docutils literal"><span class="pre">WHERE</span></tt> clause,
ordered using the <tt class="docutils literal"><span class="pre">ORDER</span> <span class="pre">BY</span></tt> clause and limited using the <tt class="docutils literal"><span class="pre">LIMIT</span></tt> clause.
These clauses work the same way that they do in a <a class="reference internal" href="select.html"><em>SELECT</em></a> statement.</p>
</div>
<div class="section" id="examples">
<h2>Examples</h2>
<p>List all partitions in the table <tt class="docutils literal"><span class="pre">orders</span></tt>:</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SHOW</span> <span class="n">PARTITIONS</span> <span class="k">FROM</span> <span class="n">orders</span><span class="p">;</span>
</pre></div>
</div>
<p>List all partitions in the table <tt class="docutils literal"><span class="pre">orders</span></tt> starting from the year <tt class="docutils literal"><span class="pre">2013</span></tt>
and sort them in reverse date order:</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SHOW</span> <span class="n">PARTITIONS</span> <span class="k">FROM</span> <span class="n">orders</span> <span class="k">WHERE</span> <span class="n">ds</span> <span class="o">>=</span> <span class="s1">'2013-01-01'</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="n">ds</span> <span class="k">DESC</span><span class="p">;</span>
</pre></div>
</div>
<p>List the most recent partitions in the table <tt class="docutils literal"><span class="pre">orders</span></tt>:</p>
<div class="highlight-sql"><div class="highlight"><pre><span class="k">SHOW</span> <span class="n">PARTITIONS</span> <span class="k">FROM</span> <span class="n">orders</span> <span class="k">ORDER</span> <span class="k">BY</span> <span class="n">ds</span> <span class="k">DESC</span> <span class="k">LIMIT</span> <span class="mi">10</span><span class="p">;</span>
</pre></div>
</div>
</div>
</div>
</div>
<div class="bottomnav">
<p class="nav">
<span class="left">
« <a href="show-columns.html">3.5. SHOW COLUMNS</a>
</span>
<span class="right">
<a href="show-tables.html">3.7. SHOW TABLES</a> »
</span>
</p>
</div>
<div class="footer">
© Copyright 2013, Facebook.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
</div>
</body>
</html>