Configuring the MapR-DB OJAI Connector for Apache Spark

The MapR-DB OJAI Connector for Apache Spark is supported on Spark 2.1.0 and later versions. Before using the connector, you must edit the pom.xml file for your project:

Add the Spark core dependency into the pom.xml file:

        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_2.11</artifactId>
            <version>2.1.0-mapr-1703</version>
        </dependency>

Add the Spark Maven dependency to the project's pom.xml file:

        <dependency>
            <groupId>com.mapr.db</groupId>
            <artifactId>maprdb-spark</artifactId>
            <version>5.2.1-mapr</version>
        </dependency>

To enable Maven to download dependencies, add the following repository information to the pom.xml file.This allows the application to locate MapR-specific JAR files located in the mapr-releases repository:

        <repository>
            <id>mapr-releases</id>
            <url>http://repository.mapr.com/maven/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
 	   </repository>