{"id":79723,"date":"2020-08-25T09:00:13","date_gmt":"2020-08-25T03:30:13","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=79723"},"modified":"2020-08-25T09:00:13","modified_gmt":"2020-08-25T03:30:13","slug":"apache-sqoop-jobs","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/","title":{"rendered":"Sqoop Jobs &#8211; Create and Schedule Jobs Through Sqoop"},"content":{"rendered":"<p>This Sqoop jobs article will explain how to create and maintain Sqoop jobs. The article first explains what Sqoop Job is, how we can create, and execute the Sqoop Saved job.<\/p>\n<p>Later on, you will explore the purpose of Sqoop job, what its syntax is, and many more. The article will provide a complete guide about how we can create, inspect, verify, and execute the Sqoop jobs. Let&#8217;s start!!!<\/p>\n<p>&nbsp;<\/p>\n<h3>What is Sqoop Saved Job?<\/h3>\n<p>In Sqoop, the imports and exports can be performed repeatedly by issuing the same Sqoop command multiple times. Apache Sqoop allows us to define the saved jobs that make this process easier.<\/p>\n<p>The Sqoop saved job records the configuration information needed for executing the Sqoop command at a later time. The sqoop-job tool allows us to create and work with saved jobs.<\/p>\n<p>Now it&#8217;s time to explore Sqoop jobs.<\/p>\n<h3>What are Sqoop Jobs?<\/h3>\n<p>The Sqoop Job is a tool that allows us to create and work with the Saved jobs. The Sqoop Saved jobs remember the parameters which are used for specifying a job, so they can be easily re-executed by invoking the job by its handle.<\/p>\n<p>In simple words, the Sqoop job creates and saves the Sqoop import and export commands. The Sqoop job specifies the parameters to identify and recall the Sqoop saved job.<\/p>\n<p>This re-executing or re-calling is used in the Sqoop incremental import, which imports the updated rows from relational database tables to HDFS.<\/p>\n<p><strong>Syntax of Sqoop job:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ sqoop job (generic-args) (job-args) [-- [subtool-name] (subtool-args)]\n$ sqoop-job (generic-args) (job-args) [-- [subtool-name] (subtool-args)]\n<\/pre>\n<p>We have to pass the Hadoop generic arguments before passing any job arguments, but we can pass job arguments in any order with respect to each other.<\/p>\n<p><strong>Sqoop Job Management arguments are:<\/strong><\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Argument<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;create &lt;job-id&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">It will define a new saved job with a specified job-id (name). The second Sqoop command-line, separated by a &#8212; should be specified. This will define the saved job.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;delete &lt;job-id&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Delete a saved job.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;exec &lt;job-id&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">It will execute the saved job.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;show &lt;job-id&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">Show the parameters for the saved job.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;list<\/span><\/td>\n<td><span style=\"font-weight: 400\">List all saved jobs<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Common arguments are:<\/strong><\/p>\n<table style=\"height: 189px\" width=\"813\">\n<tbody>\n<tr>\n<td><b>Argument<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;help<\/span><\/td>\n<td><span style=\"font-weight: 400\">Print usage instructions<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;verbose<\/span><\/td>\n<td><span style=\"font-weight: 400\">Print more information while working<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Let us now explore how we can create, inspect, verify, and execute the Sqoop Job.<\/p>\n<h3>How to Create Sqoop Jobs?<\/h3>\n<ul>\n<li>We can create the saved jobs with the <strong>&#8211;create<\/strong> action.<\/li>\n<li>The &#8211;create operation requires a &#8212; followed by the tool name and its arguments.<\/li>\n<li>The tool and its arguments form the basis of the Sqoop saved job.<\/li>\n<\/ul>\n<p><strong>Example 1:<\/strong> In this example, we are creating a Sqoop job named firstjob which can import table data from relational databases to HDFS.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ sqoop job --create firstjob -- import \\\n--connect jdbc:mysql:\/\/localhost\/demodb \\\n--username root \\\n-p root \\\n--table emp \\\n-m 1\\\n--target-dir \/targetfolder\n<\/pre>\n<p>The above command will create a job that imports data from the <strong>\u201cemp\u201d<\/strong> table in the <strong>\u201cdemodb\u201d<\/strong> database.<\/p>\n<h4>Verifying Sqoop Jobs<\/h4>\n<p>We can verify the Saved job by using the &#8211;list argument.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ sqoop job --list<\/pre>\n<h3>How to inspect a job in Sqoop?<\/h3>\n<p>We can inspect the Sqoop job with the &#8211;show argument.<br \/>\n<strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ sqoop job --show firstjob\n<\/pre>\n<h3>How to Execute a Sqoop job?<\/h3>\n<p>We can use the \u2018&#8211;exec\u2019 option for executing a Sqoop saved job.<br \/>\n<strong>Example:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ sqoop job --exec firstjob<\/pre>\n<p>The above command will execute the saved job named \u201cfirstjob\u201d.<\/p>\n<h3>Summary<\/h3>\n<p>In this article, you have explored how you can create, inspect, verify, and execute sqoop jobs. Apart from this, you had also learned the syntax and the purpose of the sqoop job. The article had also enlisted the essential arguments used with the Sqoop job.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This Sqoop jobs article will explain how to create and maintain Sqoop jobs. The article first explains what Sqoop Job is, how we can create, and execute the Sqoop Saved job. Later on, you&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":79729,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3163],"tags":[3207],"class_list":["post-79723","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sqoop","tag-sqoop-jobs"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Sqoop Jobs - Create and Schedule Jobs Through Sqoop - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn what are Sqoop Jobs, how we can create and execute the Sqoop Saved job. Also learn the purpose of Sqoop job, its syntax and arguments with example.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sqoop Jobs - Create and Schedule Jobs Through Sqoop - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn what are Sqoop Jobs, how we can create and execute the Sqoop Saved job. Also learn the purpose of Sqoop job, its syntax and arguments with example.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-25T03:30:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/Sqoop-Job-TM.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sqoop Jobs - Create and Schedule Jobs Through Sqoop - TechVidvan","description":"Learn what are Sqoop Jobs, how we can create and execute the Sqoop Saved job. Also learn the purpose of Sqoop job, its syntax and arguments with example.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/","og_locale":"en_US","og_type":"article","og_title":"Sqoop Jobs - Create and Schedule Jobs Through Sqoop - TechVidvan","og_description":"Learn what are Sqoop Jobs, how we can create and execute the Sqoop Saved job. Also learn the purpose of Sqoop job, its syntax and arguments with example.","og_url":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-08-25T03:30:13+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/Sqoop-Job-TM.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Sqoop Jobs &#8211; Create and Schedule Jobs Through Sqoop","datePublished":"2020-08-25T03:30:13+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/"},"wordCount":578,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/Sqoop-Job-TM.jpg","keywords":["sqoop jobs"],"articleSection":["Sqoop Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/","url":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/","name":"Sqoop Jobs - Create and Schedule Jobs Through Sqoop - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/Sqoop-Job-TM.jpg","datePublished":"2020-08-25T03:30:13+00:00","description":"Learn what are Sqoop Jobs, how we can create and execute the Sqoop Saved job. Also learn the purpose of Sqoop job, its syntax and arguments with example.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/Sqoop-Job-TM.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/Sqoop-Job-TM.jpg","width":1200,"height":628,"caption":"sqoop jobs"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-jobs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Sqoop Jobs &#8211; Create and Schedule Jobs Through Sqoop"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/79723","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=79723"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/79723\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/79729"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=79723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=79723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=79723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}