<?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 Query with ORDER BY fails with HiveThriftServerError &amp;quot;requirement failed: Subquery … has not finished&amp;quot; in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/query-with-order-by-fails-with-hivethriftservererror-quot/m-p/8725#M4279</link>
    <description>&lt;P&gt;Using ODBC or JDBC to read from a table fails when I attempt to use an ORDER BY clause. In one sample case, I have a fairly small table (just 1946 rows).&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select *
from some_table
order by some_field&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;java.lang.IllegalArgumentException: requirement failed: Subquery subquery#485, [id=#937] has not finished
        at org.apache.spark.sql.hive.thriftserver.HiveThriftServerErrors$.runningQueryError(HiveThriftServerErrors.scala:53)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation.org$apache$spark$sql$hive$thriftserver$SparkExecuteStatementOperation$$execute(SparkExecuteStatementOperation.scala:445)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$2$$anon$3.$anonfun$run$2(SparkExecuteStatementOperation.scala:269)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at org.apache.spark.sql.hive.thriftserver.ThriftLocalProperties.withLocalProperties(ThriftLocalProperties.scala:123)
        at org.apache.spark.sql.hive.thriftserver.ThriftLocalProperties.withLocalProperties$(ThriftLocalProperties.scala:48)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation.withLocalProperties(SparkExecuteStatementOperation.scala:54)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$2$$anon$3.run(SparkExecuteStatementOperation.scala:247)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$2$$anon$3.run(SparkExecuteStatementOperation.scala:232)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1878)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$2.run(SparkExecuteStatementOperation.scala:281)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)
        at scala.Predef$.require(Predef.scala:281)
        at org.apache.spark.sql.execution.ScalarSubquery.eval(subquery.scala:100)
        at org.apache.spark.sql.catalyst.expressions.Alias.eval(namedExpressions.scala:160)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This seems pretty weird to me—I can't run a simple ORDER BY clause?&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;I've tried this with the ODBC driver and JDBC (2.6.32). With JDBC, I tried all three modes for UseNativeQuery (0, 1, 2) just to exhaust all the options. I do not have any query timeout specified, though specifying a large timeout value made no difference.&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;The immediate impression is that there's something wrong with the JDBC driver, though of course if I'm missing something obvious, that would be all the simpler—it seems a surprising bug to find. If this really &lt;I&gt;is&lt;/I&gt; a bug, where would I go to report it?&lt;/P&gt;</description>
    <pubDate>Sat, 25 Feb 2023 01:29:11 GMT</pubDate>
    <dc:creator>haggholm</dc:creator>
    <dc:date>2023-02-25T01:29:11Z</dc:date>
    <item>
      <title>Query with ORDER BY fails with HiveThriftServerError "requirement failed: Subquery … has not finished"</title>
      <link>https://community.databricks.com/t5/data-engineering/query-with-order-by-fails-with-hivethriftservererror-quot/m-p/8725#M4279</link>
      <description>&lt;P&gt;Using ODBC or JDBC to read from a table fails when I attempt to use an ORDER BY clause. In one sample case, I have a fairly small table (just 1946 rows).&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select *
from some_table
order by some_field&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;java.lang.IllegalArgumentException: requirement failed: Subquery subquery#485, [id=#937] has not finished
        at org.apache.spark.sql.hive.thriftserver.HiveThriftServerErrors$.runningQueryError(HiveThriftServerErrors.scala:53)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation.org$apache$spark$sql$hive$thriftserver$SparkExecuteStatementOperation$$execute(SparkExecuteStatementOperation.scala:445)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$2$$anon$3.$anonfun$run$2(SparkExecuteStatementOperation.scala:269)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at org.apache.spark.sql.hive.thriftserver.ThriftLocalProperties.withLocalProperties(ThriftLocalProperties.scala:123)
        at org.apache.spark.sql.hive.thriftserver.ThriftLocalProperties.withLocalProperties$(ThriftLocalProperties.scala:48)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation.withLocalProperties(SparkExecuteStatementOperation.scala:54)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$2$$anon$3.run(SparkExecuteStatementOperation.scala:247)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$2$$anon$3.run(SparkExecuteStatementOperation.scala:232)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:422)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1878)
        at org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation$$anon$2.run(SparkExecuteStatementOperation.scala:281)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:750)
        at scala.Predef$.require(Predef.scala:281)
        at org.apache.spark.sql.execution.ScalarSubquery.eval(subquery.scala:100)
        at org.apache.spark.sql.catalyst.expressions.Alias.eval(namedExpressions.scala:160)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This seems pretty weird to me—I can't run a simple ORDER BY clause?&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;I've tried this with the ODBC driver and JDBC (2.6.32). With JDBC, I tried all three modes for UseNativeQuery (0, 1, 2) just to exhaust all the options. I do not have any query timeout specified, though specifying a large timeout value made no difference.&lt;/P&gt;&lt;P&gt;​&lt;/P&gt;&lt;P&gt;The immediate impression is that there's something wrong with the JDBC driver, though of course if I'm missing something obvious, that would be all the simpler—it seems a surprising bug to find. If this really &lt;I&gt;is&lt;/I&gt; a bug, where would I go to report it?&lt;/P&gt;</description>
      <pubDate>Sat, 25 Feb 2023 01:29:11 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/query-with-order-by-fails-with-hivethriftservererror-quot/m-p/8725#M4279</guid>
      <dc:creator>haggholm</dc:creator>
      <dc:date>2023-02-25T01:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Query with ORDER BY fails with HiveThriftServerError "requirement failed: Subquery … has not finished"</title>
      <link>https://community.databricks.com/t5/data-engineering/query-with-order-by-fails-with-hivethriftservererror-quot/m-p/8726#M4280</link>
      <description>&lt;P&gt;You could open the support case in the menu item.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 09:01:37 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/query-with-order-by-fails-with-hivethriftservererror-quot/m-p/8726#M4280</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-07T09:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Query with ORDER BY fails with HiveThriftServerError "requirement failed: Subquery … has not finished"</title>
      <link>https://community.databricks.com/t5/data-engineering/query-with-order-by-fails-with-hivethriftservererror-quot/m-p/8727#M4281</link>
      <description>&lt;P&gt;Hi @petter@hightouch.com Petter​&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your question! To assist you better, please take a moment to review the answer and let me know if it best fits your needs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please help us select the best solution by clicking on "Select As Best" if it does.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your feedback will help us ensure that we are providing the best possible service to you. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 04:39:52 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/query-with-order-by-fails-with-hivethriftservererror-quot/m-p/8727#M4281</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-03-13T04:39:52Z</dc:date>
    </item>
  </channel>
</rss>

