Giter Site home page Giter Site logo

presto-mysql-hive's Introduction

Use Presto to query from mysql and hive

Presto

Presto is a distributed query engine used in big data application. It can query data from multiple sources like mysql, postgres, redis, kafka, hive elasticsearch and many more using sql like syntax. It can scale to multiple workers

Hive

Apache hive is a data warehouse software. It can manage, read and write large datasets in distributed storage using SQL.

MySQL

MySQL is a relational database management system. It stores data in row based table structure.


The problem it solves

In large systems there is a possibility to have different flavours of databases. It is messy to use different query languages that every database offers. Presto offers a unified query syntex for all data sources which makes it easy to use different data sources for analytical purposes.


This project uses docker compose to build a mysql, hive and presto container. Data can be queried from mysql and hive using presto cli.

To run the setup

  1. Install necessary software by

sudo apt update

sudo apt install -y docker.io docker-compose git nano

  1. Clone the project

  2. cd presto-mysql-hive

  3. Run the service by sudo docker-compose up -d to run in detached mode. It will take few time to initialize the services.

  4. Access the presto terminal by typing sudo docker exec -it presto-server presto

  5. In presto terminal run select * from mysql.world_x.city; we should get the result

  6. Exit from presto container

  7. To enter data to hive run

docker exec -it hive-server /bin/bash

cd /hive-data-employee

hive -f employee_table.hql

hadoop fs -put employee.csv hdfs://namenode:8020/user/hive/warehouse/testdb.db/employee

  1. Exit from this container and access the presto terminal sudo docker exec -it presto-server presto

  2. Run the following query to get data from hive select * from hive.testdb.employee

presto-mysql-hive's People

Stargazers

Kaiyom Mohammad avatar Dipanjal Maitra avatar

Watchers

Md Masudur Rahman Niloy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.