# Result table disappear before reading all partitions

**URL:** <https://www.singlestore.com/forum/t/result-table-disappear-before-reading-all-partitions/7425>\
**Category:** Help\
**Created:** [January 19, 2024, 2:39pm UTC](https://www.singlestore.com/forum/t/result-table-disappear-before-reading-all-partitions/7425 "2024-01-19T14:39:36Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwas](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/jwas/32/1953_2.png) [@jwas](https://www.singlestore.com/forum/u/jwas)\
**Post date:** [January 19, 2024, 2:39pm UTC](https://www.singlestore.com/forum/t/result-table-disappear-before-reading-all-partitions/7425/1 "2024-01-19T14:39:36Z")

</div>

I’m trying to read query results in parallel. I’m following the docs at [Read Query Results in Parallel · SingleStore Documentation](https://docs.singlestore.com/db/v8.5/query-data/advanced-query-topics/read-query-results-in-parallel/)

When I create result tables for two queries and then try to read from these tables, for one of them I’m getting an error like `Aggregator result table 'some_db.some_table' doesn't exist`. Sometimes I also get `Error: 2318-HY000: Leaf Error (127.0.0.1:3307): Internal result table 'some_db::1_15_pdt.some_table(2)' doesn't exist.`

After creating these result tables, I make sure they exist by running a `SHOW RESULT TABLE` query.

It does not matter if I use single-reader mode or create materialized result tables.

I’m testing this with very tiny tables (5-25 rows), where all rows are in a single partition. There are 8 partitions by default.

I’m running SingleStore in a local container using the `memsql/cluster-in-a-box:alma-8.0.4-c190bb9c08-4.0.10-1.14.4` image. I’m also using the com.singlestore:singlestore-jdbc-client:1.2.0 JDBC driver.

How I can debug this issue? The docs are pretty sparse about this feature. I stumbled on `SHOW RESULT TABLES` in release notes, as it’s not even documented.

---

<div class="post-metadata">

**Author:** ![jwas](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/jwas/32/1953_2.png) [@jwas](https://www.singlestore.com/forum/u/jwas)\
**Post date:** [January 23, 2024, 9:23am UTC](https://www.singlestore.com/forum/t/result-table-disappear-before-reading-all-partitions/7425/2 "2024-01-23T09:23:38Z")

</div>

Looks like the Spark connector retries queries that read from result tables if it doesn’t exist (yet): [https://github.com/memsql/singlestore-spark-connector/blob/82afc8def1e3ce2cff26bac3d656c2fabd3c8b75/src/main/scala/com/singlestore/spark/SinglestoreRDD.scala#L114](https://github.com/memsql/singlestore-spark-connector/blob/82afc8def1e3ce2cff26bac3d656c2fabd3c8b75/src/main/scala/com/singlestore/spark/SinglestoreRDD.scala#L114)

Why is that necessary?

---

<div class="post-metadata">

**Author:** ![oyeliseiev-ua](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/oyeliseiev-ua/32/1954_2.png) [@oyeliseiev-ua](https://www.singlestore.com/forum/u/oyeliseiev-ua)\
**Post date:** [January 23, 2024, 9:30am UTC](https://www.singlestore.com/forum/t/result-table-disappear-before-reading-all-partitions/7425/3 "2024-01-23T09:30:10Z")

</div>

Hello @jwas, you need to maintain the connection alive (used for creation of the result table) until you’ve finished reading all the results.

---

<div class="post-metadata">

**Author:** ![jwas](https://www.singlestore.com/forum/user_avatar/www.singlestore.com/jwas/32/1953_2.png) [@jwas](https://www.singlestore.com/forum/u/jwas)\
**Post date:** [January 23, 2024, 1:40pm UTC](https://www.singlestore.com/forum/t/result-table-disappear-before-reading-all-partitions/7425/4 "2024-01-23T13:40:17Z")

</div>

That helped, thanks! Maybe consider adding that to the docs.

---

<div class="post-metadata">

**Author:** ![tsiddiqui](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/t/b19c9b/32.png) [@tsiddiqui](https://www.singlestore.com/forum/u/tsiddiqui)\
**Post date:** [February 8, 2024, 5:11pm UTC](https://www.singlestore.com/forum/t/result-table-disappear-before-reading-all-partitions/7425/5 "2024-02-08T17:11:56Z")

</div>

Hello, @oyeliseiev-ua , I have a similar issue with spark singlestore connector

reading with option:

**.option(“parallelRead.Features”, “readFromAggregatorsMaterialized”)**

Get this error randomly and the spark job times out.

**24/01/09 08:05:47 WARN ErrorPacket: Error: 2318-HY000: Aggregator result table \<\<\>\> doesn’t exist.**

This occurs mostly when 2 park jobs in parallel are hitting the same singlestore db.

Any ideas ?

---

<div class="post-metadata">

**Author:** ![amakarovych-ua](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/a/bb73d2/32.png) [@amakarovych-ua](https://www.singlestore.com/forum/u/amakarovych-ua)\
**Post date:** [September 10, 2024, 12:30pm UTC](https://www.singlestore.com/forum/t/result-table-disappear-before-reading-all-partitions/7425/6 "2024-09-10T12:30:54Z")

</div>

Hello, @tsiddiqui  
I suspect that your issue may be connected to the bug which was fixed here [Made result table name unique · memsql/singlestore-spark-connector@d30b0a8 · GitHub](https://github.com/memsql/singlestore-spark-connector/commit/d30b0a8ffab29e804f9d681c1697d8f78626608b)  
Can you retest with the latest version of the connector?

---

<div class="post-metadata">

**Author:** ![JosieWalker](https://www.singlestore.com/forum/letter_avatar_proxy/v4/letter/j/90ced4/32.png) [@JosieWalker](https://www.singlestore.com/forum/u/JosieWalker)\
**Post date:** [October 28, 2024, 2:59pm UTC](https://www.singlestore.com/forum/t/result-table-disappear-before-reading-all-partitions/7425/7 "2024-10-28T14:59:34Z")

</div>

It helped me also, thank you so much.
