AnswerBun.com

select top 1 * from c returns count size as num of partitions * actual query count in cosmosdb spark

Stack Overflow Asked by You Hock Tan on January 1, 2022

I am using azure-cosmosdb-spark library for scala and I was trying to query the following

select top 1 * from c

but I gotten the final dataframe count to be 8 instead of 1. I suspect that the CosmosDBRDDIterator splits it into multiple partitions (in this case 8) and processed the query.

The result count will always be 8x the count of the actual results regardless the select query executed.

Is there any way I can avoid this and get my actual count as 1?

One Answer

Tried limit instead of top?

select * from c limit 1

Answered by Adrian Bona on January 1, 2022

Add your own answers!

Related Questions

Jquery promises in loop

1  Asked on December 9, 2021 by alan-a

     

Vertical align on left Boostrap

1  Asked on December 9, 2021 by obsesie

     

How to get flags of opened fd in C?

2  Asked on December 9, 2021 by code_worker

     

Make list evenly spaced and inline

4  Asked on December 9, 2021 by nobert

   

ASP Core 3.1 API with EF Core 5.0

1  Asked on December 9, 2021 by bibout182

     

Using set in c++ standard template library (STL)

1  Asked on December 9, 2021 by tushar-jain

       

Element goes out of the element in JS

1  Asked on December 9, 2021

   

How to set scrollbars to only part of the modal?

2  Asked on December 9, 2021 by gowthamss

   

C#, Linq, Filter a list whether its properties appear on another list

2  Asked on December 9, 2021 by hiedeptrai

   

Return all filename from database by specific field name

4  Asked on December 9, 2021 by maqsud-inamdar

   

Fixed header logic

2  Asked on December 9, 2021 by j00m

     

Ask a Question

Get help from others!

© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP