Search code examples
dremio

How to query 'empty text' field in dremio?


I have certain rows in columns that have the phrase 'empty text' in the cell of a table in dremio.

When I try queries like:

select col1 from table1 where col1 is null

I get no results back for rows that have the text 'empty text' in them.

How do I query the 'empty text' fields or change the data type of empty fields to 'null' in dremio?


Solution

  • Use case statement to cast empty cells to null like so:

    CASE WHEN column1= '' THEN NULL ELSE column1 END AS column1