typelevel / typelevel/frameless

Unexpected null equality

Open
#269 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug help wanted
Dominant language
Scala
Stars
895
Forks
135
Avg merge
1d 16h
Merged PRs (30d)
3

Description

In SQL

SELECT NULL = NULL;

results in NULL, which is a falsy value when used in WHERE, so eg.

SELECT 1 WHERE NULL = NULL

returns an empty table.

However in Scala, both null == null and None == None are true.

Consequently these two lines should not pass.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in dataset/src/test/scala/frameless/FilterTests.scala at lines 132-133 and inspect the existing filter and equality tests. Trace the behavior under test and compare it with the SQL NULL semantics described in the issue; done means the tests and implementation agree on the intended null equality behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
scala, sql
Domain
data, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.