{"id":1754,"date":"2026-09-12T05:16:46","date_gmt":"2026-09-12T05:16:46","guid":{"rendered":"https:\/\/prwatech.in\/blog\/?p=1754"},"modified":"2026-09-13T06:46:41","modified_gmt":"2026-09-13T06:46:41","slug":"apache-spark-sql-commands","status":"publish","type":"post","link":"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/","title":{"rendered":"Apache Spark SQL Commands"},"content":{"rendered":"<h1>Apache Spark SQL Commands<\/h1>\n<p>This is a working reference to the core <strong><b>Apache Spark SQL<\/b><\/strong>\u00a0commands, covering how to set up a Spark context, build and query DataFrames and Datasets, group and write data, and register your own functions for use inside SQL queries.<\/p>\n<h2>What is Spark SQL, and Why It Matters<\/h2>\n<p>Spark SQL is the Spark module for working with structured data. It gives you two ways to do the same underlying work, writing SQL queries directly, or using DataFrame and Dataset methods in Scala, and lets you mix both freely in the same program. Under the hood, Spark SQL uses the Catalyst optimizer to turn either style into an efficient execution plan, so choosing SQL syntax over the DataFrame API, or the other way around, is mostly a matter of what reads more clearly for the task at hand, not a performance tradeoff.<\/p>\n<h2>Setting Up a Spark Context<\/h2>\n<p>The <strong><b>SparkContext<\/b><\/strong>, commonly assigned to a variable called sc, is what initializes Spark SQL&#8217;s functionality inside your session. You create it once at the start of a session, then confirm it was created correctly before moving on to any actual data work.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1755\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7.png\" alt=\"Apache Spark SQL Commands\" width=\"850\" height=\"83\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7.png 623w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7-300x29.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3><strong>Check the context created<\/strong><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1756\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/2-7.png\" alt=\"spark sql tutorial\" width=\"850\" height=\"46\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/2-7.png 627w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/2-7-300x16.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2>DataFrame Compared to Dataset<\/h2>\n<p>A <strong><b>Dataset<\/b><\/strong>\u00a0is an optimized, distributed collection of data that uses Spark&#8217;s Catalyst optimizer and Tungsten execution engine for fast processing. A <strong><b>DataFrame<\/b><\/strong>\u00a0is a Dataset organized into named columns, conceptually the same as a table in a relational database, or a data frame in Python or R.<\/p>\n<p>The practical difference that matters most day to day is typing. A DataFrame is untyped, its columns are checked at run time, which makes it quick to work with but means a mistyped column name only surfaces as an error once the code actually runs. A Dataset is strongly typed in Scala, so many mistakes get caught at compile time instead. In Scala and Java, Datasets give you that extra safety. In PySpark, there is no separate Dataset API, so a DataFrame is effectively what you have to work with either way.<\/p>\n<ul>\n<li>Use a DataFrame when you want SQL like queries, joins, and aggregations with the least setup, which covers most day to day analysis.<\/li>\n<li>Use a Dataset in Scala or Java when you want compile time type checking, or when your logic is easier to express as typed functional transformations such as map and filter.<\/li>\n<\/ul>\n<h2>Building and Viewing a DataFrame<\/h2>\n<p>A DataFrame is typically created by reading data from a source, such as a JSON file, through the active Spark session, then confirmed by displaying its contents.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1757\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/3-7.png\" alt=\"spark sql tutorial pdf\" width=\"850\" height=\"62\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/3-7.png 626w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/3-7-300x22.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1758\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/4-7.png\" alt=\"spark sql query examples\" width=\"850\" height=\"53\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/4-7.png 624w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/4-7-300x19.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1759\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/5-7.png\" alt=\"Apache spar sql data frame\" width=\"850\" height=\"54\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/5-7.png 626w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/5-7-300x19.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1760\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/6-7.png\" alt=\"scala readvalue\" width=\"850\" height=\"487\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/6-7.png 600w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/6-7-300x172.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Checking the Schema<\/h3>\n<p>The <strong><b>printSchema<\/b><\/strong>\u00a0method lists every column in a DataFrame along with its data type, which is the fastest way to confirm your data loaded the way you expected before you start querying it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1761\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/7-7.png\" alt=\"readvalue,printschema\" width=\"850\" height=\"146\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/7-7.png 625w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/7-7-300x51.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Showing Data<\/h3>\n<p>The <strong><b>show<\/b><\/strong>\u00a0method displays the rows of a DataFrame directly in the console, useful as a quick sanity check at almost every step of building a query.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1762\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/8-7.png\" alt=\"readvalue show\" width=\"850\" height=\"29\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/8-7.png 591w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/8-7-300x10.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1763\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/9-6.png\" alt=\"course name\" width=\"850\" height=\"269\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/9-6.png 609w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/9-6-300x95.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Reading Files Using the Spark Session<\/h3>\n<p>You can read data from an external file by giving Spark the path to it through the active session, most commonly using a method such as <strong><b>spark.read.json<\/b><\/strong>\u00a0for a JSON source.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1764\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/10-6.png\" alt=\"spark.read.json\" width=\"850\" height=\"110\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/10-6.png 618w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/10-6-300x39.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Displaying the Data<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1765\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/11-6.png\" alt=\"scala df show\" width=\"850\" height=\"359\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/11-6.png 580w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/11-6-300x127.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Selecting a Single Column<\/h3>\n<p>The <strong><b>select<\/b><\/strong>\u00a0method lets you pull out just the column or columns you need, rather than showing the entire table.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1766\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/12-4.png\" alt=\"df select name show\" width=\"850\" height=\"333\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/12-4.png 544w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/12-4-300x117.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Selecting More Than One Column<\/h3>\n<p>Passing more than one column name into select displays them side by side, without pulling in every other column in the DataFrame.<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1767\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/13-4.png\" alt=\"scala df select name age show\" width=\"850\" height=\"288\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/13-4.png 628w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/13-4-300x102.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/strong><\/p>\n<p><strong>\u00a0<\/strong><\/p>\n<h3>Incrementing a Column&#8217;s Value<\/h3>\n<p>You can perform simple arithmetic on a column as part of a select statement, such as adding a fixed number to every value in a numeric column, without changing the underlying data.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1768\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/14-3.png\" alt=\"spark select age name \" width=\"850\" height=\"311\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/14-3.png 593w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/14-3-300x110.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Using an Alias<\/h3>\n<p>The <strong><b>alias<\/b><\/strong>\u00a0method renames a column in the output of a query, which is useful once you start combining or transforming columns and want the result to have a clearer name than the default.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1769\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/15-3.png\" alt=\"scala df show name alias name age alias age alias ageplusten\" width=\"850\" height=\"302\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/15-3.png 621w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/15-3-300x107.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Filtering Rows<\/h3>\n<p>The <strong><b>filter<\/b><\/strong>\u00a0method narrows a DataFrame down to only the rows that match a condition, such as an age above a certain value. DataFrames are transformational and immutable, so filtering returns a new DataFrame rather than changing the original one.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1770\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/16-3.png\" alt=\"scala df filter age show\" width=\"850\" height=\"271\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/16-3.png 543w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/16-3-300x96.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>Data frames are also transformational in nature and they are immutable<\/p>\n<h2>Grouping Data<\/h2>\n<p>The <strong><b>groupBy<\/b><\/strong>\u00a0method groups rows that share a value in one column, such as course, so you can then run an aggregate function across each group.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1771\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/17-3.png\" alt=\" scala df groupby course\" width=\"850\" height=\"104\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/17-3.png 582w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/17-3-300x37.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Count<\/h3>\n<p>Counts how many rows fall into each group.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1772\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/18-2.png\" alt=\"df groupby course count\" width=\"850\" height=\"87\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/18-2.png 619w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/18-2-300x31.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1773\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/19-2.png\" alt=\"scala res22 show\" width=\"850\" height=\"338\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/19-2.png 614w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/19-2-300x119.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Max<\/h3>\n<p>Returns the highest value in a column for each group.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1774\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/20-2.png\" alt=\"apache spark sql data frame\" width=\"850\" height=\"414\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/20-2.png 622w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/20-2-300x146.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Min<\/h3>\n<p>Returns the lowest value in a column for each group.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1775\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/21-2.png\" alt=\"course min age\" width=\"850\" height=\"645\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/21-2.png 625w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/21-2-300x228.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Average<\/h3>\n<p>Returns the mean value in a column for each group.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1776\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/22-1.png\" alt=\"course avg age\" width=\"850\" height=\"317\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/22-1.png 624w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/22-1-300x112.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2>Writing Data to a File<\/h2>\n<p>The <strong><b>write<\/b><\/strong>\u00a0method saves a DataFrame&#8217;s contents to a location you specify, in a format such as JSON, so the results of your work can be picked up again later or handed off to another process.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1777\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/23-1.png\" alt=\"de write json\" width=\"850\" height=\"58\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/23-1.png 613w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/23-1-300x21.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1778\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/24-1.png\" alt=\"course age name\" width=\"850\" height=\"288\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/24-1.png 622w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/24-1-300x102.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2>Running SQL Queries With a Temporary View<\/h2>\n<p>To run plain SQL syntax against a DataFrame, you first register it as a <strong><b>temporary view<\/b><\/strong>, which gives it a name Spark SQL can reference in a query, the same way you would reference a table name in a database.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1779\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/25-1.png\" alt=\"val student data json spark read json\" width=\"850\" height=\"179\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/25-1.png 622w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/25-1-300x63.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1780\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/26-1.png\" alt=\"spark sql\" width=\"850\" height=\"452\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/26-1.png 623w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/26-1-300x159.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>Once the view exists, you can run standard SQL statements against it through <strong><b>spark.sql<\/b><\/strong>, and the result comes back as a DataFrame you can display or transform further.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1781\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/27-1.png\" alt=\"val new data spark sql\" width=\"850\" height=\"245\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/27-1.png 624w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/27-1-300x87.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2>Working With Datasets<\/h2>\n<p>A Dataset is created from a Scala sequence, or <strong><b>Seq<\/b><\/strong>, of objects, typically instances of a case class that describes the shape of each row. This gives every row a defined structure and type from the moment the Dataset is created, unlike a DataFrame built from an untyped source.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1782\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/28-1.png\" alt=\"class player\" width=\"850\" height=\"271\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/28-1.png 620w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/28-1-300x96.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1783\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/29-1.png\" alt=\"caseipl tods\" width=\"850\" height=\"83\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/29-1.png 628w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/29-1-300x29.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1784\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/30-1.png\" alt=\"scala res40 show\" width=\"850\" height=\"269\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/30-1.png 622w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/30-1-300x95.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1785\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/31-1.png\" alt=\" SQL Commands\" width=\"850\" height=\"38\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/31-1.png 621w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/31-1-300x14.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Just like a DataFrame, a Dataset can be queried with plain SQL once it is registered as a view.<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1786\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/32-1.png\" alt=\"spark sql from IPL\" width=\"850\" height=\"271\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/32-1.png 621w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/32-1-300x96.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2>User Defined Functions<\/h2>\n<p>A <strong><b>user defined function<\/b><\/strong>, or UDF, is a function you write yourself and register with Spark so it can be called directly inside a SQL query, the same way you would call a built in function such as upper or round. This is a common way to expose custom logic to people writing SQL queries without requiring them to write Scala code themselves.<\/p>\n<h3>Test Case One: Converting Celsius Into Fahrenheit<\/h3>\n<p>A simple UDF can take a temperature value in Celsius and return the Fahrenheit equivalent, ready to be applied to an entire column of readings.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1787\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/33-1.png\" alt=\"val temperature \" width=\"850\" height=\"109\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/33-1.png 623w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/33-1-300x39.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1788\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/34-1.png\" alt=\"temperature show\" width=\"850\" height=\"286\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/34-1.png 573w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/34-1-300x101.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3><\/h3>\n<h3>Registering the UDF<\/h3>\n<p>Once the function is written, it is registered with Spark using <strong><b>spark.udf.register<\/b><\/strong>, giving it a name that can be called from inside a SQL query exactly like a built in function.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1789\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/35-1.png\" alt=\"spark udf register\" width=\"850\" height=\"141\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/35-1.png 625w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/35-1-300x50.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1790\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/36-1.png\" alt=\"temperture creater or replace\" width=\"850\" height=\"60\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/36-1.png 625w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/36-1-300x21.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1791\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/37-1.png\" alt=\"spark sql\" width=\"850\" height=\"115\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/37-1.png 622w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/37-1-300x41.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1792\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/38-1.png\" alt=\"res65 show\" width=\"850\" height=\"263\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/38-1.png 620w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/38-1-300x93.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h3>Test Case Two: Lower Case to Upper Case<\/h3>\n<p>A second UDF can take a text column and return it fully capitalized, a common cleanup step when preparing text data for consistent reporting.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1793\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/39-1.png\" alt=\"val dataset\" width=\"850\" height=\"59\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/39-1.png 624w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/39-1-300x21.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1794\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/40-1.png\" alt=\"val upper\" width=\"850\" height=\"70\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/40-1.png 570w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/40-1-300x25.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/> <img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1795\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/41.png\" alt=\"import org apache spark sql\" width=\"850\" height=\"56\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/41.png 627w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/41-300x20.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1796\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/42.png\" alt=\"val upper udf\" width=\"850\" height=\"75\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/42.png 624w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/42-300x26.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-1797\" src=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/43.png\" alt=\"data set with columm\" width=\"850\" height=\"181\" srcset=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/43.png 624w, https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/43-300x64.png 300w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<h2>Common Mistakes to Avoid<\/h2>\n<ul>\n<li>Treating DataFrame and Dataset as interchangeable in Scala. A DataFrame is untyped and will not catch a column name typo until the code runs. If compile time safety matters for your project, reach for a Dataset with a defined case class instead.<\/li>\n<li>Forgetting that DataFrames are immutable. Every transformation, filter, select, or otherwise, returns a new DataFrame rather than changing the original. If a chain of transformations does not seem to be taking effect, check whether you are reassigning the result to a variable.<\/li>\n<li>Registering a temporary view and expecting it to persist across sessions. A plain temporary view only lives for the current Spark session, so it needs to be recreated each time you restart your session.<\/li>\n<li>Writing a UDF for logic that already has a built in Spark SQL function. Built in functions are generally better optimized than a custom UDF doing the same job, so it is worth checking the built in function library before writing your own.<\/li>\n<\/ul>\n<p>That covers the core Apache Spark SQL commands, from setting up a context through DataFrames, Datasets, grouping, writing data, and user defined functions. To go further, explore <a href=\"https:\/\/prwatech.in\/apache-spark-training-institute-in-bangalore\/\"><strong><b>Prwatech&#8217;s Apache Spark training<\/b><\/strong><\/a>\u00a0program, which includes placement assistance.<\/p>\n<h2>Watch It in Action<\/h2>\n<p>The four videos below, embedded on the original page, walk through these commands step by step.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apache Spark SQL Commands This is a working reference to the core Apache Spark SQL\u00a0commands, covering how to set up a Spark context, build and query DataFrames and Datasets, group and write data, and register your own functions for use inside SQL queries. What is Spark SQL, and Why It Matters Spark SQL is the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,1691],"tags":[295,882,886,881,887,884,885,883,880],"class_list":["post-1754","post","type-post","status-publish","format-standard","hentry","category-apache-spark","category-apache-spark-sql","tag-apache-spark-sql-commands","tag-queries-in-scala","tag-scala-functions","tag-scala-queries","tag-scala-query","tag-scala-sql-query","tag-scala-table-creation","tag-spark-scala-dataset","tag-spark-sql-commands"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Apache Spark SQL Commands: A Practical Guide<\/title>\n<meta name=\"description\" content=\"Learn essential Apache Spark SQL commands for DataFrames, Datasets, and UDFs, with clear explanations for each command and when to use it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Spark SQL Commands: A Practical Guide\" \/>\n<meta property=\"og:description\" content=\"Learn essential Apache Spark SQL commands for DataFrames, Datasets, and UDFs, with clear explanations for each command and when to use it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Prwatech\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prwatech.in\/\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-12T05:16:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-13T06:46:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7.png\" \/>\n\t<meta property=\"og:image:width\" content=\"623\" \/>\n\t<meta property=\"og:image:height\" content=\"61\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Prwatech\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:site\" content=\"@Eduprwatech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prwatech\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"15 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/\",\"url\":\"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/\",\"name\":\"Apache Spark SQL Commands: A Practical Guide\",\"isPartOf\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7.png\",\"datePublished\":\"2026-09-12T05:16:46+00:00\",\"dateModified\":\"2026-09-13T06:46:41+00:00\",\"author\":{\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\"},\"description\":\"Learn essential Apache Spark SQL commands for DataFrames, Datasets, and UDFs, with clear explanations for each command and when to use it.\",\"breadcrumb\":{\"@id\":\"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/#primaryimage\",\"url\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7.png\",\"contentUrl\":\"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7.png\",\"width\":623,\"height\":61},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/prwatech.in\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Apache Spark SQL Commands\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/prwatech.in\/blog\/#website\",\"url\":\"https:\/\/prwatech.in\/blog\/\",\"name\":\"Prwatech\",\"description\":\"Share Ideas, Start Something Good.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/prwatech.in\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3\",\"name\":\"Prwatech\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g\",\"caption\":\"Prwatech\"},\"url\":\"https:\/\/prwatech.in\/blog\/author\/prwatech123\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Apache Spark SQL Commands: A Practical Guide","description":"Learn essential Apache Spark SQL commands for DataFrames, Datasets, and UDFs, with clear explanations for each command and when to use it.","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:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/","og_locale":"en_US","og_type":"article","og_title":"Apache Spark SQL Commands: A Practical Guide","og_description":"Learn essential Apache Spark SQL commands for DataFrames, Datasets, and UDFs, with clear explanations for each command and when to use it.","og_url":"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/","og_site_name":"Prwatech","article_publisher":"https:\/\/www.facebook.com\/prwatech.in\/","article_published_time":"2026-09-12T05:16:46+00:00","article_modified_time":"2026-09-13T06:46:41+00:00","og_image":[{"width":623,"height":61,"url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7.png","type":"image\/png"}],"author":"Prwatech","twitter_card":"summary_large_image","twitter_creator":"@Eduprwatech","twitter_site":"@Eduprwatech","twitter_misc":{"Written by":"Prwatech","Est. reading time":"15 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/","url":"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/","name":"Apache Spark SQL Commands: A Practical Guide","isPartOf":{"@id":"https:\/\/prwatech.in\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/#primaryimage"},"image":{"@id":"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7.png","datePublished":"2026-09-12T05:16:46+00:00","dateModified":"2026-09-13T06:46:41+00:00","author":{"@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3"},"description":"Learn essential Apache Spark SQL commands for DataFrames, Datasets, and UDFs, with clear explanations for each command and when to use it.","breadcrumb":{"@id":"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/#primaryimage","url":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7.png","contentUrl":"https:\/\/prwatech.in\/blog\/wp-content\/uploads\/2019\/05\/1-7.png","width":623,"height":61},{"@type":"BreadcrumbList","@id":"https:\/\/prwatech.in\/blog\/apache-spark\/apache-spark-sql\/apache-spark-sql-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/prwatech.in\/blog\/"},{"@type":"ListItem","position":2,"name":"Apache Spark SQL Commands"}]},{"@type":"WebSite","@id":"https:\/\/prwatech.in\/blog\/#website","url":"https:\/\/prwatech.in\/blog\/","name":"Prwatech","description":"Share Ideas, Start Something Good.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/prwatech.in\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/db90baff7744090b2288bbc98fea87f3","name":"Prwatech","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/prwatech.in\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c00bafc1b04045f31eda917de39891456c44fa47c092b9bb6be0f860a3a30a2f?s=96&d=mm&r=g","caption":"Prwatech"},"url":"https:\/\/prwatech.in\/blog\/author\/prwatech123\/"}]}},"_links":{"self":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/1754","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/comments?post=1754"}],"version-history":[{"count":17,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/1754\/revisions"}],"predecessor-version":[{"id":11741,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/posts\/1754\/revisions\/11741"}],"wp:attachment":[{"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/media?parent=1754"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/categories?post=1754"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prwatech.in\/blog\/wp-json\/wp\/v2\/tags?post=1754"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}