This site uses cookies to deliver our services. By using this site, you acknowledge that you have read and understand our Cookie and Privacy policy. Your use of Kontext website is subject to this policy. Allow Cookies and Dismiss

Use Hadoop File System Task in SSIS to Write File into HDFS

336 views 0 comments last modified about 5 months ago Raymond Tang

SSIS hadoop hdfs

In this page

Context

SQL Server Integration Service (SSIS) has tasks to perform operations against Hadoop, for example:

  • Hadoop File System Task
  • Hadoop Hive Task
  • Hadoop Pig Task

In Data Flow Task, you can also use:

  • Hadoop HDFS Source
  • Hadoop HDFS Destination

In this page, I’m going to demonstrate how to write file into HDFS through SSIS Hadoop File System Task.

References

https://docs.microsoft.com/en-us/sql/integration-services/control-flow/hadoop-file-system-task

Prerequisites

Hadoop

Refer to the following page to install Hadoop if you don’t have one instance to play with.

Install Hadoop 3.0.0 in Windows (Single Node)

SSIS

SSIS can be installed via SQL Server Data Tools (SSDT). In this example, I am using 15.1.

Create Hadoop connection manager

In your SSIS package, create a Hadoop Connection Manager:

image

In WebHDFS tab of the editor, specify the following details:

image

Click Test Connection button to ensure you can connect and then click OK:

image

Create a file connection manager

Create a local CSV file

Create a local CSV file named F:\DataAnalytics\Sales.csv with the following content:

Month,Amount
1/01/2017,30022
1/02/2017,12334
1/03/2017,33455
1/04/2017,50000
1/05/2017,33333
1/06/2017,11344
1/07/2017,12344
1/08/2017,24556
1/09/2017,46667

Create a file connection manager

Create a file connection manager Sales.csv which points to the file created above.

image

Create Hadoop File System Task

Use the two connection managers created above to create a Hadoop File System Task:

image

In the above settings, it uploads Sales.csv into /Sales.csv in HDFS.

Run the package

Run the package or execute the task to make sure it is completed successfully:

image

Verify the result via HDFS CLI

Use the following command to verify whether the file is uploaded successfully:

hdfs dfs -ls \

image

You can also print out the content via the following command:

hdfs dfs -cat /Sales.csv

image

Verify the result through Name Node web UI

image

image

WebHDFS REST API reference

    https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-hdfs/WebHDFS.html

Summary

It is very easy to upload files into HDFS through SSIS. You can also upload the whole directory into HDFS through this task if you change the file connection manager to pointing to a folder.

If you have any questions, please let me know.

Related pages

Install Hadoop 3.0.0 in Windows (Single Node)

2515 views   14 comments last modified about 5 months ago

This page summarizes the steps to install Hadoop 3.0.0 in your Windows environment. Reference page: https://wiki.apache.org/hadoop/Hadoop2OnWindows ...

View detail

Resolve Hadoop RemoteException - Name node is in safe mode

60 views   0 comments last modified about 3 months ago

In Safe Mode, the HDFS cluster is read-only. After completion of block replication maintenance activity, the name node leaves safe mode automatically. If you try to delete files in safe mode, the following exception may raise: org.apache.hadoop.ipc.RemoteException(org.apac...

View detail

Configure Sqoop in a Edge Node of Hadoop Cluster

226 views   0 comments last modified about 3 months ago

This page continues with the following documentation about configuring a Hadoop multi-nodes cluster via adding a new edge node to configure administration or client tools. ...

View detail

Configure YARN and MapReduce Resources in Hadoop Cluster

81 views   0 comments last modified about 3 months ago

When configuring YARN and MapReduce in Hadoop cluster, it is very important to configure the memory and virtual processors correctly. If the configurations are incorrect, the nodes may not be able to start properly and the applications may not be able to run successfully. For example...

View detail

Configure Hadoop 3.1.0 in a Multi Node Cluster

1020 views   0 comments last modified about 3 months ago

Previously, I summarized the steps to install Hadoop in a single node Windows machine. Install Hadoop 3.0.0 in Windows (Single Node) In this page, I...

View detail

Install Big Data Tools (Spark, Zeppelin, Hadoop) in Windows for Learning and Practice

317 views   2 comments last modified about 3 months ago

Are you a Windows/.NET developer and willing to learn big data concepts and tools in your Windows? If yes, you can follow the links below to install them in your PC. The installations are usually easier to do in Linux/UNIX but they are not difficult to implement in Windows either since the...

View detail

Add comment

Please login first to add comments.  Log in New user?  Register

Comments (0)

No comments yet.