cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
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.

1 ACCEPTED SOLUTION

Accepted Solutions

Kaniz
Community Manager
Community Manager

Hi @Vladimir Ryabtsev​, Thank you for the feedback. We have noted your points. We shall look into it and update the document.

View solution in original post

1 REPLY 1

Kaniz
Community Manager
Community Manager

Hi @Vladimir Ryabtsev​, Thank you for the feedback. We have noted your points. We shall look into it and update the document.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.