I am trying to the wordcount example and I wanted to print the name of the files where the word was found. But I dont know as how to get the name of the input split in map function of accumulo
Asked
Active
Viewed 56 times
1 Answers
1
Use the following command in the map function of your code:
context is the variable of the class Context defined in the arguments of your map function:
FileSplit fileSplit = (FileSplit)context.getInputSplit();
String filename = fileSplit.getPath().getName();
For more info: More info

Community
- 1
- 1

letsBeePolite
- 2,183
- 1
- 22
- 37