<?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 How to connect Spark 2.2.0 with Phoenix 4.7 in HDP 2.6.3 ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194134#M76019</link>
    <description />
    <pubDate>Sat, 17 Mar 2018 09:56:55 GMT</pubDate>
    <dc:creator>ranjan_raut18</dc:creator>
    <dc:date>2018-03-17T09:56:55Z</dc:date>
    <item>
      <title>How to connect Spark 2.2.0 with Phoenix 4.7 in HDP 2.6.3 ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194134#M76019</link>
      <description />
      <pubDate>Sat, 17 Mar 2018 09:56:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194134#M76019</guid>
      <dc:creator>ranjan_raut18</dc:creator>
      <dc:date>2018-03-17T09:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect Spark 2.2.0 with Phoenix 4.7 in HDP 2.6.3 ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194135#M76020</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/71152/ranjanraut18.html" nodeid="71152"&gt;@Ranjan Raut&lt;/A&gt;&lt;P&gt;Below are the steps to connect Spark 2.2 with phoenix in HDP 2.6.3. &lt;/P&gt;&lt;P&gt;1) Create a symlink of hbase-site.xml in spark2 conf&lt;/P&gt;&lt;PRE&gt;ln -s /etc/hbase/conf/hbase-site.xml /etc/spark2/conf/hbase-site.xml&lt;/PRE&gt;&lt;P&gt;2) Launch spark-shell using phoenix spark jars in extra classpath.&lt;/P&gt;&lt;PRE&gt;spark-shell --conf "spark.executor.extraClassPath=/usr/hdp/current/phoenix-client/phoenix-4.7.0.2.6.3.0-235-spark2.jar:/usr/hdp/current/phoenix-client/phoenix-client.jar" --conf "spark.driver.extraClassPath=/usr/hdp/current/phoenix-client/phoenix-4.7.0.2.6.3.0-235-spark2.jar:/usr/hdp/current/phoenix-client/phoenix-client.jar"&lt;/PRE&gt;&lt;P&gt;3) Create a phoenix connection and query the tables.&lt;/P&gt;&lt;PRE&gt;scala&amp;gt; import org.apache.spark.sql.SQLContext
import org.apache.spark.sql.SQLContext

scala&amp;gt; val sqlContext = new SQLContext(sc)
sqlContext: org.apache.spark.sql.SQLContext = org.apache.spark.sql.SQLContext@495e8a3

scala&amp;gt; val df = sqlContext.load("org.apache.phoenix.spark",Map("table" -&amp;gt; "TABLE1", "zkUrl" -&amp;gt; "localhost:2181"))
df: org.apache.spark.sql.DataFrame = [ID: string, COL1: string ... 1 more field]

scala&amp;gt; df.show()
+-----+----------+----+
|   ID|      COL1|COL2|
+-----+----------+----+
|test1|test_row_1|  10|
|test2|test_row_2|  20|
+-----+----------+----+
&lt;/PRE&gt;</description>
      <pubDate>Sat, 17 Mar 2018 12:54:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194135#M76020</guid>
      <dc:creator>sandyy006</dc:creator>
      <dc:date>2018-03-17T12:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect Spark 2.2.0 with Phoenix 4.7 in HDP 2.6.3 ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194136#M76021</link>
      <description>&lt;P&gt;Thanks alot &lt;A rel="user" href="https://community.cloudera.com/users/10159/snemuri.html" nodeid="10159"&gt;@Sandeep Nemuri&lt;/A&gt;. It worked (y)&lt;/P&gt;</description>
      <pubDate>Sat, 17 Mar 2018 14:00:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194136#M76021</guid>
      <dc:creator>ranjan_raut18</dc:creator>
      <dc:date>2018-03-17T14:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect Spark 2.2.0 with Phoenix 4.7 in HDP 2.6.3 ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194137#M76022</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/71152/ranjanraut18.html" nodeid="71152"&gt;@Ranjan Raut&lt;/A&gt; Glad that it helped you, Would you mind accepting this answer so that this thread will be marked as answered. &lt;/P&gt;</description>
      <pubDate>Sat, 17 Mar 2018 14:29:20 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194137#M76022</guid>
      <dc:creator>sandyy006</dc:creator>
      <dc:date>2018-03-17T14:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect Spark 2.2.0 with Phoenix 4.7 in HDP 2.6.3 ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194138#M76023</link>
      <description>&lt;P&gt;Note that phoenix-spark2.jar MUST precede phoenix-client.jar in extraClassPath, otherwise connection will fail with:&lt;/P&gt;&lt;P&gt;java.lang.NoClassDefFoundError: org/apache/spark/sql/DataFrame&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2018 02:48:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194138#M76023</guid>
      <dc:creator>MilesYao</dc:creator>
      <dc:date>2018-03-21T02:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect Spark 2.2.0 with Phoenix 4.7 in HDP 2.6.3 ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194139#M76024</link>
      <description>&lt;P&gt;How can I save this "df" to other table of Phoenix ?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 00:48:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194139#M76024</guid>
      <dc:creator>ranjan_raut18</dc:creator>
      <dc:date>2018-03-28T00:48:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect Spark 2.2.0 with Phoenix 4.7 in HDP 2.6.3 ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194140#M76025</link>
      <description>&lt;P&gt;I found answer by myself ...&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;use &lt;EM&gt;&lt;STRONG&gt;df.saveToPhoenix(Map("table" -&amp;gt; "&lt;/STRONG&gt;&lt;/EM&gt;&lt;B&gt;&lt;EM&gt;OUTPUT_TABLE&lt;/EM&gt;&lt;/B&gt;&lt;I&gt;&lt;STRONG&gt;", "zkUrl" -&amp;gt; hbaseConnectionString))&lt;/STRONG&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 May 2018 21:26:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194140#M76025</guid>
      <dc:creator>ranjan_raut18</dc:creator>
      <dc:date>2018-05-31T21:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to connect Spark 2.2.0 with Phoenix 4.7 in HDP 2.6.3 ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194141#M76026</link>
      <description>&lt;P&gt;any idea for this issue: &lt;A href="https://community.hortonworks.com/questions/202521/spark-submit-nosuchmethoderror-savetophoenix.html" target="_blank"&gt;https://community.hortonworks.com/questions/202521/spark-submit-nosuchmethoderror-savetophoenix.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jul 2018 18:28:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-connect-Spark-2-2-0-with-Phoenix-4-7-in-HDP-2-6-3/m-p/194141#M76026</guid>
      <dc:creator>xpelive</dc:creator>
      <dc:date>2018-07-16T18:28:06Z</dc:date>
    </item>
  </channel>
</rss>

