MicrosoftDocs / azure-docs

Open source documentation of Microsoft Azure
https://docs.microsoft.com/azure
Creative Commons Attribution 4.0 International
10.31k stars 21.48k forks source link

Cannot change keyspaces against CosmosDB Emulator v2.1.3 #24332

Closed dgioulakis closed 5 years ago

dgioulakis commented 5 years ago

Specifying USE does not work against the emulator. I've not tried CosmosDB in Azure. The only way I can create tables is by prefixing the keyspace name. e.g. CREATE TABLE IF NOT EXISTS keyspace.table (...).


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

angoyal-msft commented 5 years ago

@Cephei Thanks for your feedback. We are investigating this issue actively and will get back to you soon.

dgioulakis commented 5 years ago

Strangely, this seems to be working for me after restarting the emulator. I'll do some additional testing before closing. I was definitely unable to see the "created" tables in cqlsh, however, I didn't receive any error response upon INSERT from Cosmos. Only prefixing made them visible, but now it's working without the prefix.

dgioulakis commented 5 years ago

I've found that I must reconnect via cqlsh to the emulator to get the newly created keyspace/tables. It's like as if the stale data was cached. I'm quite new to Cassandra; perhaps I'm not aware of this intended behavior?

I can confirm that USE <keyspace> is actually working. The newly created keyspace can be found in the system_schema.keyspaces, however, issuing a desc keyspaces; command does not return the new keyspace, but the stale data. My assumption is that the same is happening for desc tables;. Perhaps the desc command is returning cached data.

angoyal-msft commented 5 years ago

@Cephei Glad that you are able to figure out the problem. Thanks for sharing your findings. I am checking internally to find whether this is intended behavior or not.

angoyal-msft commented 5 years ago

@Cephei Thanks for your patience. We don't have much update on this as of now. So content author might be able to help you better on this. So assigning this issue to content author. @kanshiG Could you please help us with this issue.

kanshiG commented 5 years ago

Daniel - is this the emulator behavior? Could you specify simple repro to look at ? Just to clarify - There is nothing specific in cqlsh - it is oss tool that is used. See if Azure Cosmos DB instance also shows this behavior - if it is same - then it is expected.

SnehaGunda commented 5 years ago

@Cephei I see you are not unblocked, do you have anything to share WRT to Govind's question?

If not let us know if we can close this issue.

SnehaGunda commented 5 years ago

@Cephei we can confirm that use command is working, I added more examples for each API to the doc. We will now close this issue if you don't have further questions.

please-close