cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

NULL vs NaN in SQL Mode

rv1
New Contributor

In SQL Mode | SQL Editor there seems to be no distinction between NULL and NaN.

image 

In some cases it is very misleading as it makes the user to search mistake in the wrong place.

DE/DS mode works as expected:

image 

UPDATE: a bit later I found this article: https://kb.databricks.com/en_US/dbsql/display-null-as-nan

However I believe it is a complete nonsense (and the number of downvotes says for that). First of all, Mr. Adam Pavlacka misinterpreted the problem: not "Null column values display as NaN", it is other way around. Secondly, the behaviour described in the article is not reproducible in the latest versions of Databricks: Spark engine does not interpret NaN as NULL or conversely, it is only UI problem of Table visualization. Maybe the article was actual at the time of writing, but now it is obsolete.

0 REPLIES 0

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group