In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "what are the operation methods of hadoop compound type construction". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "what are the operation methods of hadoop compound type construction"?
1. Map type construction: map
Syntax: map (key1, value1, key2, value2, …)
Description: build the map type based on the input key and value pairs
For example:
Hive > Create table lxw_test as select map ('100th and 2000s) as t from lxw_dual
Hive > describe lxw_test
T map
Hive > select t from lxw_test
{"100,200": "tom", "200": "mary"}
2. Struct type construction: struct
Syntax: struct (val1, val2, val3, …)
Description: build the structure struct type according to the input parameters
For example:
Hive > create table lxw_test as select struct ('tom','mary','tim') as t from lxw_dual
Hive > describe lxw_test
T struct
Hive > select t from lxw_test
{"col1": "tom", "col2": "mary", "col3": "tim"}
3. Array type construction: array
Syntax: array (val1, val2, …)
Description: build an array array type based on the input parameters
For example:
Hive > create table lxw_test as selectarray ("tom", "mary", "tim") as t from lxw_dual
Hive > describe lxw_test
T array
Hive > select t from lxw_test
["tom", "mary", "tim"]
At this point, I believe you have a deeper understanding of "what are the operational methods for building hadoop composite types?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
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.