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

com.marklogic.spark.writer.file.DocumentFileWriteBuilder Maven / Gradle / Ivy

There is a newer version: 2.4.2
Show newest version
/*
 * Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
 */
package com.marklogic.spark.writer.file;

import org.apache.spark.sql.connector.write.BatchWrite;
import org.apache.spark.sql.connector.write.Write;
import org.apache.spark.sql.connector.write.WriteBuilder;
import org.apache.spark.sql.types.StructType;

import java.util.Map;

public class DocumentFileWriteBuilder implements WriteBuilder {

    private final Map properties;
    private final StructType schema;

    public DocumentFileWriteBuilder(Map properties, StructType schema) {
        this.properties = properties;
        this.schema = schema;
    }

    @Override
    public Write build() {
        return new Write() {
            @Override
            public BatchWrite toBatch() {
                return new DocumentFileBatch(properties, schema);
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy