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

com.marklogic.spark.reader.document.DocumentScan 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.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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy