

{"id":758,"date":"2016-08-02T10:22:26","date_gmt":"2016-08-02T10:22:26","guid":{"rendered":"http:\/\/data-flair.training\/blogs\/?p=758"},"modified":"2018-11-19T16:04:57","modified_gmt":"2018-11-19T10:34:57","slug":"apache-spark-sql","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/","title":{"rendered":"Apache Spark SQL Tutorial &#8211; Quick Introduction Guide"},"content":{"rendered":"<h2>1. Objective &#8211; Spark SQL<\/h2>\n<p>In this Apache Spark SQL tutorial, we will understand various components and <a href=\"http:\/\/data-flair.training\/blogs\/important-apache-spark-terminologies-and-concepts-you-must-know\/\">terminologies of Spark<\/a> SQL like what is DataSet and DataFrame, what is <strong>SqlContext<\/strong> and <strong>HiveContext<\/strong> and What are the features of Spark SQL?<\/p>\n<p>After understanding\u00a0<a href=\"http:\/\/data-flair.training\/blogs\/introduction-spark-tutorial-quickstart\/\" target=\"_blank\" rel=\"noopener noreferrer\">What is Apache Spark<\/a>, in this tutorial we will discuss about Apache Spark SQL. Spark SQL is Spark module for structured data processing. It runs on top of Spark Core.\u00a0It offers much tighter integration between relational and procedural processing, through declarative <strong>DataFrame<\/strong> and <strong>Datasets API<\/strong>. These are the ways which enable users to run SQL queries over Spark.<\/p>\n<p>So, let&#8217;s start Spark SQL Tutorial.<\/p>\n<div id=\"attachment_42775\" style=\"width: 1210px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-42775\" class=\"size-full wp-image-42775\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1.jpg\" alt=\"Apache Spark SQL Tutorial - Quick Introduction Guide\" width=\"1200\" height=\"628\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1.jpg 1200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1-1024x536.jpg 1024w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1-520x272.jpg 520w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><p id=\"caption-attachment-42775\" class=\"wp-caption-text\">Apache Spark SQL Tutorial &#8211; Quick Introduction Guide<\/p><\/div>\n<h2>2. What is Apache Spark SQL?<\/h2>\n<p class=\"western\"><strong>Apache Spark SQL<\/strong> integrates relational processing with Sparks functional programming. It is Spark module for structured data processing. Spark SQL blurs the line between <strong><a href=\"http:\/\/data-flair.training\/blogs\/rdd-apache-spark\/\">RDD<\/a><\/strong> and relational table. It also offers much tighter integration between relational and procedural processing, through declarative DataFrame APIs which integrates with Spark code. It thus provides higher optimization. <strong>DataFrame API<\/strong> and <strong>Datasets API<\/strong> are the ways to interact with Spark SQL. As a result, with Spark SQL, Apache Spark is accessible to more users and improves optimization for current ones.<\/p>\n<p class=\"western\">Spark SQL runs on top of the<strong> Spark Core<\/strong>. It allows developers to import relational data from <strong><a href=\"http:\/\/data-flair.training\/blogs\/hive-tutorial-an-introductory-guide-for-beginners\/\">Hive<\/a><\/strong> tables and parquet files, run SQL queries over imported data and existing RDDs and easily write RDDs out to Hive tables or Parquet files. As Spark SQL provides DataFrame APIs which performs the relational operation on both external data sources and Sparks built-in distributed collections. Spark SQL introduces extensible optimizer called<strong> Catalyst<\/strong> as it helps in supporting a wide range of data sources and algorithms in <strong><a href=\"http:\/\/data-flair.training\/blogs\/history-big-data\/\">Bigdata<\/a><\/strong>.<\/p>\n<h2 class=\"western\">3. Apache Spark SQL Interfaces<\/h2>\n<p>Let&#8217;s discuss the interfaces of Apache Spark SQL in detail &#8211;<\/p>\n<h3 class=\"western\">i. DataFrame<\/h3>\n<p class=\"western\">Spark<a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-lazy-evaluation\/\"> DataFrames evaluates lazily<\/a> like <strong><a href=\"http:\/\/data-flair.training\/blogs\/rdd-transformations-actions-apis-apache-spark\/\">RDD Transformations<\/a><\/strong> in Apache Spark. A DataFrame is equivalent to the relational table in Spark SQL. A DataFrame stores the data into tables. DataFrame is similar\/identical to a table in a relational database but with richer optimization. It is a data abstraction and <strong>domain-specific language (DSL)<\/strong> applicable on the structure and semi-structured data. It is a distributed collection of data in the form of named column and row. For accessing data frames either <strong>SQL Context<\/strong> or <strong>Hive Context<\/strong> is needed. Learn about <a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-sql-dataframe-tutorial\/\">Spark SQL DataFrame in Detail<\/a>.<\/p>\n<h3 class=\"western\">ii. SQLContext<\/h3>\n<p class=\"western\">It&#8217;s the entry point for working with\u00a0structured data (rows and columns) in Apache Spark. It Allows the creation of DataFrame objects as well as the execution of SQL queries.<\/p>\n<h3 class=\"western\">iii. Hive Context<\/h3>\n<p class=\"western\">Working with Hive tables, a descendant of SQLContext. Hive Context is more battle-tested and provides a richer functionality than SQLContext.<\/p>\n<h3 class=\"western\">iv. DataSets<\/h3>\n<p class=\"western\">A <strong>Spark DataSet<\/strong> provides the <a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-rdd-features\/\">benefits of RDDs<\/a>. For example, strongly-typed, immutable collection of objects that map to the relational schema already present (i.e. you can use a field of a row by name naturally <em>row.columnName<\/em>). Datasets extend the benefit of compile-time type safety (It can analyze the applications for errors before they run). It also allows direct operations over user-defined classes. Learn about<a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-dataset-tutorial\/\"> Apache Spark DataSet in detail<\/a>.<\/p>\n<h3 class=\"western\">v. JDBC Datasource<\/h3>\n<p class=\"western\">In Apache Spark, JDBC data source can read data from relational databases using <strong>JDBC API<\/strong>. It has preference over the <em>RDD<\/em> because the data source returns the results as a DataFrame, can be handled in Spark SQL or joined beside other data sources.<\/p>\n<h3 class=\"western\">vi. Catalyst Optimizer<\/h3>\n<p class=\"western\">It is a functional programming construct in <strong><a href=\"http:\/\/data-flair.training\/blogs\/why-you-should-learn-scala-introductory-tutorial\/\">Scala<\/a><\/strong>. It is the newest and most technical component of Spark SQL. A<strong> catalyst<\/strong> is a query plan optimizer. It provides a general framework for transforming <em>trees<\/em>, which performs analysis\/evaluation, optimization, planning, and runtime code spawning. Catalyst supports <strong>cost based optimization<\/strong> and <strong>rule-based optimization<\/strong>. It makes queries run much faster than their RDD counterparts. A catalyst is a rule-based modular library. Each rule in framework focuses on the distinct optimization. Learn <a href=\"http:\/\/data-flair.training\/blogs\/spark-sql-optimization-catalyst-optimizer\/\">Spark SQL Catalyst Optimizer in detail.<\/a><\/p>\n<h2 class=\"western\">4. Features of Apache Spark SQL<\/h2>\n<p>There are several features of Spark SQL which enhance which makes it a key component of Apache Spark framework.<\/p>\n<div id=\"attachment_3183\" style=\"width: 1290px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/07\/features-of-apache-spark-sql.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-3183\" class=\"wp-image-3183 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/07\/features-of-apache-spark-sql.jpg\" alt=\"Features of Spark SQL\" width=\"1280\" height=\"794\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/07\/features-of-apache-spark-sql.jpg 1280w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/07\/features-of-apache-spark-sql-150x93.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/07\/features-of-apache-spark-sql-300x186.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/07\/features-of-apache-spark-sql-768x476.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2017\/07\/features-of-apache-spark-sql-1024x635.jpg 1024w\" sizes=\"auto, (max-width: 1280px) 100vw, 1280px\" \/><\/a><p id=\"caption-attachment-3183\" class=\"wp-caption-text\">Features of Spark SQL<\/p><\/div>\n<h3 class=\"western\">i. Integrated<\/h3>\n<p class=\"western\">Logically mix SQL queries with Spark programs. Apache Spark SQL allows query structured data inside Spark programs, using SQL or a DataFrame API in <em>Java, Scala, Python, and <strong><a href=\"http:\/\/data-flair.training\/blogs\/r-programming-tutorial\/\">R<\/a><\/strong>.<\/em><\/p>\n<h3 class=\"western\">ii. Uniform Data Access<\/h3>\n<p class=\"western\">In Spark DataFrames and SQL supports a common way to access a variety of data sources, like <em>Hive, Avro, Parquet, ORC, JSON, and JDBC.<\/em> Hence Spark SQL can join data across these sources.<\/p>\n<h3 class=\"western\">iii. Hive Compatibility<\/h3>\n<p class=\"western\">Runs unmodified Hive queries on current data. Spark SQL rewrites the Hive frontend and meta store, allowing full compatibility with current Hive data, queries, and UDFs.<\/p>\n<h3 class=\"western\">v. Standard Connectivity<\/h3>\n<p class=\"western\">Connect through JDBC or ODBC. A server that supports industry norms JDBC and ODBC connectivity for business intelligence tools.<\/p>\n<h3 class=\"western\">v. Performance &amp; Scalability<\/h3>\n<p class=\"western\">Apache Spark SQL incorporates a cost-based optimizer, code generation, and columnar storage to make queries agile alongside computing thousands of nodes using the Spark engine, which provides full mid-query fault tolerance.<\/p>\n<h2 class=\"western\">5. Conclusion<\/h2>\n<p>Hence, Spark SQL allows Apache Spark to work with structured and unstructured data. The data can be from various sources. It enhances the performance of Spark applications. As a result, It provides an efficient platform to the Spark developers to work with various type of data.<br \/>\nIf in case you have any confusion about Apache Spark SQL, so leave a comment in a section below. We will be glad to solve them.<br \/>\n<strong>See Also-<\/strong><\/p>\n<ul>\n<li><a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-streaming-comprehensive-guide\/\">Apache Spark Streaming<\/a><\/li>\n<li><a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-hadoop-compatibility\/\">Apache<\/a> <a href=\"http:\/\/data-flair.training\/blogs\/apache-spark-hadoop-compatibility\/\">Spark compatibility with Hadoop<\/a><\/li>\n<\/ul>\n<p>Reference:<br \/>\n<a href=\"http:\/\/spark.apache.org\/\">http:\/\/spark.apache.org\/<\/a><span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:2354,&quot;href&quot;:&quot;http:\\\/\\\/spark.apache.org&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251009215151\\\/https:\\\/\\\/spark.apache.org\\\/&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-11 04:17:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-14 07:11:19&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-17 07:55:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-20 14:34:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-23 15:49:42&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-26 15:59:57&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2025-12-30 07:08:03&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-02 07:19:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-05 08:37:45&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-08 09:28:47&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-11 11:37:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-14 12:46:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-17 20:26:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-20 20:31:00&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-24 06:20:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-27 06:26:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-01-30 07:17:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-02 07:26:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-05 10:18:07&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-08 12:50:55&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-11 14:05:53&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-14 15:00:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-18 00:17:52&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-21 06:52:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-24 08:35:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-27 08:54:29&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-02 09:01:11&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-05 09:57:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-08 12:27:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-11 12:42:39&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-14 23:54:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-18 03:00:10&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-21 06:08:58&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-24 07:13:58&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-27 09:23:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-30 11:37:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-02 13:11:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-05 14:53:20&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-08 19:36:36&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-11 23:42:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-15 01:00:01&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-18 06:16:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-21 07:55:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-24 09:26:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-27 11:00:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-30 12:57:25&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-03 13:36:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-06 19:54:59&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-10 07:47:43&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-13 09:22:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-16 16:11:08&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-19 16:22:48&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-22 17:30:06&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-05-25 20:07:42&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-29 03:42:28&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-01 10:44:16&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-04 10:50:12&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-07 10:53:31&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-10 11:32:26&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-13 13:26:22&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-17 00:18:56&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-20 03:02:15&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-23 10:46:05&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-26 12:51:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-06-29 12:51:51&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-02 13:46:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-05 16:50:32&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-09 05:30:27&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-12 14:20:23&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-15 20:00:46&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-07-19 06:45:58&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-07-19 06:45:58&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Objective &#8211; Spark SQL In this Apache Spark SQL tutorial, we will understand various components and terminologies of Spark SQL like what is DataSet and DataFrame, what is SqlContext and HiveContext and What&#46;&#46;&#46;<\/p>\n","protected":false},"author":6,"featured_media":42775,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[896,949,951,13118,13119,13123,13139,13154],"class_list":["post-758","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spark","tag-apache-spark","tag-apache-spark-sql","tag-apache-spark-sql-tutorial","tag-spark-sql-features","tag-spark-sql-introduction","tag-spark-sql-tutorial","tag-spark-training","tag-spark-sql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Apache Spark SQL Tutorial - Quick Introduction Guide - DataFlair<\/title>\n<meta name=\"description\" content=\"Apache Spark SQL tutorial,what is Spark SQL, Spark DataFrame &amp; Dataset APIs, Spark SQL interfaces, features of Spark SQL, SQLContext &amp; HiveContext\" \/>\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\/apache-spark-sql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Apache Spark SQL Tutorial - Quick Introduction Guide - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Apache Spark SQL tutorial,what is Spark SQL, Spark DataFrame &amp; Dataset APIs, Spark SQL interfaces, features of Spark SQL, SQLContext &amp; HiveContext\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/\" \/>\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-08-02T10:22:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-11-19T10:34:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1.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":"Apache Spark SQL Tutorial - Quick Introduction Guide - DataFlair","description":"Apache Spark SQL tutorial,what is Spark SQL, Spark DataFrame & Dataset APIs, Spark SQL interfaces, features of Spark SQL, SQLContext & HiveContext","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\/apache-spark-sql\/","og_locale":"en_US","og_type":"article","og_title":"Apache Spark SQL Tutorial - Quick Introduction Guide - DataFlair","og_description":"Apache Spark SQL tutorial,what is Spark SQL, Spark DataFrame & Dataset APIs, Spark SQL interfaces, features of Spark SQL, SQLContext & HiveContext","og_url":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2016-08-02T10:22:26+00:00","article_modified_time":"2018-11-19T10:34:57+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1.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\/apache-spark-sql\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/2c58ecb4f73a39f0ef993f1ddfcd7b89"},"headline":"Apache Spark SQL Tutorial &#8211; Quick Introduction Guide","datePublished":"2016-08-02T10:22:26+00:00","dateModified":"2018-11-19T10:34:57+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/"},"wordCount":956,"commentCount":3,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1.jpg","keywords":["apache spark","apache spark sql","Apache Spark SQL tutorial","spark sql features","spark sql introduction","Spark SQL tutorial","spark training","spark-sql"],"articleSection":["Apache Spark Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/apache-spark-sql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/","url":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/","name":"Apache Spark SQL Tutorial - Quick Introduction Guide - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1.jpg","datePublished":"2016-08-02T10:22:26+00:00","dateModified":"2018-11-19T10:34:57+00:00","description":"Apache Spark SQL tutorial,what is Spark SQL, Spark DataFrame & Dataset APIs, Spark SQL interfaces, features of Spark SQL, SQLContext & HiveContext","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/apache-spark-sql\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/08\/apache-spark-sql-introduction-768x401-1.jpg","width":1200,"height":628,"caption":"Apache Spark SQL Tutorial - Quick Introduction Guide"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/apache-spark-sql\/#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":"Apache Spark SQL Tutorial &#8211; Quick Introduction Guide"}]},{"@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\/758","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=758"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/758\/revisions"}],"predecessor-version":[{"id":42778,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/758\/revisions\/42778"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/42775"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}