<commit_before>package es.tid.bdp.kpicalculation.export.mongodb;

import java.io.IOException;

import java.util.ArrayList;
import java.util.List;

import com.mongodb.hadoop.io.BSONWritable;
import java.util.Arrays;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
import org.bson.BSONObject;
import org.bson.BasicBSONObject;

/**
 *
 * @author dmicol, sortega
 */
public class MongoDBExporterReducer extends Reducer<LongWritable, Text,
        NullWritable, BSONWritable> {
    @Override
    public void reduce(LongWritable key, Iterable<Text> values,
                       Context context) throws IOException,
                                               InterruptedException {
        for (Text value : values) {
            List<String> columns = new ArrayList<String>();<commit_msg>Fix import sort order in MongoDBExporterReducer.<commit_after>package es.tid.bdp.kpicalculation.export.mongodb;

import java.io.IOException;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;

import com.mongodb.hadoop.io.BSONWritable;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
import org.bson.BSONObject;
import org.bson.BasicBSONObject;

/**
 *
 * @author dmicol, sortega
 */
public class MongoDBExporterReducer extends Reducer<LongWritable, Text,
        NullWritable, BSONWritable> {
    @Override
    public void reduce(LongWritable key, Iterable<Text> values,
                       Context context) throws IOException,
                                               InterruptedException {
        for (Text value : values) {
            List<String> columns = new ArrayList<String>();
{'fraction_non_alphanumeric': 0.09739583333333333, 'fraction_numerical': 0.0, 'mean_word_length': 3.2879464285714284, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1095851', 'n_tokens_mistral': 576, 'n_tokens_neox': 557, 'n_words': 118}