<?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 when using libname jdbc to connect to hive an error appears in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/when-using-libname-jdbc-to-connect-to-hive-an-error-appears/m-p/911085#M359266</link>
    <description>&lt;P&gt;dear all:&lt;/P&gt;
&lt;P&gt;I use jdbc to connect to hive database ,the libname code is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname dm JDBC url="jdbc:hive2://xx.xx.xx.xx:10000/" classpath="D:\JDBC_Drivers_For_Hive" driverclass="com.cloudera.hive.jdbc.HS2Driver" &lt;BR /&gt;user="*******" password="*********" schema="DM" DBMAX_TEXT=1024 PRESERVE_TAB_NAMES=YES PRESERVE_COL_NAMES=YES TRANSCODE_FAIL=WARNING QUOTE_CHAR='"' ;&lt;BR /&gt;libname mylib "d:\";&lt;BR /&gt;proc sql;&lt;BR /&gt;connect using DM;&lt;BR /&gt;create table mylib.the_big_datas &lt;BR /&gt;select * from connection to DM&lt;BR /&gt;(&lt;BR /&gt;select * from dm.the_big_dat&lt;BR /&gt;); &lt;BR /&gt;disconnect from DM; &lt;BR /&gt;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I try to select a big data&amp;nbsp; from the hive database&amp;nbsp; which has 1000 columns and 1.8 million rows. Here&amp;nbsp; I got the error log as below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: Fetch error: [Cloudera][HiveJDBCDriver](500540) Error caught in BackgroundFetcher. Foreground thread ID: 30. Background thread ID: 31. Error caught: Java heap space.

ERROR: Close error: java.lang.OutOfMemoryError: Java heap space&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;what should I do to make the SQL query statements work ？&lt;/P&gt;
&lt;P&gt;ANY suggestion is welcome！&lt;/P&gt;
&lt;P&gt;Thanks in advance！&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 Jan 2024 09:37:17 GMT</pubDate>
    <dc:creator>duanzongran</dc:creator>
    <dc:date>2024-01-10T09:37:17Z</dc:date>
    <item>
      <title>when using libname jdbc to connect to hive an error appears</title>
      <link>https://communities.sas.com/t5/SAS-Programming/when-using-libname-jdbc-to-connect-to-hive-an-error-appears/m-p/911085#M359266</link>
      <description>&lt;P&gt;dear all:&lt;/P&gt;
&lt;P&gt;I use jdbc to connect to hive database ,the libname code is&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname dm JDBC url="jdbc:hive2://xx.xx.xx.xx:10000/" classpath="D:\JDBC_Drivers_For_Hive" driverclass="com.cloudera.hive.jdbc.HS2Driver" &lt;BR /&gt;user="*******" password="*********" schema="DM" DBMAX_TEXT=1024 PRESERVE_TAB_NAMES=YES PRESERVE_COL_NAMES=YES TRANSCODE_FAIL=WARNING QUOTE_CHAR='"' ;&lt;BR /&gt;libname mylib "d:\";&lt;BR /&gt;proc sql;&lt;BR /&gt;connect using DM;&lt;BR /&gt;create table mylib.the_big_datas &lt;BR /&gt;select * from connection to DM&lt;BR /&gt;(&lt;BR /&gt;select * from dm.the_big_dat&lt;BR /&gt;); &lt;BR /&gt;disconnect from DM; &lt;BR /&gt;quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I try to select a big data&amp;nbsp; from the hive database&amp;nbsp; which has 1000 columns and 1.8 million rows. Here&amp;nbsp; I got the error log as below:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: Fetch error: [Cloudera][HiveJDBCDriver](500540) Error caught in BackgroundFetcher. Foreground thread ID: 30. Background thread ID: 31. Error caught: Java heap space.

ERROR: Close error: java.lang.OutOfMemoryError: Java heap space&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;what should I do to make the SQL query statements work ？&lt;/P&gt;
&lt;P&gt;ANY suggestion is welcome！&lt;/P&gt;
&lt;P&gt;Thanks in advance！&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 09:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/when-using-libname-jdbc-to-connect-to-hive-an-error-appears/m-p/911085#M359266</guid>
      <dc:creator>duanzongran</dc:creator>
      <dc:date>2024-01-10T09:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: when using libname jdbc to connect to hive an error appears</title>
      <link>https://communities.sas.com/t5/SAS-Programming/when-using-libname-jdbc-to-connect-to-hive-an-error-appears/m-p/911093#M359270</link>
      <description>&lt;P&gt;Have you tried to do a smilar query from another tool (than SAS)?&lt;/P&gt;
&lt;P&gt;I found this, not sure if it's applicable:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.cloudera.com/t5/Support-Questions/Hive-Query-Error-java-lang-OutOfMemoryError-Java-heap-space/td-p/15028" target="_blank"&gt;https://community.cloudera.com/t5/Support-Questions/Hive-Query-Error-java-lang-OutOfMemoryError-Java-heap-space/td-p/15028&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 10:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/when-using-libname-jdbc-to-connect-to-hive-an-error-appears/m-p/911093#M359270</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2024-01-10T10:47:38Z</dc:date>
    </item>
  </channel>
</rss>

