question

Arunkumar-6418 avatar image
0 Votes"
Arunkumar-6418 asked PRADEEPCHEEKATLA-MSFT commented

Cosmos DB source query not working


How to query the Cosmos DB document using container name in data flow inside azure data factory

200839-image.png



When we use the container name in the query (SELECT * FROM [Case]) we get the error "at Source 'source1': java.util.NoSuchElementException: None.get"

azure-data-factoryazure-cosmos-db
image.png (33.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

PRADEEPCHEEKATLA-MSFT avatar image
1 Vote"
PRADEEPCHEEKATLA-MSFT answered PRADEEPCHEEKATLA-MSFT commented

Hello @Arunkumar-6418,

Thanks for the question and using MS Q&A platform.

Could you please run the same query in Azure Cosmos DB => Data Explorer and see if the query works as excepted?

201217-image.png

You can run the same query on ADF data flows as shown below:

  • SELECT * FROM [items] - throws error message

  • SELECT * FROM items - works as excepted

201312-adf-cosmosdb-query.gif

In case, if you are still facing the same error message, could you please share the complete error message which you are experiencing along with the screenshot?

Hope this will help. Please let us know if any further queries.


  • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how

  • Want a reminder to come back and check responses? Here is how to subscribe to a notification

  • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators


image.png (68.8 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @PRADEEPCHEEKATLA-MSFT

Thanks for your response.

If the container name is item that time query working fine but if the container name different that time we are getting error.
Blow i attached the screenshot for your reference.


201245-image.png

201284-image.png

Please let me know if you need more info


0 Votes 0 ·
image.png (52.7 KiB)
image.png (49.2 KiB)

Hello @Arunkumar-6418,

The collection is selected on the Dataset level and not at the query level.

Note: Case is the collection name and not the items available in the collection and the query should be SELECT * FROM c or SELECT * FROM items.

201341-adf-cosmosdb-query-collection.gif

Hope this will help. Please let us know if any further queries.

0 Votes 0 ·
Arunkumar-6418 avatar image Arunkumar-6418 PRADEEPCHEEKATLA-MSFT ·

Thanks @PRADEEPCHEEKATLA-MSFT

Its working for me.

thanks for your response.

1 Vote 1 ·
Show more comments