Skip to content

"<>" inequality operator gives token parsing error #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jkenefick opened this issue Apr 12, 2025 · 0 comments
Open

"<>" inequality operator gives token parsing error #194

jkenefick opened this issue Apr 12, 2025 · 0 comments
Assignees
Labels
bug cosmosEmulatorVnextPreview issues raised for the vNext Linux based emulator (preview)
Milestone

Comments

@jkenefick
Copy link

jkenefick commented Apr 12, 2025

Describe the bug
The vNext Azure Cosmos DB Emulator does not support the <> inequality operator

To Reproduce
Steps to reproduce the behavior:

  1. Bring up the vNext Azure Cosmos DB Emulator
  2. Create new Container (properties are irrelevant)
  3. Attempt a query or a filter with a WHERE clause such as where c.id <> "12"
  4. Error message observed at bottom of screen is Failed to parse token '>' at position 85
  5. Log errors include
DocDBTrace Warning: 0 : Intercepted query parsing error Antlr4.Runtime.NoViableAltException: Exception of type 'Antlr4.Runtime.NoViableAltException' was thrown.
   at Antlr4.Runtime.Atn.ParserATNSimulator.ExecATN(DFA dfa, DFAState s0, ITokenStream input, Int32 startIndex, ParserRuleContext outerContext)
   at Antlr4.Runtime.Atn.ParserATNSimulator.AdaptivePredict(ITokenStream input, Int32 decision, ParserRuleContext outerContext)
   at Microsoft.Azure.Cosmos.Postgres.Core.Query.Antlr.Generated.CosmosQueryParser.scalar_expression(Int32 _p) in /tmp/gateway/Cosmos.Postgres.Core/Query/Parser/Generated/CosmosQueryParser.cs:line 1981
DocDBTrace Warning: 0 : Intercepted query parsing error Antlr4.Runtime.NoViableAltException: Exception of type 'Antlr4.Runtime.NoViableAltException' was thrown.
   at Antlr4.Runtime.Atn.ParserATNSimulator.ExecATN(DFA dfa, DFAState s0, ITokenStream input, Int32 startIndex, ParserRuleContext outerContext)
   at Antlr4.Runtime.Atn.ParserATNSimulator.AdaptivePredict(ITokenStream input, Int32 decision, ParserRuleContext outerContext)
   at Microsoft.Azure.Cosmos.Postgres.Core.Query.Antlr.Generated.CosmosQueryParser.scalar_expression(Int32 _p) in /tmp/gateway/Cosmos.Postgres.Core/Query/Parser/Generated/CosmosQueryParser.cs:line 1968

Expected behavior
The <> operator should work as it does on the Cloud CosmosDB

Screenshots

Image

Desktop (please complete the following information):

  • OS: [e.g. MacOS]
  • Browser [Chrome]
  • Explorer Version 3bf0f09d37fb559466f78c848326b8adfb409ba6
  • Docker image information: mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator vnext-preview db99cc6bc4aa

Additional context
It's causing a problem because we require it in our TestContainers. Code such as the following is currently incompatible with the vNext emulator and will cause issues with the ChangeFeed feature.

https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/cosmos/azure-cosmos/src/main/java/com/azure/cosmos/implementation/changefeed/pkversion/LeaseStoreManagerImpl.java#L502

@jkenefick jkenefick added cosmosEmulatorVnextPreview issues raised for the vNext Linux based emulator (preview) needs-triage labels Apr 12, 2025
@xgerman xgerman added bug and removed needs-triage labels Apr 16, 2025
@xgerman xgerman added this to the Backlog milestone Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cosmosEmulatorVnextPreview issues raised for the vNext Linux based emulator (preview)
Projects
None yet
Development

No branches or pull requests

2 participants