Giter VIP home page Giter VIP logo

mr_top's Introduction

MR-Top

How-to

Change the current user

Change to user hadoop by running su - hadoop.

Prepare data

Assuming you have a data file which name is data, run commands below to move it to HDFS at file /kaola/order/input.

bin/hadoop fs -mkdir -p /kaola/order/
bin/hadoop fs -moveFromLocal data /kaola/order/input

Each line of the data file should look like below.

0|256988385197167935|100001|1|3|159.52|149.52|9718470045892|2018-11-09 10:54:52|甘肃|兰州|城关区盘旋路100号|12,99,32

Clone the repository

git clone https://github.com/cloudtogo/mr_top.git

Run the task to figure out the top 3 products each day

cd mr_top && ./run.sh

Modify code to achieve more

Modifying src/kaola/Config could change the behavior of the program.

kaola.Config.topN indicates how many items of each day will show in the result.

kaola.Config.keyAttributeIdx defines the index of the column you would like to sort in the data file.It should start from 0.

mr_top's People

Contributors

kitt1987 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

gobomb

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.