Sort 4 Discussions, By:
Please Login in order to post a comment
Kindly post the code snippet either in Java or Python.
Added the framework for Python
Can we get the Python code snippet fixed please?
def emitIntermediate(self, key, value):
The spacing is off.
i used Collections.sort() to sort my value array list in lex order, any better approach?
Any chance for including Hadoop framework??? :(
Not at this point unfortunately! Given the nature of infrastructure it requires, which is hard to simulate in our online editor.
It would be great if you could just include the support for Hadoop jar in java. Makes it easier to code.
When i paste the sample input into the custom input box, some how the "\t" separator is getting lost.
Because of this my input data parsing is not working.
How do I ensure that the "\t" separator in the input data is not lost ?
I had same issue and added this line
if name == 'main':
inputData = 
counter = 0
for line in sys.stdin:
counter += 1
charcount = 0
line.replace(' ','\t',2) #this line
state, city = line.strip().split("\t")
in python 2 and that resolved.
Hope that is helpful
It could be cuz of editor (sublime, atom, gedit etc) spacing while pasting input. I suggest, open input file in vi editor through terminal and erase spacing & provide tab in between state and cities/town.
No more comments