简体   繁体   中英

Converting a String object to TEXT object in hadoop

How do I convert a String object to a Text object in hadoop without using a constructor? There is a Text to String method available, but I couldn't find a String to Text method.

Text text = new Text("your-string");

or

Text text = new Text();
text.set("your-string");

Text class constructor has this provision. Click here .

OR

You can use Text.set(String) method..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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