title: dbGetQuery throttles when the limit is removed for a very large table in a hive database
body: <p>All,</p>
  
  <p>I'm trying to use the packages RJDBC , rJava and DBI in R to extract the data from a big hive table sitting in a mapr hive/hadoop cluster on a remote linux machine.</p>
  
  <p>I don't have any issues in connecting to the hive cluster. The table1 I'm trying to extract data from is of the size 500M ( million) rows x 16 columns.</p>
  
  <p><strong>This is the code:</strong> </p>
  
  <pre><code>options(java.parameters = "-Xmx32g" )
  
  library(RJDBC)
  library(DBI)
  library(rJava)
  
  hive_dir &lt;- "/opt/mapr/hive/hive-0.13/lib"
  .jinit()
  .jaddClassPath(paste(hive_dir,"hadoop-0.20.2-core.jar", sep="/"))
  .jaddClassPath(c(list.files("/opt/mapr/hadoop/hadoop-0.20.2/lib",pattern="jar$",full.names=T),
                   list.files("/opt/mapr/hive/hive-0.13/lib",pattern="jar$",full.names=T),
                   list.files("/mapr/hadoop-dir/user/userid/lib",pattern="jar$",full.names=T)))
  drv &lt;- JDBC("org.apache.hive.jdbc.HiveDriver","hive-jdbc-0.13.0-mapr-1504.jar",identifier.quote="`")
  
  
  hive.master &lt;- "xx.xxx.xxx.xxx:10000"
  url.dbc &lt;-  paste0("jdbc:hive2://", hive.master)
  conn = dbConnect(drv, url.dbc, "user1", "xxxxxxxx")
  
  dbSendUpdate(conn, "set hive.resultset.use.unique.column.names=false")
  
  df &lt;- dbGetQuery(conn, "select *  from dbname.table1 limit 1000000 ") # basically 1 million rows
  </code></pre>
  
  <p>The above works perfectly and df data.frame contains exactly what I want. However if I remove the limit from the last code segment, I get an error:</p>
  
  <pre><code>df &lt;- dbGetQuery(conn, "select *  from dbname.table1 ")
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <pre><code>Error in .verify.JDBC.result(r, "Unable to retrieve JDBC result set for ",  :    Unable to retrieve JDBC result set for select *  from dbname.table1  (Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask)
  </code></pre>
  
  <p>I googled the last part of the error <code>Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask</code> and tried to put these 2 statements before the <code>dbGetQuery</code>, but couldn't get rid of the error.</p>
  
  <pre><code>dbSendUpdate(conn, "SET hive.auto.convert.join=false")
  dbSendUpdate(conn, "SET hive.auto.convert.join.noconditionaltask=false")
  </code></pre>
  
  <p>Does anybody have any idea why I'm getting the error when I remove the limit from my select statement ? It even works for 120 million rows with the limit, but takes a long time. At this point, the time taken is not a concern for me.</p>