简体   繁体   English

hive 中没有显示 String NULL 数据的结果

[英]No results showing for String NULL data in hive

I have an external table in hive which was loaded with some NULL data.我在 hive 中有一个外部表,其中加载了一些 NULL 数据。

None of the below queries are returning any results:以下查询均未返回任何结果:

select * FROM  db.table where bankrupt IS NULL;

select * FROM  db.table where bankrupt = '';

select * FROM  db.table where bankrupt = ' ';

But select DISTINCT length(bankrupt) FROM db.table;但是select DISTINCT length(bankrupt) FROM db.table; Is returning value 1.正在返回值 1。

Sample data: (provided by client) 295.12|31/12/2021| | |样本数据:(客户提供) 295.12|31/12/2021| | | 295.12|31/12/2021| | |

Bankrupt is the last column.破产是最后一栏。

select DISTINCT length(bankrupt) FROM  db.table;

If what you said is true, and this row returns only 1 value, it means that either you only have only one single defined value.如果你说的是真的,并且这一行只返回 1 个值,这意味着要么你只有一个定义的值。 Or you only have null values, neitherless.或者你只有空值,也没有。 If you are sure there is null values, maybe is just a tiny syntax inconvenience.如果您确定存在空值,则可能只是语法上的一点不便。 Because your line of code is correct因为你的代码行是正确的

SELECT * FROM DF WHERE bankrupt IS NULL;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM