Skip to content

[DBSP] Add a 'positive' operator, a variant of 'distinct'#6617

Merged
mihaibudiu merged 1 commit into
feldera:mainfrom
mihaibudiu:positive
Jul 11, 2026
Merged

[DBSP] Add a 'positive' operator, a variant of 'distinct'#6617
mihaibudiu merged 1 commit into
feldera:mainfrom
mihaibudiu:positive

Conversation

@mihaibudiu

Copy link
Copy Markdown
Contributor

Add a new DBSP operator which is just like DISTINCT, but keeps the positive weight unchanged (DISTINCT clamps any positive weight to 1). This is a much more efficient building block for implementing EXCEPT ALL, I plan to use this implementation in solving #5483 instead of the currently open PR.

Checklist

  • Unit tests added/updated

@mihaibudiu
mihaibudiu requested a review from ryzhyk July 10, 2026 21:02

@ryzhyk ryzhyk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems useful.

/// │ 0, otherwise
///
/// ┌
/// │ 1, if w > 0

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is no longer true?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is true, it says "e.g., for distinct".

positive_test(true);
}

fn positive_test(transaction: bool) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get claude build a proptest and/or test it more thoroughly for corner cases (i know there aren't many, but still)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have generated a more exhaustive test. I will merge this.

@mythical-fred mythical-fred left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Signed-off-by: Mihai Budiu <mbudiu@feldera.com>
@mihaibudiu
mihaibudiu enabled auto-merge July 10, 2026 23:36
@mihaibudiu
mihaibudiu added this pull request to the merge queue Jul 10, 2026
Merged via the queue into feldera:main with commit a7e4fd8 Jul 11, 2026
1 check passed
@mihaibudiu
mihaibudiu deleted the positive branch July 11, 2026 01:06
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.

3 participants