Tim
Tim

Reputation: 583

databricks not seeing data I expect

trying to query a table in DB.

%sql SELECT 'Status' FROM checkins_csv WHERE 'Status' IS NOT NULL;

getting back the following:

enter image description here

Not sure what I'm doing wrong and not seeing data?

Upvotes: 0

Views: 146

Answers (1)

Isolated
Isolated

Reputation: 6454

The single quotes think you are making a pseudo (string) column in your results. You just need to remove the single quotes in your query:

%sql 
SELECT status FROM checkins_csv WHERE status IS NOT NULL; 

To better illustrate, run this too, which creates two additional columns:

%sql 
SELECT 'Bacon', 1, status FROM checkins_csv WHERE status IS NOT NULL; 

Upvotes: 1

Related Questions