lyne7-sc opened a new issue, #2457:
URL: https://github.com/apache/auron/issues/2457

   **Describe the bug**
   <!--
   A clear and concise description of what the bug is.
   -->
   
   `NativeCollectLimitBase.executeCollect()` uses `RDD.toLocalIterator` to 
collect rows from its input partitions.
   
   `toLocalIterator` submits a separate Spark job for each scanned partition. 
For a `LIMIT` query with empty or highly selective input, Auron may therefore 
submit many jobs before finding enough rows or exhausting all partitions.
   
   **To Reproduce**
   <!--
   Steps to reproduce the behavior:
   1. Go to '...'
   2. Click on '....'
   3. Scroll down to '....'
   4. See error
   -->
   
   Run a limit query whose filter removes all rows:
   
   ```scala
   spark
     .read
     .parquet(path)
     .where("id < 0")
     .limit(1)
     .collect()
   ```
   
   Inspecting the Spark jobs shows that each scanned partition is handled by a 
separate job.
   
   **Expected behavior**
   <!--
   A clear and concise description of what you expected to happen.
   -->
   
   Partitions should be scanned in batches, using the same strategy as Spark's 
executeTake. The number of submitted jobs should be lower than the number of 
scanned partitions.
   
   **Screenshots**
   <!--
   If applicable, add screenshots to help explain your problem.
   -->
   
   **Additional context**
   <!--
   Add any other context about the problem here.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to