Introduction to Hive Transform functions

Source: Internet
Author: User

Hive provides the ability to customize mapper and reducer through scripting, which requires the use of transform functions.

By default, the parameters that are included in the transform function are separated by the ' \ T ' and passed in the user script as a string pair. The NULL value in the input is converted to the string ' \ n '. The script's output uses a delimiter that is also ' \ t ', and ' \ n ' is converted to NULL again. It is important to note that when the transform parameter contains ' \ t ', the user needs to manually process these ' \ t ' to avoid errors in the script. Here is a sample using:

 from   (   Pv_users TRANSFORM (Pv_users.userid, pv_users.date) USING   '  map_script   '   reduce_script   '  

The output of ' map_script ' is separated using ' \ t ', corresponding to the DT and UID two fields. By default, if a type is not specified, it is considered to be of type string by default.

This enables the functionality of the UDF through scripting (shell, Python, and so on).

Introduction to Hive Transform functions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.