Re: Meaningless emptiness and filtering

2025-04-04 Thread David Capwell
Been expanding the current AST Harry tests to include collections and UDTs and been finding even more fun with vs null… what Cassandra returns is a product of the schema and what you do with the table; and these types can act differently than other types. > On Feb 13, 2025, at 4:45 AM, Mick Se

Re: Meaningless emptiness and filtering

2025-03-19 Thread David Capwell
Talking in slack I was linked to a Go Client issue (see https://the-asf.slack.com/archives/CK23JSY2K/p1742413507980149?thread_ts=1742409054.164389&cid=CK23JSY2K and https://the-asf.slack.com/archives/C05LPRVNZV1/p1741108083834769 ) gocql was sending empty bytes until recently… > On Mar 19, 20

Re: Meaningless emptiness and filtering

2025-03-19 Thread Nate McCall
100% a hold over from thrift - I don't remember who i was discussing this with ages ago, but there was definitely some question about whether it would bite us eventually. On Wed, Feb 12, 2025 at 8:28 AM Jeremiah Jordan wrote: > AFAIK this EMPTY stuff goes back to thrift days. We let people inse

Re: Meaningless emptiness and filtering

2025-02-13 Thread Mick Semb Wever
On Tue, 11 Feb 2025 at 19:56, Caleb Rackliffe wrote: > When we add IS [NOT] NULL support, that would preferably NOT match EMPTY > values for the types where empty means something, like strings. For > everything else, EMPTY could be equivalent to null and match IS NULL. > Makes sense to me to sa

Re: Meaningless emptiness and filtering

2025-02-11 Thread Caleb Rackliffe
If this is only the default in 5.1/6.0/current trunk, so be it, but the minimum thing I’d want to build consensus around is no longer allowing empty values in filtering/index queries for numeric types. (This applies to actual empty values in filtering expressions, but also things like not matchi

Re: Meaningless emptiness and filtering

2025-02-11 Thread J. D. Jordan
That is the biggest “gotcha” of using the empty value for an int. As soon as you try to use it as an int and not a byte array, all the drivers convert that to a null pointer. If you just “SELECT v0” and then get its value from the result set as a byte array, you get empty bytes, not null. It is

Re: Meaningless emptiness and filtering

2025-02-11 Thread David Capwell
My planet was destroyed to make way for hyperspatial express route before I could get the answer, sorry… anyone interested in getting lunch at the end of the universe? > On Feb 11, 2025, at 2:03 PM, Paulo Motta wrote: > > On Tue, Feb 11, 2025 at 5:00 PM Patrick McFadin wrote: >> >> You get m

Re: Meaningless emptiness and filtering

2025-02-11 Thread Paulo Motta
On Tue, Feb 11, 2025 at 5:00 PM Patrick McFadin wrote: > > You get my vote for the best subject line I've seen this week. > +1, I'm deeply saddened that despite this title this post does not contain the answer to the ultimate question of life, the universe, and everything. :-( > On Tue, Feb 11,

Re: Meaningless emptiness and filtering

2025-02-11 Thread Patrick McFadin
You get my vote for the best subject line I've seen this week. On Tue, Feb 11, 2025 at 1:20 PM Benedict wrote: > > Perhaps we should reify this in the type system? Introduce a MAYBE EMPTY > modifier for column types, or simply name them eg [int] vs int? > > I think the problem is today it’s all

Re: Meaningless emptiness and filtering

2025-02-11 Thread Benedict
Perhaps we should reify this in the type system? Introduce a MAYBE EMPTY modifier for column types, or simply name them eg [int] vs int?I think the problem is today it’s all implicit and - as David says - inconsistent. It would be nice to move away from this as the default for a variety of reasons,

Re: Meaningless emptiness and filtering

2025-02-11 Thread David Capwell
Thanks for the reply! > AFAIK this EMPTY stuff goes back to thrift days. This is what I was told, but the expected semantics are not clear so my goal is to help flesh things out. > We let people insert these zero length values back then, so we have to > support those zero length values existin

Re: Meaningless emptiness and filtering

2025-02-11 Thread Jeremiah Jordan
AFAIK this EMPTY stuff goes back to thrift days. We let people insert these zero length values back then, so we have to support those zero length values existing for ever :/. How useful is such a distinction? I don’t know. Is anybody actually doing this? Well Andres brought up https://issues.

Re: Meaningless emptiness and filtering

2025-02-11 Thread Caleb Rackliffe
The case where allowsEmpty == true AND is meaningless == true is especially confusing. If I could design this from scratch, I would reject writes and filtering on EMPTY values for int and the other types where meaningless == true. (In other words, if we allow EMPTY, it is meaningful and queryable.

Meaningless emptiness and filtering

2025-02-11 Thread David Capwell
Bringing this discussion to dev@ rather than Slack as we try to figure out CASSANDRA-20313 and CASSANDRA-19461. In the type system, we have 2 different (but related) methods: AbstractType#allowsEmpty- if the user gives empty bytes (new byte[0]) will the type reject it Ab