In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you how to achieve null value and NULL judgment in hive. I hope you will get something after reading this article. Let's discuss it together.
There are basically two kinds of null value judgment in hive.
(1) NULL and\ N
How hive stores and identifies NULL in the underlying data is controlled by alter table name SET SERDEPROPERTIES ('serialization.null.format' ='\ N'); parameters
For example:
1. Set alter table name SET SERDEPROPERTIES ('serialization.null.format' ='\ N')
Then: the underlying data is saved as'\ NULL', and displayed by query.
At this time, if you query a field with a null value, you can use the statement: an is null or await'\\ N'.
two。 Set alter tablename SET SERDEPROPERTIES ('serialization.null.format' =' NULL')
Then: the underlying data saves' NULL', 'and shows' NULL' 'through query.
At this time, if you query a field with a null value, you can use the statement: an is null or null'.
(2)''and length (xx) = 0
'' indicates that the field is not null and is an empty string. This value cannot be queried with an is null at this time. It must be queried through a query'or length (a) = 0, which does not mean that it is possible to use an empty string'.
After reading this article, I believe you have a certain understanding of "how to achieve null value and NULL judgment in hive". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.