1
- ======================
2
- Command Line Interface
3
- ======================
1
+ ==========
2
+ Presto CLI
3
+ ==========
4
4
5
5
.. contents ::
6
6
:local:
@@ -10,27 +10,46 @@ Command Line Interface
10
10
Overview
11
11
========
12
12
13
- The Presto Command Line Interface (CLI) is a terminal-based interactive shell
14
- for running queries, and is a
15
- `self-executing <http://skife.org/java/unix/2011/06/20/really_executable_jars.html >`_
16
- JAR file that acts like a normal UNIX executable. The Presto CLI communicates
17
- with the Presto server over HTTP using a REST API, documented at
18
- :doc: `Presto Client REST API </develop/client-protocol >`.
13
+ The Presto Command Line Interface (CLI) is a terminal-based interactive shell for running queries.
14
+ It is a `self-executing <http://skife.org/java/unix/2011/06/20/really_executable_jars.html >`_
15
+ JAR file that acts like a normal UNIX executable and communicates with the Presto server
16
+ over HTTP using :doc: `Presto Client REST API </develop/client-protocol >`.
17
+
18
+ Installation
19
+ ======================
20
+
21
+ Download :maven_download: `cli `.
22
+
23
+ Rename the JAR file to ``presto `` with the following command
24
+ (replace ``* `` with the version number of the downloaded jar file):
25
+
26
+ .. code-block :: none
27
+
28
+ mv presto-cli-*-executable.jar presto
29
+
30
+ Use ``chmod +x `` to make the renamed file executable:
31
+
32
+ .. code-block :: none
33
+
34
+ chmod +x presto
35
+
36
+ Running the Presto CLI
37
+ ======================
38
+
39
+ Start the Presto CLI using the name you gave it using the ``mv `` command:
40
+
41
+ .. code-block :: none
19
42
20
- To install the Presto CLI, see :doc: ` /installation/cli `.
43
+ ./presto
21
44
22
- Configuration
23
- =============
45
+ The Presto CLI starts and displays the prompt ``presto> ``.
24
46
25
- The Presto CLI paginates query results using the ``less `` program, which
26
- is configured with preset options. To change the pagination of query results, set the
27
- environment variable ``PRESTO_PAGER `` to the name of a different program such as ``more ``,
28
- or set it to an empty value to disable pagination.
47
+ To exit the Presto CLI, enter ``quit ``.
29
48
30
- Connect to a Presto server using the Presto CLI
31
- ===============================================
49
+ Connect to a Presto server
50
+ ==========================
32
51
33
- To connect to a Presto server, run the CLI with the ``--server `` option.
52
+ To connect to a Presto server, run the Presto CLI with the ``--server `` option.
34
53
35
54
.. code-block :: none
36
55
@@ -39,14 +58,18 @@ To connect to a Presto server, run the CLI with the ``--server`` option.
39
58
``localhost:8080 `` is the default for a Presto server, so if you have a Presto server running locally you can
40
59
leave it off.
41
60
42
- To connect to a remote Presto server, use the Presto endpoint URL as in
43
- the following example command:
61
+ To connect to a remote Presto server, use the Presto endpoint URL as in the following example command:
44
62
45
63
.. code-block :: none
46
64
47
65
./presto --server http://www.example.net:8080
48
66
67
+ Pagination
68
+ ==========
49
69
70
+ The Presto CLI paginates query results using the ``less `` program, which is configured with preset options.
71
+ To change the pagination of query results, set the environment variable ``PRESTO_PAGER ``
72
+ to the name of a different program such as ``more ``, or set it to an empty value to disable pagination.
50
73
51
74
Examples
52
75
========
@@ -66,7 +89,7 @@ JSON format in a file named ``plan.json``.
66
89
Online Help
67
90
===========
68
91
69
- Run the CLI with the ``--help `` option to see the online help.
92
+ Run the Presto CLI with the ``--help `` option to see the online help.
70
93
71
94
.. code-block :: none
72
95
0 commit comments