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

com.marklogic.spark.reader.optic.OpticPartitionReaderFactory 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.optic;

import org.apache.spark.sql.catalyst.InternalRow;
import org.apache.spark.sql.connector.read.InputPartition;
import org.apache.spark.sql.connector.read.PartitionReader;
import org.apache.spark.sql.connector.read.PartitionReaderFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

class OpticPartitionReaderFactory implements PartitionReaderFactory {

    static final long serialVersionUID = 1;

    private static final Logger logger = LoggerFactory.getLogger(OpticPartitionReaderFactory.class);
    private final OpticReadContext opticReadContext;

    OpticPartitionReaderFactory(OpticReadContext opticReadContext) {
        this.opticReadContext = opticReadContext;
    }

    @Override
    public PartitionReader createReader(InputPartition partition) {
        if (logger.isDebugEnabled()) {
            logger.debug("Creating reader for partition: {}", partition);
        }
        return new OpticPartitionReader(this.opticReadContext, (PlanAnalysis.Partition) partition);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy