- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Loading data to HDFS - Pig or Spark?
- Labels:
-
Apache Hadoop
-
Apache Pig
-
Apache Spark
Created ‎06-09-2016 02:04 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I want to load some .csv files to HDFS. I already decide that I want to do, in next step, some data transformation with Spark. My question is: I've some advantage to use PIG instead Spark for load data into HDFS?
Many thanks!
Created ‎06-09-2016 02:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you considered using NiFi to load the data? You can read from many different sources, merge the content into large enough portions to optimize the HDFS use, and write the data directly into HDFS.
Created ‎06-09-2016 02:08 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Have you considered using NiFi to load the data? You can read from many different sources, merge the content into large enough portions to optimize the HDFS use, and write the data directly into HDFS.
Created ‎06-09-2016 02:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- NiFi to load data into HDFS
- Spark to do some data transformation (or maybe load data into Hive)
Thanks! 🙂
Created ‎06-09-2016 02:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Each of the components within the Hadoop stack has advantages and disadvantages for various tasks. My recommendation is to try to use the best tool for the job while minimizing the amount of complexity you are dealing with. I think if you try to use "the same tool for all the steps" as you read, you may find that your process works, however it may not be optimal.
NiFi is an excellent approach as well, as emaxwell suggested.
Created ‎06-09-2016 02:11 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In my opinion, there are 2 advantages to using Pig for data loading:
- You are more comfortable programming in Pig.
- You have existing User Defined Functions (UDFs) that you want to use.
Outside of that, you should be able to what you want to with Spark with faster execution times and arguably much more flexibility. The advantage that Spark provides is the ability to use Java, Scala or Python as the language of choice. You can also you use SQL with Spark, which is something you can't do with Pig.
If you are starting from scratch, give Spark a try.
