DEV Community

Cover image for Simplify Distributed Queries with Presto and DbVisualizer
DbVisualizer
DbVisualizer

Posted on

Simplify Distributed Queries with Presto and DbVisualizer

Presto and DbVisualizer provide a robust combination for querying distributed datasets. This article guides you through the basics: setting up Presto, connecting it with DbVisualizer, and running efficient queries.

Presto installation using Docker

Presto needs to be set up locally before you can query datasets. Follow these steps to install it with Docker:

Download the Docker Image

docker pull ahanaio/prestodb-sandbox
Enter fullscreen mode Exit fullscreen mode

Run the Presto Container

docker run -p 8080:8080 --name presto ahanaio/prestodb-sandbox
Enter fullscreen mode Exit fullscreen mode

Verify Presto

Use the following commands:

docker ps
docker logs presto
Enter fullscreen mode Exit fullscreen mode

Once ready, open Presto at http://localhost:8080.

DbVisualizer connection setup

To interact with Presto, connect it to DbVisualizer. Here’s how:

  1. Navigate to Connection tab and click Create Connection.
  2. Select Presto as the driver and enter:
    • Server: localhost
    • Port: 8080
    • User: "user".
  3. Update the drivers if necessary and test the connection.

DbVisualizer is now linked with Presto for querying.

Executing Presto queries

Write and execute SQL commands in DbVisualizer effortlessly. Example:

SELECT count(*) 
FROM tpch.sf1.nation;
Enter fullscreen mode Exit fullscreen mode

Run queries with the play icon and analyze results in the output.

FAQ

1. How to set up Presto on Docker?

Install by pulling the Docker image, running the container, and verifying the setup.

2. How to connect DbVisualizer to Presto?

Input server details (localhost, port 8080) and test the connection.

3. Can DbVisualizer support advanced Presto queries?

Yes, Presto’s advanced functions are compatible.

4. Can Presto handle cross-database queries?

Yes, Presto supports distributed joins across multiple sources.

Conclusion

Presto and DbVisualizer streamline distributed data querying, offering robust tools for efficient analysis. Explore the article Querying Data with DbVisualizer and PrestoDb for more advanced examples and optimizations.

Top comments (0)