com.marklogic.spark.reader.document.DocumentScan 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
/*
* Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
*/
package com.marklogic.spark.reader.document;
import org.apache.spark.sql.connector.read.Batch;
import org.apache.spark.sql.connector.read.Scan;
import org.apache.spark.sql.types.StructType;
class DocumentScan implements Scan {
private final DocumentBatch batch;
private final DocumentContext context;
DocumentScan(DocumentContext context) {
this.context = context;
this.batch = new DocumentBatch(context);
}
@Override
public StructType readSchema() {
return context.getSchema();
}
@Override
public Batch toBatch() {
return this.batch;
}
}