cloudera / hue

Open source SQL Query Assistant service for Databases/Warehouses
https://cloudera.com
Apache License 2.0
1.17k stars 366 forks source link

Visually differentiate between null values and "NULL" strings #160

Closed mkrcah closed 9 years ago

mkrcah commented 9 years ago

The table with results of Hive/Impala queries currently shows null values and "NULL" strings identically. For example, results for the query select null as c1, 'NULL' as c2; looks as follows:

image

It would be great to have null values displayed differently, e.g. with a different colour, so it's easier to debug sql queries, ETL scripts, etc.

romainr commented 9 years ago

This is the standard for databases however, NULL is the only special case so should probably avoided as a string e.g.

mysql> select null as c1, 'NULL' as c2; +------+------+ | c1 | c2 | +------+------+ | NULL | NULL | +------+------+ 1 row in set (0.01 sec)

mkrcah commented 9 years ago

I understand and agree that "NULL" strings should be avoided. My use-case is that I have ETL/Sqoop scripts which incorrectly ingested null values as "NULL"strings. Having the null values displayed differently, would greatly help with debugging of those scripts.

romainr commented 9 years ago

This is more a Sqoop issue so, they should send the correct values? http://sqoop.apache.org/mail-lists.html

mkrcah commented 9 years ago

My use-case was that I needed to debug and tweak Sqoop parameters to ensure proper null values and I found it cumbersome to rely on select * from table where c is null all the time. However, this is not a big issue at all, just a nice-to-have to save a couple of key strokes.

romainr commented 9 years ago

Yes, see with them or maybe do something like "if(boolean testCondition, T valueTrue, T valueFalseOrNull)" to detect the real NULLs https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF