Skip to content

SQL: Cannot use NOT in SELECT clause when table columns are used. #34558

@matriv

Description

@matriv

SELECT NOT emp_no = 1 FROM test_emp throws:

java.sql.SQLException: Server encountered an error [Not supported yet]. [SqlIllegalArgumentException[Not supported yet]
	at org.elasticsearch.xpack.sql.expression.predicate.Not.asScript(Not.java:58)
	at org.elasticsearch.xpack.sql.expression.function.scalar.ScalarFunction.toAttribute(ScalarFunction.java:38)
	at org.elasticsearch.xpack.sql.planner.QueryFolder$FoldProject.rule(QueryFolder.java:140)
	at org.elasticsearch.xpack.sql.planner.QueryFolder$FoldProject.rule(QueryFolder.java:106)

but it works if everything is a literal: SELECT NOT 1 > 2

Need to implement asScript and makePipe in Not unary scalar function.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions