All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.datastax.data.exploration.biz.datatable.column.NomialColumn Maven / Gradle / Ivy

The newest version!
package com.datastax.data.exploration.biz.datatable.column;

import com.datastax.data.exploration.biz.datatable.DataType;

import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * 二项式/多项式属性列
 */
public abstract class NomialColumn extends DataColumn  {

    NomialColumn(String columnName, DataType dataType) {
        super(columnName, dataType);
    }

    @Override
    String transferValue(String str) {
        return str;
    }

    @Override
    void flush() {
        //
    }

    public Map aggCount() {
        return this.getNotNullValues().stream().collect(Collectors.groupingBy(s -> s, Collectors.counting()));
    }

    public List distinct() {
        return this.getNotNullValues().stream().distinct().sorted().collect(Collectors.toList());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy