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

stream_processor: fix operator precedence for logical operations #9388

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

Conversation

unitmatrix
Copy link

Fixes #3763

Summary

This pull request addresses the issue where the precedence of logical operators (AND, OR, NOT) was not defined in the grammar for the stream processor.

Changes Made

  • Added precedence rules for NOT, AND, and OR operators to the Bison grammar file.
    • NOT now has the highest precedence.
    • AND has middle precedence.
    • OR has the lowest precedence.

Issue Addressed

Fixes GitHub issue: stream_processor: precedence of AND, OR, and NOT not defined in grammar.

Impact

This change ensures that logical operations in conditions are parsed with the correct precedence, aligning with expected logical operation rules.

Testing

Please verify that the logical operations in conditions are handled correctly according to the new precedence rules.

Feel free to reach out if there are any questions or further adjustments needed.

@koleini
Copy link
Collaborator

koleini commented Sep 17, 2024

Thanks @unitmatrix, it would be great if the syntax (https://github.com/fluent/fluent-bit/tree/master/src/stream_processor#sql-statement-syntax) can be updated based on your changes as well.

@unitmatrix
Copy link
Author

Hi @koleini,

Thank you for your feedback. To ensure that I address your request accurately, I revisited my changes and believe they do not impact the existing SQL statement syntax as outlined in the documentation. Could you please specify which part of the syntax might be affected, or if there are specific updates you have in mind? This will help me make the necessary adjustments to the documentation more effectively.

Looking forward to your guidance.
Best regards.

Signed-off-by: Aleksandr Cupacenko <apaxuc@gmail.com>

revert definition removal

Signed-off-by: Aleksandr Cupacenko <apaxuc@gmail.com>

add operator precedence unit tests

correct precedencer order
@unitmatrix unitmatrix changed the title Fix Operator Precedence for Logical Operations in Stream Processor stream_processor: fix operator precedence for logical operations Oct 2, 2024
@unitmatrix
Copy link
Author

Hi team,

I hope everyone is doing well. I wanted to follow up on this pull request submitted on Sep 14. I've made the necessary updates based on the pipeline checks and have responded to all the questions so far. Could someone please provide an update on the status of this PR? I'm looking forward to any further feedback or actions needed to move this forward.

Thank you for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

stream_processor: precedence of AND, OR, and NOT not defined in grammar
2 participants