Chapter 4. Client Connectivity
A Presto client is a process that queries Presto and shows the query results for a number of purposes, such as data analytics, ad hoc queries, and many more. Presto provides a variety of clients, written in different programming languages, including REST API, R, Python, JDBC, Node.js, and ODBC.
This chapter is organized into two parts. In the first part, you’ll learn how to deploy a Presto client. Although you can deploy a Presto client as a separate process running on an existing cluster node, in this chapter, you’ll implement the client on a different node to simulate an external application accessing the cluster. We’ll focus on implementing a client in the REST API, Python, R, JDBC, Node.js, and ODBC. You can easily extend the described procedure to the other programming languages supported by Presto.
In the second part, you’ll implement a practical web service in Python, querying Presto and showing the results in a simple dashboard. The goal of this example is to illustrate the potentialities of a Presto client.
Setting Up the Environment
To add a Presto client as a node of the Presto cluster, first you must set up the environment. Deploy the following three components already implemented in Chapter 3:
-
Presto client
-
Docker image that contains your Presto client
-
Kubernetes node that runs the Docker image in the Presto cluster
The code used in this section is available in the 04 directory of the book’s repository, which contains the configuration ...