<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Pyspark - Spark SQL in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Pyspark-Spark-SQL/m-p/168749#M57702</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am converting long time taking SQL into hive-Spark SQL based solution, I have two options &lt;/P&gt;&lt;P&gt;1) create data frame for each of the hive table and replicate SQL and run on the Spark &lt;/P&gt;&lt;P&gt;     table1 = sqlContext.sql("select * from table1")&lt;/P&gt;&lt;P&gt;     table1.registerAsTempTabble("table1")&lt;/P&gt;&lt;P&gt;.... similarly for all the tables, and replicate the SQL and run on spark&lt;/P&gt;&lt;P&gt;pros: faster prototyping&lt;/P&gt;&lt;P&gt;2) use DataFrame Api using pyspark, like df.distinct().select().....&lt;/P&gt;&lt;P&gt;relatively slower developement time,&lt;/P&gt;&lt;P&gt;what are pros and cons of one verses other ? and how to choose?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Abhijeet Rajput&lt;/P&gt;</description>
    <pubDate>Wed, 22 Mar 2017 08:19:13 GMT</pubDate>
    <dc:creator>Freakabhi</dc:creator>
    <dc:date>2017-03-22T08:19:13Z</dc:date>
    <item>
      <title>Pyspark - Spark SQL</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Pyspark-Spark-SQL/m-p/168749#M57702</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I am converting long time taking SQL into hive-Spark SQL based solution, I have two options &lt;/P&gt;&lt;P&gt;1) create data frame for each of the hive table and replicate SQL and run on the Spark &lt;/P&gt;&lt;P&gt;     table1 = sqlContext.sql("select * from table1")&lt;/P&gt;&lt;P&gt;     table1.registerAsTempTabble("table1")&lt;/P&gt;&lt;P&gt;.... similarly for all the tables, and replicate the SQL and run on spark&lt;/P&gt;&lt;P&gt;pros: faster prototyping&lt;/P&gt;&lt;P&gt;2) use DataFrame Api using pyspark, like df.distinct().select().....&lt;/P&gt;&lt;P&gt;relatively slower developement time,&lt;/P&gt;&lt;P&gt;what are pros and cons of one verses other ? and how to choose?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Abhijeet Rajput&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 08:19:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Pyspark-Spark-SQL/m-p/168749#M57702</guid>
      <dc:creator>Freakabhi</dc:creator>
      <dc:date>2017-03-22T08:19:13Z</dc:date>
    </item>
    <item>
      <title>Re: Pyspark - Spark SQL</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Pyspark-Spark-SQL/m-p/168750#M57703</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/16265/abhidocstore.html" nodeid="16265"&gt;@Abhijeet Rajput&lt;/A&gt;, Found an article which compares performance of RDD/ Dataframe and SQL . It will help you make informed decision. &lt;/P&gt;&lt;P&gt;&lt;A href="https://community.hortonworks.com/articles/42027/rdd-vs-dataframe-vs-sparksql.html"&gt;https://community.hortonworks.com/articles/42027/rdd-vs-dataframe-vs-sparksql.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In summary, &lt;/P&gt;&lt;P&gt;You mainly need to analyze your use case ( like what type of queries will you be running , how big is data set etc). &lt;/P&gt;&lt;P&gt;Depending on your use case, you can choose to go with either SQL or Dataframe API. &lt;/P&gt;&lt;P&gt;For example: If your use case involves lot of groupby, orderby like queries, you should go with sparkSQL instead data frame api. ( because sparkSQL executes faster than data frame api for such use case)&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 01:58:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Pyspark-Spark-SQL/m-p/168750#M57703</guid>
      <dc:creator>yvora</dc:creator>
      <dc:date>2017-03-23T01:58:45Z</dc:date>
    </item>
  </channel>
</rss>

