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

io.deephaven.engine.table.impl.by.NullColumnAggregationTransformer Maven / Gradle / Ivy

There is a newer version: 0.37.1
Show newest version
/**
 * Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending
 */
package io.deephaven.engine.table.impl.by;

import io.deephaven.engine.table.ColumnSource;
import io.deephaven.engine.table.impl.sources.NullValueColumnSource;
import org.jetbrains.annotations.NotNull;

import java.util.LinkedHashMap;
import java.util.Map;

class NullColumnAggregationTransformer implements AggregationContextTransformer {

    private final Map> resultColumnTypes;

    NullColumnAggregationTransformer(@NotNull final Map> resultColumnTypes) {
        this.resultColumnTypes = resultColumnTypes;
    }

    @Override
    public void resultColumnFixup(@NotNull final Map> resultColumns) {
        final Map> savedColumns = new LinkedHashMap<>(resultColumns);
        resultColumns.clear();
        resultColumnTypes
                .forEach((key, value) -> resultColumns.put(key, NullValueColumnSource.getInstance(value, null)));
        resultColumns.putAll(savedColumns);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy