

{"id":50,"date":"2016-05-31T12:53:14","date_gmt":"2016-05-31T12:53:14","guid":{"rendered":"http:\/\/data-flair.training\/blogs\/?p=50"},"modified":"2018-11-20T14:19:40","modified_gmt":"2018-11-20T08:49:40","slug":"scala-spark-shell-commands","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/","title":{"rendered":"Spark Shell Commands to Interact with Spark-Scala"},"content":{"rendered":"<h2>1. Objective<\/h2>\n<p>The shell acts as an interface to access the operating system\u2019s service. <a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-tutorial\/\"><strong>Apache Spark<\/strong><\/a> is shipped with an interactive shell\/scala prompt with the interactive shell we can run different commands to process the data. This is an\u00a0Apache Spark Shell commands guide with step by step list of basic spark commands\/operations to interact with <strong>Spark shell<\/strong>.<\/p>\n<p>Before starting you must have Spark installed. follow this guide to <a href=\"http:\/\/data-flair.training\/blogs\/install-configure-run-apache-spark-2-x-single-node\/\">install Apache Spark.<\/a><br \/>\nAfter Spark installation, You can create <a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-rdd-tutorial\/\"><strong>RDDs<\/strong><\/a> and perform various transformations and actions like filter(), partitions(), cache(), count(), collect, etc. In this blog, we will also discuss the integration of <a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-hadoop-compatibility\/\">Spark with Hadoop<\/a>, how spark reads the data from HDFS and write to HDFS?.<\/p>\n<div id=\"attachment_42919\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-42919\" class=\"size-full wp-image-42919\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01.jpg\" alt=\"Spark Shell Commands to Interact with Spark-Scala\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-42919\" class=\"wp-caption-text\">Spark Shell Commands to Interact with Spark-Scala<\/p><\/div>\n<h2>2. Scala &#8211; Spark Shell Commands<\/h2>\n<p><strong>Start the Spark Shell<\/strong><\/p>\n<p><strong><a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-introduction-tutorial\/\">Apache Spark<\/a><\/strong> is shipped with an interactive shell\/scala prompt, as the spark is developed in <strong><a href=\"http:\/\/data-flair.training\/blogs\/why-you-should-learn-scala-introductory-tutorial\/\">Scala<\/a><\/strong>. Using the interactive shell we will run different commands (<a href=\"http:\/\/data-flair.training\/blogs\/rdd-transformations-actions-apis-apache-spark\/\"><strong>RDD<\/strong>\u00a0<strong>transformation\/action<\/strong><\/a>) to process the data.<br \/>\nThe command to start the Apache Spark Shell:<br \/>\n[php] $bin\/spark-shell [\/php]<\/p>\n<h3>2.1. Create a new RDD<\/h3>\n<p><strong>a)<\/strong> <strong>Read File from local filesystem and create an RDD<\/strong>.<\/p>\n<p>[php]scala&gt; val data = sc.textFile(&#8220;data.txt&#8221;)[\/php]<\/p>\n<p><em>Note: sc is the object of SparkContext<\/em><\/p>\n<p><em>Note: You need to create a file data.txt in Spark_Home directory<\/em><\/p>\n<p><strong>b) Create an RDD through Parallelized\u00a0Collection<\/strong><\/p>\n<p>[php]scala&gt; val no = Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)<\/p>\n<p>scala&gt; val noData = sc.parallelize(no)[\/php]<\/p>\n<p><strong>c) From Existing RDDs<\/strong><\/p>\n<p>[php]scala&gt; val newRDD = no.map(data =&gt; (data * 2))[\/php]<\/p>\n<p>These are <strong><a href=\"http:\/\/data-flair.training\/blogs\/how-to-create-rdds-in-apache-spark\/\">three methods to create the RDD<\/a><\/strong>. We can use the first method, when data is already available with the external systems like a local filesystem,<strong> <a href=\"http:\/\/data-flair.training\/blogs\/comprehensive-hdfs-guide-introduction-architecture-data-read-write-tutorial\/\">HDFS<\/a><\/strong>,<strong><a href=\"http:\/\/data-flair.training\/blogs\/hbase-tutorial-beginners-guide\/\"> HBase<\/a><\/strong>, <strong>Cassandra, S3<\/strong>, etc. One can create an RDD by calling a <strong>textFile<\/strong> method of <a href=\"http:\/\/data-flair.training\/blogs\/sparkcontext-in-apache-spark-tutorial\/\"><strong>Spark Context<\/strong><\/a> with path \/ URL as the argument. The second approach can be used with the existing collections and the third one is a way to create new RDD from the existing one.<\/p>\n<h3>2.2. Number of Items in the RDD<\/h3>\n<p>Count the number of items available in the RDD. To count the items we need to call an Action:<\/p>\n<p>[php]scala&gt; data.count()[\/php]<\/p>\n<h3>2.3. Filter Operation<\/h3>\n<p>Filter the RDD and create new RDD of items which contain word \u201cDataFlair\u201d. To filter, we need to call transformation filter, which will return a new RDD with subset of items.<\/p>\n<p>[php]scala&gt; val DFData = data.filter(line =&gt; line.contains(&#8220;DataFlair&#8221;))[\/php]<\/p>\n<h3>2.4. Transformation and Action together<\/h3>\n<p>For complex requirements, we can chain multiple operations together like filter transformation and count action together:<\/p>\n<p>[php]scala&gt; data.filter(line =&gt; line.contains(&#8220;DataFlair&#8221;)).count()[\/php]<\/p>\n<h3>2.5. Read the first item from the RDD<\/h3>\n<p>To read the first item from the file,\u00a0you\u00a0can use the following command:<\/p>\n<p>[php]scala&gt; data.first()[\/php]<\/p>\n<h3>2.6. Read the first 5 item from the RDD<\/h3>\n<p>To read the first 5 item from the file, you can use the following command:<\/p>\n<p>[php]scala&gt; data.take(5)[\/php]<\/p>\n<h3>2.7. RDD Partitions<\/h3>\n<p>An RDD is made up of multiple partitions, to count the number of partitions:<\/p>\n<p>[php]scala&gt; data.partitions.length[\/php]<\/p>\n<p><em>Note: Minimum no. of partitions in the RDD is 2 (by default). When we create RDD from <a href=\"http:\/\/data-flair.training\/blogs\/apache-hadoop-hdfs-introduction-tutorial\/\"><strong>HDFS<\/strong><\/a> file then a number of blocks will be equals to the number of partitions.<\/em><\/p>\n<h3>2.8. Cache the file<\/h3>\n<p>Caching is the optimization technique. Once we <a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-rdd-persistence-caching\/\"><strong>cache the RDD<\/strong><\/a> in the memory all future computation will work on the <a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-in-memory-computing\/\"><strong>in-memory<\/strong><\/a> data, which saves disk seeks and improve the performance.<\/p>\n<p>[php]scala&gt; data.cache()[\/php]<\/p>\n<p>RDD will not be cached once you run above operation, you can visit the web UI:<\/p>\n<p>http:\/\/localhost:4040\/storage, it will be blank. RDDs are not explicitly cached once we run <strong>cache()<\/strong>, rather<\/p>\n<p>RDDs will be cached once we run the Action, which actually needs data read from the disk.<\/p>\n<p><strong>Let\u2019s run some actions<\/strong><\/p>\n<p>[php]scala&gt; data.count()[\/php]<\/p>\n<p>[php]scala&gt; data.collect()[\/php]<\/p>\n<p>Now as we have run some actions on the data file, which needs to be read from the disk to perform those operations. During this process, Spark will cache the file, so that for all future operations will get the data from the memory (no need for any disk interaction). Now if we run any transformation or action it will be done in-memory and will be much faster.<\/p>\n<h3>2.9. Read Data from HDFS file<\/h3>\n<p>To <a href=\"http:\/\/data-flair.training\/blogs\/hdfs-data-read-operation\/\">read data from HDFS<\/a> file we can specify complete hdfs URL like<strong> hdfs:\/\/IP:PORT\/PATH<\/strong><\/p>\n<p>[php]scala&gt; var hFile = sc.textFile(&#8220;hdfs:\/\/localhost:9000\/inp&#8221;)[\/php]<\/p>\n<h3>2.10. Spark WordCount Program in Scala<\/h3>\n<p>One of the most popular operations of <strong><a href=\"http:\/\/data-flair.training\/blogs\/hadoop-mapreduce-tutorial-comprehensive-guide-beginners\/\">MapReduce<\/a><\/strong> \u2013 <strong>Wordcount<\/strong>. Count all the words available in the file.<\/p>\n<p>[php]scala&gt; val wc = hFile.flatMap(line =&gt; line.split(&#8221; &#8220;)).map(word =&gt; (word, 1)).reduceByKey(_ + _)[\/php]<\/p>\n<p>Read the result on console<\/p>\n<p>[php]scala&gt; wc.take(5)[\/php]<\/p>\n<p>It will display first 5 results<\/p>\n<h3>2.11 Write the data to HDFS file<\/h3>\n<p>To<a href=\"http:\/\/data-flair.training\/blogs\/hdfs-data-write-operation\/\"> write the data from HFDS<\/a>:<\/p>\n<p>[php]scala&gt; wc.saveAsTextFile(&#8220;hdfs:\/\/localhost:9000\/out&#8221;)[\/php]<\/p>\n<h2>3. Conclusion<\/h2>\n<p>In conclusion, we can say that using Spark Shell commands we can create RDD (In three ways), read from RDD, and partition RDD. We can even cache the file, read and write data from and to HDFS file and perform various operation on the data using the\u00a0Apache Spark Shell commands.<br \/>\nNow you can <a href=\"http:\/\/data-flair.training\/blogs\/create-spark-scala-project\/\">create your first Spark Scala project<\/a>.<\/p>\n<p><strong>See Also-<\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/data-flair.training\/blogs\/install-apache-spark-multi-node-cluster\/\">Apache Spark installation on multi-node cluster<\/a><\/li>\n<li><a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-map-vs-flatmap\/\">Spark Map vs FaltMap operation<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. Objective The shell acts as an interface to access the operating system\u2019s service. Apache Spark is shipped with an interactive shell\/scala prompt with the interactive shell we can run different commands to process&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":42919,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[896,13021,13022,13041,13114,13142,13153],"class_list":["post-50","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spark","tag-apache-spark","tag-spark","tag-spark-scala","tag-spark-commands","tag-spark-shell-commands","tag-spark-tutorial","tag-spark-shell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spark Shell Commands to Interact with Spark-Scala - DataFlair<\/title>\n<meta name=\"description\" content=\"Apache Spark Shell Commands tutorial- what is Spark,Spark RDD,Spark installation,ways to create RDD,Spark transformations &amp; Actions in scala,HDFS read-write\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spark Shell Commands to Interact with Spark-Scala - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Apache Spark Shell Commands tutorial- what is Spark,Spark RDD,Spark installation,ways to create RDD,Spark transformations &amp; Actions in scala,HDFS read-write\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-31T12:53:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-20T08:49:40+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01.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=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spark Shell Commands to Interact with Spark-Scala - DataFlair","description":"Apache Spark Shell Commands tutorial- what is Spark,Spark RDD,Spark installation,ways to create RDD,Spark transformations & Actions in scala,HDFS read-write","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:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/","og_locale":"en_US","og_type":"article","og_title":"Spark Shell Commands to Interact with Spark-Scala - DataFlair","og_description":"Apache Spark Shell Commands tutorial- what is Spark,Spark RDD,Spark installation,ways to create RDD,Spark transformations & Actions in scala,HDFS read-write","og_url":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2016-05-31T12:53:14+00:00","article_modified_time":"2018-11-20T08:49:40+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Spark Shell Commands to Interact with Spark-Scala","datePublished":"2016-05-31T12:53:14+00:00","dateModified":"2018-11-20T08:49:40+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/"},"wordCount":923,"commentCount":8,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01.jpg","keywords":["apache spark","Spark","spark &amp; Scala","spark commands","spark shell commands","spark tutorial","spark-shell"],"articleSection":["Apache Spark Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/","url":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/","name":"Spark Shell Commands to Interact with Spark-Scala - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01.jpg","datePublished":"2016-05-31T12:53:14+00:00","dateModified":"2018-11-20T08:49:40+00:00","description":"Apache Spark Shell Commands tutorial- what is Spark,Spark RDD,Spark installation,ways to create RDD,Spark transformations & Actions in scala,HDFS read-write","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/05\/SPARK-Shell-Commands-01.jpg","width":1200,"height":628,"caption":"Spark Shell Commands to Interact with Spark-Scala"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/scala-spark-shell-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Apache Spark Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/spark\/"},{"@type":"ListItem","position":3,"name":"Spark Shell Commands to Interact with Spark-Scala"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ce4a0e3e542444fc73bbebf83e89e8b73e2d95ccb1fcee64da9945f078b97c5?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team provides industry-driven content on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our expert educators focus on delivering value-packed, easy-to-follow resources for tech enthusiasts and professionals.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam2\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":7,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"predecessor-version":[{"id":42921,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/50\/revisions\/42921"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/42919"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}