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

apoc.export.parquet.ParquetConfig Maven / Gradle / Ivy

package apoc.export.parquet;

import apoc.util.MissingDependencyException;
import apoc.util.Util;

import java.util.Collections;
import java.util.Map;

public class ParquetConfig {
    public static final String PARQUET_MISSING_DEPS_ERROR = """
        Cannot find the Hadoop jar (required by Parquet procedures).
        Please put the apoc-hadoop-dependencies-5.x.x-all.jar into plugin folder.
        See the documentation: https://neo4j.com/labs/apoc/5/export/parquet/#_library_requirements""";

    private final int batchSize;

    private final Map config;
    private final Map mapping;

    public ParquetConfig(Map config) {
        if (!Util.classExists("org.apache.parquet.schema.MessageType")) {
            throw new MissingDependencyException(PARQUET_MISSING_DEPS_ERROR);
        }
        
        this.config = config == null ? Collections.emptyMap() : config;
        this.batchSize = Util.toInteger(this.config.getOrDefault("batchSize", 20000));
        this.mapping = (Map) this.config.getOrDefault("mapping", Map.of());
    }

    public int getBatchSize() {
        return batchSize;
    }

    public Map getConfig() {
        return config;
    }

    public Map getMapping() {
        return mapping;
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy