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

gorsat.spark.GorPartitioning Maven / Gradle / Ivy

Go to download

GORpipe allows analysis of large sets of genomic and phenotypic tabular data using a declarative query language in a parallel execution engine

There is a newer version: 4.3.2
Show newest version
package gorsat.spark;

import org.apache.spark.sql.connector.read.partitioning.ClusteredDistribution;
import org.apache.spark.sql.connector.read.partitioning.Distribution;
import org.apache.spark.sql.connector.read.partitioning.Partitioning;

import java.util.Arrays;

public class GorPartitioning implements Partitioning {

    @Override
    public int numPartitions() {
        return 2;
    }

    @Override
    public boolean satisfy(Distribution distribution) {
        if (distribution instanceof ClusteredDistribution) {
            String[] clusteredCols = ((ClusteredDistribution) distribution).clusteredColumns;
            return Arrays.asList(clusteredCols).contains("i");
        }

        return false;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy