Skip to content

fix(sql): cannot compile query with aggregate function containing unary minus#6404

Merged
bluestreak01 merged 3 commits intomasterfrom
nw_optimiser_bug
Nov 20, 2025
Merged

fix(sql): cannot compile query with aggregate function containing unary minus#6404
bluestreak01 merged 3 commits intomasterfrom
nw_optimiser_bug

Conversation

@nwoolmer
Copy link
Copy Markdown
Contributor

@nwoolmer nwoolmer commented Nov 17, 2025

Fixes #6403

The optimiser code assumed binary -/+. In the unary case, it did not nullcheck. Also added a check to ensure it is a binary op.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 17, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch nw_optimiser_bug

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nwoolmer nwoolmer added Bug Incorrect or unexpected behavior SQL Issues or changes relating to SQL execution labels Nov 17, 2025
@glasstiger
Copy link
Copy Markdown
Contributor

[PR Coverage check]

😍 pass : 1 / 1 (100.00%)

file detail

path covered line new line coverage
🔵 io/questdb/griffin/SqlOptimiser.java 1 1 100.00%

@bluestreak01 bluestreak01 merged commit ec68484 into master Nov 20, 2025
41 checks passed
@bluestreak01 bluestreak01 deleted the nw_optimiser_bug branch November 20, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Incorrect or unexpected behavior SQL Issues or changes relating to SQL execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

optimiser fails with unary minus on column targeted for aggregation

4 participants