Giter Site home page Giter Site logo

rajkiran485 / incremental-delta-load-in-hive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anmolkankariya/incremental-delta-load-in-hive

0.0 2.0 0.0 143 KB

Solution for loading incremental data in hive by using partitioning.

Shell 100.00%

incremental-delta-load-in-hive's Introduction

Incremental/Delta-Load-in-Hive

This repository contains the solution for incremental/delta load in hive using partitioning.

Delta load in hive is a major problem faced by industries and only few approaches were there to perform this in hive. One of those approch will give more optimal result with no performance issues.

You will find two files inside this repository-

incremental.sh - A Shell script that contains relevant command to automate the process.

part.hql - A hive query file that contains commands to perform dynamic partitioning.

Steps to perform incremental append-

  1. Create a partitioned table in hive.

    Example:

         CREATE EXTERNAL TABLE base_table (
         ID int, 
         Name string,
         Contact_No bigint,
         Time_stamp string
         )
         ROW FORMAT DELIMITED
         FIELDS TERMINATED BY ','
         LOCATION '/user/hive/base_table';
    
  2. Load the data from your database initially using any tool (like sqoop) in that particular directory('/user/hive/base_table').

  3. Give permission to user/hive directory using following command:

         sudo hadoop fs -chmod 777 /user/hive/directory_name
    

    Note: Instead of 777, Admin can give permissions according to user's privileges.

  4. Move both files (incremental.sh and part.hql) into the same folder.

  5. Run the script (incremental.sh only) and check incremented rows.

Note: Make sure that new rows were inserted in the source database otherwise you may get an error.

SCREENSHOT

alt text Running script after adding new records gives the table with incrementally loaded rows as highlighted in the image.

incremental-delta-load-in-hive's People

Contributors

anmolkankariya avatar

Watchers

James Cloos avatar rajkiran485 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.