def _spark_reduce_value_chunk(chunk_a, chunk_b):
    """
    Reducer for values computation for chunks

    :param chunk_a: First chunk to reduce
    :type chunk_a: dict

    :param chunk_b: Second chunk to reduce
    :type chunk_a: dict

    :return: a dict composed of the aggregated basic information of the previous chunks
    :rtype: dict
    """

    if chunk_a is None:
        if chunk_b is None:
            # Both chunks are empty, skip it
            return None
        else:
            # Chunk b is the only one filled, use it
            return chunk_b
    else:
        if chunk_b is None:
            # Chunk a is the only one filled, use it
            return chunk_a

    return {
        "count": chunk_a['count'] + chunk_b['count'],
        "max": max(chunk_a['max'], chunk_b['max']),
        "min": min(chunk_a['min'], chunk_b['min']),
        "sum": chunk_a['sum'] + chunk_b['sum'],
        "sqr_sum": chunk_a['sqr_sum'] + chunk_b['sqr_sum'],
    }