• 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.

This Article Has Been Shared 698 Times!

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)

  • Installing Local Data Lake on Ubuntu Server : Part 1

    Here is Part 1 of Installing Local Data Lake on Ubuntu Server With Hadoop, Spark, Thriftserver, Jupyter etc To Build a Prediction System.

  • Integration of Apache Hadoop With OpenStack Swift

    The Topic Integration of Apache Hadoop With OpenStack Swift Is Not Exactly New. You Can Follow Our Guide Specially For Handling OpenStack.

  • Install Apache Mahout : Ubuntu 16.04 For Machine Learning Dev

    Here Is How To Install Apache Mahout On Ubuntu 16.04 For Machine Learning Development. We Can Install & Integrate Mahout With Spark, Hadoop.

  • IBM Analytics Demo Cloud : Free Hadoop, Ambari With SSH

    IBM Analytics Demo Cloud is intended to learn Hadoop, Ambari, BigSQL free of cost with SSH access & web console. Here is how to get started.

  • Create Data Science Environment on Cloud Server With Docker

    Here Are the Steps, Commands to Create Data Science Environment on Cloud Server For Data Analysis Starting With a Blank Server With SSH.

Additionally, 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

  • Cyberpunk Aesthetics: What’s in it Special January 27, 2023
  • How to Do Electrical Layout Plan for Adding Smart Switches January 26, 2023
  • What is a Data Mesh? January 25, 2023
  • What is Vehicular Ad-Hoc Network? January 24, 2023
  • Difference Between Panel Light, COB Light, Track Light January 21, 2023

About This Article

Cite this article as: Abhishek Ghosh, "How To Process Healthcare Data in Hadoop, Pig (IBM Demo Cloud)," in The Customize Windows, May 2, 2018, January 29, 2023, https://thecustomizewindows.com/2018/05/how-to-process-healthcare-data-in-hadoop-pig-ibm-demo-cloud/.

Source:The Customize Windows, JiMA.in

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

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
Do not sell my personal information.
Cookie SettingsAccept
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT