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

Add isOnlyNotNull to Domain #17189

Closed
wants to merge 1 commit into from
Closed

Conversation

elonazoulay
Copy link
Member

@elonazoulay elonazoulay commented Apr 23, 2023

Convenience method for domain.getValues().isAll() && !domain.isNullAllowed(). This translates to IS NOT NULL.

Description

Additional context and related issues

This can be applied to the follow pr as well:
#16979

Release notes

(X ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label Apr 23, 2023
@github-actions github-actions bot added the mongodb MongoDB connector label Apr 23, 2023
@elonazoulay elonazoulay force-pushed the domain_api branch 2 times, most recently from 921244c to 409c47d Compare April 27, 2023 20:56
@@ -154,6 +154,11 @@ public boolean isOnlyNull()
return values.isNone() && nullAllowed;
}

public boolean isOnlyNotNull()
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this Only prefix here ? (No changes requested wanted to have a discussion here)

Cc: @findepi

Copy link
Member Author

Choose a reason for hiding this comment

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

I saw the isOnlyNull method which (imo) makes it clear what the method means so I thought to keep the name consistent, i.e. if changed to isNotNull it could also imply always true, wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

isOnlyNull means "only null allowed" (null is just one possible value)

isOnlyNotNull means "only not null allowed", but there is no such single thing as "not null".

to avoid confusion, let's call the new method isAllExceptNull

Copy link
Member

Choose a reason for hiding this comment

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

isOnlyNotNull means "only not null allowed", but there is no such single thing as "not null".

Not sure what you mean by this. "not null" means any value but null.

This method should be named isNotNull() (i.e., does this domain represent the set of values that are not null?), and it would be the counterpart of Domain.notNull(...). I don't see what's confusing about that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks! Updated. Should the pr name be changed?

Copy link
Member

Choose a reason for hiding this comment

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

To me, Domain is "a set", not "a filter".
isNotNull is suitable terminology for a filter, but not for the set
maybe isAllNonNull would be suitable for a set

@findepi findepi requested a review from martint May 4, 2023 07:08
@elonazoulay elonazoulay requested a review from Praveen2112 May 17, 2023 15:22
@elonazoulay elonazoulay force-pushed the domain_api branch 2 times, most recently from 7d6ab3c to d83a6be Compare May 19, 2023 16:58
Convenience method for domain.getValues().isAll() && !domain.isNullAllowed().
This translates to IS NOT NULL.
Copy link

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Jan 16, 2024
@mosabua
Copy link
Member

mosabua commented Jan 16, 2024

I assume this is still in progress / ready for review and merge @elonazoulay @martint @findepi

@github-actions github-actions bot removed the stale label Jan 18, 2024
Copy link

This pull request has gone a while without any activity. Tagging the Trino developer relations team: @bitsondatadev @colebow @mosabua

@github-actions github-actions bot added the stale label Feb 21, 2024
Copy link

Closing this pull request, as it has been stale for six weeks. Feel free to re-open at any time.

@github-actions github-actions bot closed this Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants