Big Data Interview Questions and Answers- Sqoop

1) purpose of sqoop?
ans : To import and export data from rdbms to hdfs and vice versa.

2) sqoop job?
ans : Sqoop job creates and saves the import and export commands. It specifies parameters to identify and recall the saved job. This re-calling or re-executing is used in the incremental import, which can import the updated rows from RDBMS table to HDFS.

3) command to execute a sqoop job?
ans : sqoop job –exec myjob

4) codegen in sqoop?
ans : From the viewpoint of object-oriented application, every database table has one DAO class that contains ‘getter’ and ‘setter’ methods to initialize objects. This tool (-codegen) generates the DAO class automatically.It generates DAO class in Java, based on the Table Schema structure. The Java definition is instantiated as a part of the import process. The main usage of this tool is to check if Java lost the Java code. If so, it will create a new version of Java with the default delimiter between fields.

5) sqoop workflow in oozie?
ans : <workflow-app name=”sample-wf” xmlns=”uri:oozie:workflow:0.1″>

<action name=”myfirsthivejob”>
<sqoop xmlns=”uri:oozie:sqoop-action:0.2″>
<job-traker>foo:8021</job-tracker>
<name-node>bar:8020</name-node>
<prepare>
<delete path=”${jobOutput}”/>
</prepare>
<configuration>
<property>
<name>mapred.compress.map.output</name>
<value>true</value>
</property>
</configuration>
<command>import –connect jdbc:hsqldb:file:db.hsqldb –table TT –target-dir hdfs://localhost:8020/user/tucu/foo -m 1</command>
</sqoop>
<ok to=”myotherjob”/>
<error to=”errorcleanup”/>
</action>

</workflow-app>

(or)

<workflow-app name=”sample-wf” xmlns=”uri:oozie:workflow:0.1″>

<action name=”myfirsthivejob”>
<sqoop xmlns=”uri:oozie:sqoop-action:0.2″>
<job-traker>foo:8021</job-tracker>
<name-node>bar:8020</name-node>
<arg>import</arg>
<arg>–connect</arg>
<arg>jdbc:hsqldb:file:db.hsqldb</arg>
<arg>–table</arg>
<arg>TT</arg>
<arg>–target-dir</arg>
<arg>hdfs://localhost:8020/user/tucu/foo</arg>
<arg>-m</arg>
<arg>1</arg>
</sqoop>
<ok to=”myotherjob”/>
<error to=”errorcleanup”/>
</action>

</workflow-app>

6)import subset of tableDate?
ans : sqoop import \
–connect jdbc:mysql://localhost/userdb \
–username root \
–table emp_add \
–m 1 \
–where “city =’sec-bad’” \
–target-dir /wherequery

7) import incremental import?
ans : sqoop import \
–connect jdbc:mysql://localhost/userdb \
–username root \
–table emp \
–m 1 \
–incremental append \
–check-column id \
-last value 1205

Drop Us A Query

Trending Courses
  • Python and Django Online Training
  • Python is a dynamic interrupted language which is used in wide varieties of applications. It is very interactive object oriented and high-level programming language.

  • Tableau Online Training
  • Tableau is a Software company that caters interactive data visualization products that provide Business Intelligence services. The company’s Head Quarters is in Seattle, USA.

  • MicroStrategy Online Training
  • Micro Strategy is one of the few independent and publicly trading Business Intelligence software provider in the market. The firm is operational in 27 Countries around the globe.

  • PEGA (PRPC) 7.2 Certification Online Training
  • Pega Systems Inc. is a Cambridge, Massachusetts based Software Company. It is known for developing software for Customer Relationship Management (CRM) and Business process Management (BPM).

  • Workday Online Training
  • Workday specialises in providing Human Capital Management, Financial Management and payroll in online domain.It is a major web based ERP software vendor.

  • Power BI Online Training
  • Power BI is business analytics service by Microsoft. With Power BI, end users can develop reports and dashboards without depending on IT staff or Database Administrator.


 

100% Secure Payments. All major credit & debit cards accepted.