
com.marklogic.spark.writer.RowConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of marklogic-spark-connector Show documentation
Show all versions of marklogic-spark-connector Show documentation
Spark 3 connector for MarkLogic
The newest version!
/*
* Copyright © 2025 MarkLogic Corporation. All Rights Reserved.
*/
package com.marklogic.spark.writer;
import com.marklogic.spark.core.DocumentInputs;
import org.apache.spark.sql.catalyst.InternalRow;
import java.util.Iterator;
/**
* Strategy interface for how a Spark row is converted into a set of inputs for writing a document to MarkLogic.
*/
public interface RowConverter {
/**
* @param row
* @return an iterator of inputs for creating documents to write to MarkLogic. An iterator is used to allow the
* implementor to return multiple documents if necessary.
*/
Iterator convertRow(InternalRow row);
/**
* Called when {@code WriteBatcherDataWriter} has no more rows to send, but the implementation may have one or
* more documents that haven't been returned yet via {@code convertRow}.
*
* @return
*/
Iterator getRemainingDocumentInputs();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy