Reputation: 331
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.
Upvotes: 1
Views: 8011
Reputation: 4999
Text text = new Text("your-string");
or
Text text = new Text();
text.set("your-string");
Upvotes: 1
Reputation: 7804
Text class constructor has this provision. Click here.
OR
You can use Text.set(String) method..
Upvotes: 0