Skip to content

IS [NOT] NULL does not work with complex types #3353

Open
@hatyo

Description

@hatyo

Let's assume we have the following schema:

create type as struct nested(a bigint, b bigint)
create table t2(id bigint, col1 nested, primary key(id))
insert into t2 values (1, null), (2, (5, 6))

The following query throws a semantic analysis exception:

select * from t2 where col1 is null

also this one throws a similar exception:

select * from t2 where col1 is not null

The exception is:

com.apple.foundationdb.record.query.plan.cascades.SemanticException: The comparand to a comparison expecting an argument of a primitive type, is invoked with an argument of a complex type, e.g. an array or a record.

this is due to having a very strict verification against passing a record type to single-parameter RelOp values which I think should be allowed. Moreover, the IS_NULL and IS_NOT_NULL encapsulators lack support for RECORD type arguments, this should be fixed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions