<?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>topic Re: SQL on Hive error: Failed to create spark client in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/503732#M15625</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13754"&gt;@AndrewHowell&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This may be a long shot but there should be space between the function call and the "as" keyword. Try changing "min(amount)as min_date" to "min(amount) as min_date".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	select distinct * from connection to SAS_HIVE
	(
		SELECT year, month, min(amount) as min_date
			FROM H_TABLE
			WHERE  ( ( year = 2017 ) AND  ( month = 10 ) )
			group by year, month
	);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Like I said, it is a long shot but could fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Oct 2018 15:07:48 GMT</pubDate>
    <dc:creator>JBailey</dc:creator>
    <dc:date>2018-10-12T15:07:48Z</dc:date>
    <item>
      <title>SQL on Hive error: Failed to create spark client</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/503688#M15624</link>
      <description>&lt;P&gt;I know SAS, SQL, SASTRACE, etc very well, but I'm a newbie to Hive, trying to understand why extractions work, but summarisations generate errors. (Yes I appreciate Hive isn't actually an SQL database, just trying to figure why somethings work &amp;amp; some don't).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;ERROR: Prepare error: Error while compiling statement: FAILED: SemanticException Failed to get a spark session:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; org.apache.hadoop.hive.ql.metadata.HiveException: Failed to create spark client.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;SQL statement: SELECT year, month, min(amount)as min_date FROM H_TABLE WHERE ( ( year = 2017 ) AND ( month = 10 ) )&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;group by year, month&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code &amp;amp; logs below - any assistance appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options SET=SAS_HADOOP_JAR_PATH="/sas94/thirdparty/hadoop/lib";
options sastrace=',,,dsat' sastraceloc=saslog symbolgen mprint mlogic;

options fullstimer;

proc sql stimer;
	connect using SAS_HIVE; 
	select distinct * from connection to SAS_HIVE
	(
		SELECT year, month, amount
			FROM H_TABLE
			WHERE  ( ( year = 2017 ) AND  ( month = 10 ) )
	);

	select distinct * from connection to SAS_HIVE
	(
		SELECT year, month, min(amount)as min_date
			FROM H_TABLE
			WHERE  ( ( year = 2017 ) AND  ( month = 10 ) )
			group by year, month
	);

	disconnect from SAS_HIVE;
quit;


33         options fullstimer;
34         
35         proc sql stimer;
36         	connect using SAS_HIVE;

  241 1539345625 no_name 0 SQL (2) 
HADOOP_44: Executed: on connection 3 242 1539345625 no_name 0 SQL (2) 
USE `hive_sasfm` 243 1539345625 no_name 0 SQL (2) 
  244 1539345625 no_name 0 SQL (2) 
NOTE: SQL Statement used (Total process time):
      real time           0.41 seconds
      user cpu time       0.00 seconds
      system cpu time     0.00 seconds
      memory              1320.75k
      OS Memory           23788.00k
      
37         	select distinct * from connection to SAS_HIVE
38         	(
39         		SELECT year, month, amount
40         			FROM H_TABLE
41         			WHERE  ( ( year = 2017 ) AND  ( month = 10 ) )
42         	);

  245 1539345626 no_name 0 SQL (2) 
HADOOP_45: Prepared: on connection 3 246 1539345626 no_name 0 SQL (2) 
SELECT year, month, amount FROM H_TABLE WHERE ( ( year = 2017 ) AND ( month = 10 ) ) 247 1539345626 no_name 0 SQL (2) 
  248 1539345626 no_name 0 SQL (2) 
  249 1539345626 no_name 0 SQL (2) 
Summary Statistics for HADOOP are: 250 1539345626 no_name 0 SQL (2) 
Total SQL prepare seconds were:                     0.111738 251 1539345626 no_name 0 SQL (2) 
Total SQL describe seconds were:                    0.000496 252 1539345626 no_name 0 SQL (2) 
Total seconds used by the HADOOP ACCESS engine were     0.139514 253 1539345626 no_name 0 SQL (2) 
  254 1539345626 no_name 0 SQL (2) 

NOTE: SQL Statement used (Total process time):
      real time           0.14 seconds
      user cpu time       0.01 seconds
      system cpu time     0.00 seconds
      memory              5260.46k
      OS Memory           27820.00k
      Timestamp           12/10/2018 11:00:26 PM

44         	select distinct * from connection to SAS_HIVE
45         	(
46         		SELECT year, month, min(amount)as min_date
47         			FROM H_TABLE
48         			WHERE  ( ( year = 2017 ) AND  ( month = 10 ) )
49         			group by year, month
50         	);

  255 1539345626 no_name 0 SQL (2) 
HADOOP_46: Prepared: on connection 3 256 1539345626 no_name 0 SQL (2) 
SELECT year, month, min(amount)as min_date FROM H_TABLE WHERE ( ( year = 2017 ) AND ( month = 10 ) ) group by year, 
month 257 1539345626 no_name 0 SQL (2) 
  258 1539345626 no_name 0 SQL (2) 
  259 1539345629 no_name 0 SQL (2) 
Summary Statistics for HADOOP are: 260 1539345629 no_name 0 SQL (2) 
Total SQL prepare seconds were:                     3.649941 261 1539345629 no_name 0 SQL (2) 
Total seconds used by the HADOOP ACCESS engine were     3.650159 262 1539345629 no_name 0 SQL (2) 
  263 1539345629 no_name 0 SQL (2) 

ERROR: Prepare error: Error while compiling statement: FAILED: SemanticException Failed to get a spark session: 
       org.apache.hadoop.hive.ql.metadata.HiveException: Failed to create spark client.
SQL statement: SELECT year, month, min(amount)as min_date FROM H_TABLE WHERE ( ( year = 2017 ) AND ( month = 10 ) ) 
       group by year, month

NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.
NOTE: SQL Statement used (Total process time):
      
52         	disconnect from SAS_HIVE;

NOTE: Statement not executed due to NOEXEC option.
NOTE: SQL Statement used (Total process time):
      
53         quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Oct 2018 12:16:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/503688#M15624</guid>
      <dc:creator>AndrewHowell</dc:creator>
      <dc:date>2018-10-12T12:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL on Hive error: Failed to create spark client</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/503732#M15625</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13754"&gt;@AndrewHowell&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This may be a long shot but there should be space between the function call and the "as" keyword. Try changing "min(amount)as min_date" to "min(amount) as min_date".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;	select distinct * from connection to SAS_HIVE
	(
		SELECT year, month, min(amount) as min_date
			FROM H_TABLE
			WHERE  ( ( year = 2017 ) AND  ( month = 10 ) )
			group by year, month
	);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Like I said, it is a long shot but could fix it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;/P&gt;
&lt;P&gt;Jeff&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2018 15:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/503732#M15625</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2018-10-12T15:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: SQL on Hive error: Failed to create spark client</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/504090#M15640</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/51161"&gt;@JBailey&lt;/a&gt;&amp;nbsp;bit that wasn't the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;min(amount)&lt;/LI&gt;
&lt;LI&gt;min(amount) min_date&lt;/LI&gt;
&lt;LI&gt;min(amount) as min_date&lt;/LI&gt;
&lt;LI&gt;all the same error.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;BTW, the table is partitioned by year, month. And it's a managed table (not external).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 13:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/504090#M15640</guid>
      <dc:creator>AndrewHowell</dc:creator>
      <dc:date>2018-10-14T13:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: SQL on Hive error: Failed to create spark client</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/504150#M15643</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13754"&gt;@AndrewHowell&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did a bit of Googling and found this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;"&lt;SPAN&gt;The YARN Container Memory was smaller than the Spark Executor requirement. I set the YARN Container memory and maximum to be greater than Spark Executor Memory + Overhead. Check 'yarn.scheduler.maximum-allocation-mb' and/or 'yarn.nodemanager.resource.memory-mb'.&lt;/SPAN&gt;"&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like it might be what you are facing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best wishes,&lt;BR /&gt;Jeff&lt;/P&gt;</description>
      <pubDate>Sun, 14 Oct 2018 23:59:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/504150#M15643</guid>
      <dc:creator>JBailey</dc:creator>
      <dc:date>2018-10-14T23:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: SQL on Hive error: Failed to create spark client</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/504572#M15665</link>
      <description>&lt;P&gt;Issue not solved but at least understood:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The Hive database in question is&amp;nbsp;public - anyone with access to the cluster could access (and extract) data.&lt;/LI&gt;
&lt;LI&gt;However, if aggregation was required, a Spark session would start, but would fail for any user other than the owner of the database.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;EM&gt;Need to revise the security model..&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Oct 2018 02:33:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/504572#M15665</guid>
      <dc:creator>AndrewHowell</dc:creator>
      <dc:date>2018-10-16T02:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: SQL on Hive error: Failed to create spark client</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/798375#M20257</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I´m facing the some problem. If I understood the architecture of connector SAS interface to Hadoop, It connects to a hive server and after submit processing to a spark cluster.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I configured as this article, setting by default engine and redirecting to a spark cluster.&lt;/P&gt;&lt;P&gt;&lt;A href="https://cwiki.apache.org/confluence/display/Hive/Hive+on+Spark%3A+Getting+Started" target="_blank"&gt;https://cwiki.apache.org/confluence/display/Hive/Hive+on+Spark%3A+Getting+Started&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, I got exactly this error when I´m using some where clauses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13754"&gt;@AndrewHowell&lt;/a&gt;&amp;nbsp;, did you suceeed to solve this issue ? If yes, how do you get success to run jobs on spark engine ? Can you provide your config or properties you adjusted to run ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regardas&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 13:18:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SQL-on-Hive-error-Failed-to-create-spark-client/m-p/798375#M20257</guid>
      <dc:creator>BigRider</dc:creator>
      <dc:date>2022-02-24T13:18:50Z</dc:date>
    </item>
  </channel>
</rss>

