<?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 Re: Is their any way to  configure new datbase for spark-sql in hdp 2.6 in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Is-their-any-way-to-configure-new-datbase-for-spark-sql-in/m-p/238295#M200106</link>
    <description>&lt;P&gt;&lt;A rel="noopener noreferrer noopener noreferrer" href="http://@Vasanth%20Reddy" target="_blank"&gt;&lt;EM&gt;@Vasanth Reddy&lt;/EM&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Spark SQL data source can read data from other databases using JDBC.JDBC connection properties such as user and password are normally provided as connection properties for logging into the data sources.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;In the example below I am using MySQL, so will need to have the Postgres drivers in place&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Sample Program&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;EM&gt;import org.apache.spark.sql.SQLContext
val sqlcontext = new org.apache.spark.sql.SQLContext(sc)
val dataframe_mysql = sqlcontext.read.format("jdbc").option("url", "jdbc:mysql://mbarara.com:3306/test").option("driver", "com.mysql.jdbc.Driver").option("dbtable", "emp").option("user", "root").option("password", "welcome1").load()
dataframe_mysql.show()&lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Hope that helps &lt;/EM&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Apr 2019 22:42:30 GMT</pubDate>
    <dc:creator>Shelton</dc:creator>
    <dc:date>2019-04-12T22:42:30Z</dc:date>
    <item>
      <title>Is their any way to  configure new datbase for spark-sql in hdp 2.6</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Is-their-any-way-to-configure-new-datbase-for-spark-sql-in/m-p/238294#M200105</link>
      <description>&lt;P&gt;Will you please please help me to configure new database.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;By default the spark-sql is connecting to the hive, so i want to configure new database like postgreSQL instead of hive&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;it will be very help full to rectify for me&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 21:09:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Is-their-any-way-to-configure-new-datbase-for-spark-sql-in/m-p/238294#M200105</guid>
      <dc:creator>naralavasanth</dc:creator>
      <dc:date>2019-04-12T21:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is their any way to  configure new datbase for spark-sql in hdp 2.6</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Is-their-any-way-to-configure-new-datbase-for-spark-sql-in/m-p/238295#M200106</link>
      <description>&lt;P&gt;&lt;A rel="noopener noreferrer noopener noreferrer" href="http://@Vasanth%20Reddy" target="_blank"&gt;&lt;EM&gt;@Vasanth Reddy&lt;/EM&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Spark SQL data source can read data from other databases using JDBC.JDBC connection properties such as user and password are normally provided as connection properties for logging into the data sources.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;In the example below I am using MySQL, so will need to have the Postgres drivers in place&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Sample Program&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;PRE&gt;&lt;EM&gt;import org.apache.spark.sql.SQLContext
val sqlcontext = new org.apache.spark.sql.SQLContext(sc)
val dataframe_mysql = sqlcontext.read.format("jdbc").option("url", "jdbc:mysql://mbarara.com:3306/test").option("driver", "com.mysql.jdbc.Driver").option("dbtable", "emp").option("user", "root").option("password", "welcome1").load()
dataframe_mysql.show()&lt;/EM&gt;&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Hope that helps &lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Apr 2019 22:42:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Is-their-any-way-to-configure-new-datbase-for-spark-sql-in/m-p/238295#M200106</guid>
      <dc:creator>Shelton</dc:creator>
      <dc:date>2019-04-12T22:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is their any way to  configure new datbase for spark-sql in hdp 2.6</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Is-their-any-way-to-configure-new-datbase-for-spark-sql-in/m-p/238296#M200107</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/1271/sheltong.html" nodeid="1271"&gt;@Geoffrey Shelton Okot&lt;/A&gt; Thanks a lot helping in this&lt;/P&gt;</description>
      <pubDate>Tue, 30 Apr 2019 12:47:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Is-their-any-way-to-configure-new-datbase-for-spark-sql-in/m-p/238296#M200107</guid>
      <dc:creator>naralavasanth</dc:creator>
      <dc:date>2019-04-30T12:47:45Z</dc:date>
    </item>
  </channel>
</rss>

