Skip to content
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

Feat[bmq]: support exists(x) function in subscription expressions #594

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bbpetukhov
Copy link
Collaborator

@bbpetukhov bbpetukhov commented Feb 3, 2025

Issue number of the reported bug or feature request: #<219>

Describe your changes

  • Added new function exists(x) to check if the variable x is defined in the current context

Testing performed

  • Added various unit tests to cover exists(x)

@678098
Copy link
Collaborator

678098 commented Feb 4, 2025

@bbpetukhov @chrisbeard some time ago, we had an idea of declaring internal properties or keywords with two underscores __, like __timestamp. Do you think we should do this? Should we also make checks when declaring properties for messages, to prevent setting properties with names abs or exists?

@bbpetukhov bbpetukhov linked an issue Feb 5, 2025 that may be closed by this pull request
1 task
@bbpetukhov bbpetukhov force-pushed the expression-exists branch 2 times, most recently from ab79130 to a472984 Compare February 12, 2025 16:33
@bbpetukhov bbpetukhov changed the title Feat: implement exists(x) and abs(expression) Feat: implement exists(x) function in subscription expressions Feb 12, 2025
@bbpetukhov bbpetukhov changed the title Feat: implement exists(x) function in subscription expressions Feat: support exists(x) function in subscription expressions Feb 12, 2025
@bbpetukhov
Copy link
Collaborator Author

@bbpetukhov @chrisbeard some time ago, we had an idea of declaring internal properties or keywords with two underscores __, like __timestamp. Do you think we should do this? Should we also make checks when declaring properties for messages, to prevent setting properties with names abs or exists?

In the latest version of this PR the implementation of "exists" keyword is smart enough to support both use cases: as a property and as the built-in function. So there should not be any conflicts with property names. Unit tests are added for this scenario.

@bbpetukhov bbpetukhov marked this pull request as ready for review February 13, 2025 14:22
@bbpetukhov bbpetukhov requested a review from a team as a code owner February 13, 2025 14:22
Signed-off-by: Dmitrii Petukhov <dpetukhov@bloomberg.net>
@bbpetukhov bbpetukhov changed the title Feat: support exists(x) function in subscription expressions Feat[bmq]: support exists(x) function in subscription expressions Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subscriptions expressions: Ability to check whether a property exists
2 participants