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 > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "Hive how to import text files such as txt and csv into the hive table". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how Hive imports text files such as txt and csv into the hive table".
1. Place the txt text file in the hdfs directory
2. Log in to hive and enter the specified database 3. Create the table create external table if not exists fun_user_external (tid INT, userid STRING, pwd STRING, create_time BIGINT, email STRING...) ROW FORMAT DELIMITED FIELDS TERMINATED BY''STORED AS TEXTFILE 1 2 3 4 5 6 7 8
The main part of the table sentence is the last part: ROW FORMAT DELIMITED FIELDS TERMINATED BY''STORED AS TEXTFILE
4. Execute the import statement load data inpath'/ tmp/fun_user.txt' into table fun_user_external; 1 load data local inpath'/ tmp/fun_user.txt' into table fun_user_external; 1
In the above two data import statements, if there is the keyword local, the path should be the local file system path, and the data will be copied to the target location; if the local keyword is omitted, then the path should be the path in the distributed file system, in which case the data will be transferred from this path to the destination location.
Thank you for your reading, these are the contents of "how Hive imports text files such as txt and csv into hive table". After the study of this article, I believe you have a deeper understanding of how Hive imports text files such as txt and csv into hive table, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
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.