• Home
  • Archive
  • Tools
  • Contact Us

The Customize Windows

Technology Journal

  • Cloud Computing
  • Computer
  • Digital Photography
  • Windows 7
  • Archive
  • Cloud Computing
  • Virtualization
  • Computer and Internet
  • Digital Photography
  • Android
  • Sysadmin
  • Electronics
  • Big Data
  • Virtualization
  • Downloads
  • Web Development
  • Apple
  • Android
Advertisement
You are here:Home » How To Process Healthcare Data in Hadoop, Pig (IBM Demo Cloud)

By Abhishek Ghosh May 2, 2018 5:11 am Updated on May 2, 2018

How To Process Healthcare Data in Hadoop, Pig (IBM Demo Cloud)

Advertisement

Previously, we talked about IBM Demo Cloud, which is a free server with SSH access to learn Hadoop, Pig, Hive etc without the need of running own installation. Unlike server log, healthcare data lacks universal format. Here is Basic Commends Showing How To Process Healthcare Data in Hadoop, Pig Using IBM Demo Cloud. As for server logs, we can easily distribute scripts which will work all over the earth. Some healthcare data like data around diabetes or blood sugar level rarely distributed for educational purpose. Comparing with server log, we have to take one line as one set of entry. We are providing example with script to process things like server log. The reader needs to customize the script according to the format of data in text format. If the data source has blood sugar values ranging from 120 to theoretically infinity with multiple occurrences same value, we will get a list of values followed by number of occurrences, like :

Vim
1
2
3
4
5
6
7
...
(216,1)
(320,6)
(297,2)
(276,1)
(278,3)
...

 

How To Process Healthcare Data in Hadoop, Pig

 

Let us take that, the file’s name is blood-sugar.log. First, we will feed the data to Hadoop with this command :

Vim
1
hadoop fs -put blood-sugar.log

Depending on the setup, we may face error after running the above command, then we need to append location where diskX is disk number, USERNAME is like admin1234 in this way :

Advertisement

---

Vim
1
hadoop fs -put access.log.1 /diskX/home/USERNAME/

If we run :

Vim
1
hadoop fs -ls -R

We will get output like this pointing success :

Vim
1
2
drwxrwxrwx+  - admin admin          0 2018-05-01 17:04 .staging
-rwxrwxrwx+  3 admin admin   12183708 2018-05-01 16:33 blood-sugar.log

Now, we will create a script named script.pig at the same location with this content, this script is for server log and needs editing depending on style of your data :

Vim
1
2
3
4
5
6
7
8
9
DEFINE ApacheCommonLogLoader org.apache.pig.piggybank.storage.apachelog.CommonLogLoader();
 
logs = LOAD '/path/to/USERNAMER/access.log.1' USING ApacheCommonLogLoader AS (addr: chararray, logname: chararray, user: chararray, time: chararray, method: chararray, uri: chararray, proto: chararray, status: int, bytes: int);
 
addrs = GROUP logs BY addr;
 
counts = FOREACH addrs GENERATE flatten($0), COUNT($1) as count;
 
DUMP counts;

You need to change /path/to/USERNAMER/access.log.1 in the above example to real path, file name and save the file. Now run this command :

Vim
1
locate piggybank.jar

At the end of output, you’ll get something like these :

Vim
1
2
3
4
...
/usr/iop/4.1.0.0/hive/lib/piggybank.jar
/usr/iop/4.1.0.0/pig/piggybank.jar
/usr/iop/4.1.0.0/pig/lib/piggybank.jar

How To Process Healthcare Data in Hadoop Pig

We will use that /usr/iop/4.1.0.0/pig/piggybank.jar path. We will run pig command to bring grunt interface :

Vim
1
pig

Then, run this command, then quit :

Vim
1
2
REGISTER '/usr/iop/4.1.0.0/pig/piggybank.jar';
quit

Then we will run the pig script (which we provided above for server log, and you’ll edit to meet your need) :

Vim
1
pig -x local script.pig

This will return the intended output.

Facebook Twitter Pinterest

Abhishek Ghosh

About Abhishek Ghosh

Abhishek Ghosh is a Businessman, Surgeon, Author and Blogger. You can keep touch with him on Twitter - @AbhishekCTRL.

Here’s what we’ve got for you which might like :

Articles Related to How To Process Healthcare Data in Hadoop, Pig (IBM Demo Cloud)

  • How To Process Server Log in Hadoop, Pig : Free IBM Analytics Demo Cloud

    Here is real basic example with commands to show how to process server log in Hadoop, Pig can be done using free IBM Analytics Demo Cloud.

  • Install Apache Hadoop on Ubuntu on Single Cloud Server Instance

    Here is How Install Apache Hadoop on Ubuntu on Single Cloud Server Instance in Stand-Alone Mode With Minimum System Requirement and Commands.

  • Nginx WordPress Installation Guide (All Steps)

    This is a Full Nginx WordPress Installation Guide With All the Steps, Including Some Optimization and Setup Which is Compatible With WordPress DOT ORG Example Settings For Nginx.

  • WordPress & PHP : Different AdSense Units on Mobile Devices

    Here is How To Serve Different AdSense Units on Mobile Devices on WordPress With PHP. WordPress Has Function Which Can Be Used In Free Way.

performing a search on this website can help you. Also, we have YouTube Videos.

Take The Conversation Further ...

We'd love to know your thoughts on this article.
Meet the Author over on Twitter to join the conversation right now!

If you want to Advertise on our Article or want a Sponsored Article, you are invited to Contact us.

Contact Us

Subscribe To Our Free Newsletter

Get new posts by email:

Please Confirm the Subscription When Approval Email Will Arrive in Your Email Inbox as Second Step.

Search this website…

 

Popular Articles

Our Homepage is best place to find popular articles!

Here Are Some Good to Read Articles :

  • Cloud Computing Service Models
  • What is Cloud Computing?
  • Cloud Computing and Social Networks in Mobile Space
  • ARM Processor Architecture
  • What Camera Mode to Choose
  • Indispensable MySQL queries for custom fields in WordPress
  • Windows 7 Speech Recognition Scripting Related Tutorials

Social Networks

  • Pinterest (24.3K Followers)
  • Twitter (5.8k Followers)
  • Facebook (5.7k Followers)
  • LinkedIn (3.7k Followers)
  • YouTube (1.3k Followers)
  • GitHub (Repository)
  • GitHub (Gists)
Looking to publish sponsored article on our website?

Contact us

Recent Posts

  • Hybrid Multi-Cloud Environments Are Becoming UbiquitousJuly 12, 2023
  • Data Protection on the InternetJuly 12, 2023
  • Basics of BJT TransistorJuly 11, 2023
  • What is Confidential Computing?July 11, 2023
  • How a MOSFET WorksJuly 10, 2023
PC users can consult Corrine Chorney for Security.

Want to know more about us?

Read Notability and Mentions & Our Setup.

Copyright © 2023 - The Customize Windows | dESIGNed by The Customize Windows

Copyright  · Privacy Policy  · Advertising Policy  · Terms of Service  · Refund Policy