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
feat(sql): 'is null' is an alias for '= null' and 'is not null' for '!= null' #1967
Conversation
… build it locally to be able to run questdb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW did we miss updating armosx/libquestdb.dylib
in one of the previous PRs? I can see it's been updated here.
While it's ok to use = and != on null internally, in SQL it's practically useless and should always evaluate to NULL. 1 = null -> NULL vs 1 is null -> FALSE |
The thing is that in our case this would be a breaking change since many of our users rely on |
I had to build it locally because I was getting a linkage error ( |
core/src/test/java/io/questdb/cutlass/pgwire/PGJobContextTest.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/questdb/cutlass/pgwire/PGConnectionContext.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job! Left some comments, mostly nits
core/src/main/java/io/questdb/cutlass/pgwire/PGConnectionContext.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/questdb/cutlass/pgwire/PGConnectionContext.java
Outdated
Show resolved
Hide resolved
core/src/main/java/io/questdb/griffin/engine/functions/bind/BindVariableServiceImpl.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/questdb/cutlass/pgwire/PGJobContextTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/questdb/cutlass/pgwire/PGJobContextTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/questdb/cutlass/pgwire/PGJobContextTest.java
Outdated
Show resolved
Hide resolved
core/src/test/java/io/questdb/cutlass/pgwire/PGJobContextTest.java
Outdated
Show resolved
Hide resolved
thank you very much @puzpuzpuz and @bziobrowski for the thorough review and for all the help, I enjoyed the experience. What are the rules for merging?, who presses the red button? |
I don't have merge privilege so it has to be Andrey . |
Neither do I. 😀 So, it has to be Miguel or someone else from the core team. |
[PR Coverage check]😍 pass : 60 / 60 (100.00%) file detail
|
MindsDB relies on
IS NULL
andIS NOT NULL
on column literals, e.g.:as it rewrites queries to check for null values this way.
The approach in this PR is to detect these tokens,
IS [NOT] NULL
while parsing expressions, wherever they are, and replace them for the equivalent operator token=
, '!='.