{"id":79612,"date":"2020-08-24T09:00:30","date_gmt":"2020-08-24T03:30:30","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=79612"},"modified":"2020-08-24T09:00:30","modified_gmt":"2020-08-24T03:30:30","slug":"apache-sqoop-eval","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/","title":{"rendered":"Apache Sqoop Eval Arguments and Examples"},"content":{"rendered":"<p>For running any simple SQL queries against the database, the Sqoop Eval is used in Apache Sqoop. In this Sqoop Eval article, we will study each and everything about the Sqoop Eval. The article first explains what Sqoop Eval is.<\/p>\n<p>Later on, in this article, you will explore Sqoop Eval syntax and commands. We had explained Sqoop Eval with an example to make it easier for you to understand.<\/p>\n<p>First, let\u2019s see what actually the Sqoop Eval is.<\/p>\n<p>&nbsp;<\/p>\n<h3>What is Sqoop Eval?<\/h3>\n<p>The Sqoop eval allows us to run SQL queries against the database. It prints the results on the console. Also, it allows us to preview our import queries to ensure that the data has been imported as expected.<\/p>\n<p>In simpler words, the Sqoop Eval is available for modeling as well as for defining SQL statements. It allows users to run the user-defined SQL queries against the database and show the results on the console.<\/p>\n<p>We can evaluate any type of SQL queries, either DDL or DML, by using Sqoop Eval.<\/p>\n<h3>Why Sqoop Eval?<\/h3>\n<p>The main purpose of the Sqoop Eval is to allow the users to execute SQL queries against the database quickly. The results are then shown on the console. Also, it allows the users to preview their Apache Sqoop import queries to ensure them that they have imported the data they expected.<\/p>\n<p><strong>Note:<\/strong> Basically, the Sqoop Eval is provided only for evaluation purposes. We generally use it for just verifying database connection from within the Apache Sqoop or for testing simple queries. We cannot use the Sqoop Eval in the production workflows.<\/p>\n<p><strong>Sqoop Eval Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ sqoop eval (generic-args) (eval-args)<\/pre>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ sqoop-eval (generic-args) (eval-args)<\/pre>\n<p>We can enter eval arguments in any order with respect to each other, but the Hadoop generic arguments must precede eval arguments.<\/p>\n<p>Let us now see the Common arguments and the SQL Evaluation arguments.<\/p>\n<h3>Common Arguments<\/h3>\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;connect &lt;jdbc-uri&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument specifies JDBC connect string<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;connection-manager &lt;class-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument specifies connection manager class to use<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;driver &lt;class-name&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument specifies the manually specified JDBC driver class to use<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;hadoop-home &lt;dir&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument specifies the override $HADOOP_HOME<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;help<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument specifies the print usage instructions<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">-P<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument read password from console<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;password &lt;password&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument sets the authentication password<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;username &lt;username&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument sets the\u00a0 authentication username<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;verbose<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument print more information while working<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">&#8211;connection-param-file &lt;filename&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument specifies optional properties file who provides connection parameters<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>SQL Eval Arguments<\/h3>\n<table>\n<tbody>\n<tr>\n<td><span style=\"font-weight: 400\">Argument<\/span><\/td>\n<td><span style=\"font-weight: 400\">Description<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">-e,&#8211;query &lt;statement&gt;<\/span><\/td>\n<td><span style=\"font-weight: 400\">This argument is used for specifying execute <\/span><i><span style=\"font-weight: 400\">statements<\/span><\/i><span style=\"font-weight: 400\"> in SQL.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Let us now study Sqoop Eval with the help of an example.<\/p>\n<p><strong>Steps to be done before any SQL Query Evaluation<\/strong><\/p>\n<p><strong>1:<\/strong> First change the directory to the \/usr\/local\/hadoop\/sbin by using the command<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">cd \/usr\/local\/hadoop\/sbin<\/pre>\n<p><strong>2:<\/strong> Start all the Hadoop daemons by using the below command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">start-all.sh<\/pre>\n<p><strong>3:<\/strong> Run the jps command.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">jps<\/pre>\n<p><strong>4:<\/strong> Now change the directory to the \/usr\/local\/Sqoop\/bin by using the below command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">cd \/usr\/local\/sqoop\/bin<\/pre>\n<h4>SQL Select query Evaluation in Sqoop Eval<\/h4>\n<p>Suppose we have to select the five records from the emp_info table in the database demo. Then we can do so by running the below command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sqoop eval --connect jdbc:mysql:\/\/localhost\/demo \\\n    --query \"SELECT * FROM emp_info LIMIT 5\"\n<\/pre>\n<h4>SQL Insert query Evaluation in Sqoop Eval<\/h4>\n<p>Suppose we have to insert a row in the table emp_info present in the database demo, which contains emp_name, emp_designation, and emp_state. Then we can do so by running the below command:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$ sqoop eval --connect jdbc:mysql:\/\/localhost\/demo \\\n    -e \"INSERT INTO emp_info VALUES('Raj', 'Junior Eng.', 'MP' )\"\n<\/pre>\n<p>If the command executes successfully, then this command will display the status of updated rows on the console.<br \/>\nThis is all about Sqoop Eval.<\/p>\n<h3>Summary<\/h3>\n<p>In short, we can say that Sqoop Eval is a tool that allows users to run their SQL queries against the database. The article had explained the whole concept of Sqoop Eval.<\/p>\n<p>I hope you clearly understand the main purpose of Sqoop Eval and its syntax and commands after reading this article.<\/p>\n<p>The article has enlisted the common arguments as well as the evaluation arguments. Moreover, you had also seen the Select Query Evaluation and the Insert Query Evaluation.<\/p>\n<p>If you are still having any queries regarding Sqoop Eval, then share it with us in the comment section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For running any simple SQL queries against the database, the Sqoop Eval is used in Apache Sqoop. In this Sqoop Eval article, we will study each and everything about the Sqoop Eval. The article&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":79656,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3163],"tags":[3174],"class_list":["post-79612","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sqoop","tag-sqoop-eval"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apache Sqoop Eval Arguments and Examples - TechVidvan<\/title>\n<meta name=\"description\" content=\"Sqoop Eval is a tool that allows users to run their SQL queries against the database. Learn the purpose of Sqoop Eval, its syntax and commands.\" \/>\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-eval\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Sqoop Eval Arguments and Examples - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Sqoop Eval is a tool that allows users to run their SQL queries against the database. Learn the purpose of Sqoop Eval, its syntax and commands.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/\" \/>\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-24T03:30:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/sqoop-eval-tv.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=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache Sqoop Eval Arguments and Examples - TechVidvan","description":"Sqoop Eval is a tool that allows users to run their SQL queries against the database. Learn the purpose of Sqoop Eval, its syntax and commands.","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-eval\/","og_locale":"en_US","og_type":"article","og_title":"Apache Sqoop Eval Arguments and Examples - TechVidvan","og_description":"Sqoop Eval is a tool that allows users to run their SQL queries against the database. Learn the purpose of Sqoop Eval, its syntax and commands.","og_url":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2020-08-24T03:30:30+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/sqoop-eval-tv.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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Apache Sqoop Eval Arguments and Examples","datePublished":"2020-08-24T03:30:30+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/"},"wordCount":704,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/sqoop-eval-tv.jpg","keywords":["sqoop eval"],"articleSection":["Sqoop Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/","url":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/","name":"Apache Sqoop Eval Arguments and Examples - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/sqoop-eval-tv.jpg","datePublished":"2020-08-24T03:30:30+00:00","description":"Sqoop Eval is a tool that allows users to run their SQL queries against the database. Learn the purpose of Sqoop Eval, its syntax and commands.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/sqoop-eval-tv.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2020\/08\/sqoop-eval-tv.jpg","width":1200,"height":628,"caption":"sqoop eval"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/apache-sqoop-eval\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Apache Sqoop Eval Arguments and Examples"}]},{"@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\/79612","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=79612"}],"version-history":[{"count":0,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/79612\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/79656"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=79612"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=79612"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=79612"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}