# YugaByte Spark Connector now supports query locality with Apache Spark

**URL:** https://forum.yugabyte.com/t/yugabyte-spark-connector-now-supports-query-locality-with-apache-spark/107
**Category:** General
**Created:** [January 12, 2018, 1:16am UTC](https://forum.yugabyte.com/t/yugabyte-spark-connector-now-supports-query-locality-with-apache-spark/107 "2018-01-12T01:16:33Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mihnea](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/mihnea/32/81_2.png) [@mihnea](https://forum.yugabyte.com/u/mihnea)
#### Post date: [January 12, 2018, 1:16am UTC](https://forum.yugabyte.com/t/yugabyte-spark-connector-now-supports-query-locality-with-apache-spark/107/1 "2018-01-12T01:16:33Z")

</div>

A few weeks ago we [announced](https://forum.yugabyte.com/t/apache-spark-real-time-analytics-with-yugabyte/102) support for running Apache Spark on top of YugaByte using the Apache Cassandra API.

Today, we are excited to announce support for query locality with Apache Spark using our [YugaByte fork of the Spark Cassandra Connector](https://github.com/yugabyte/spark-cassandra-connector). You can find the deployed packages [here](https://mvnrepository.com/artifact/com.yugabyte.spark).

Our fork ensures that the Spark partitions are based on the internal sharding of YugaByte tables and that Spark queries are efficiently routed to the right YugaByte node (read more about YugaByte data sharding in our [docs](https://docs.yugabyte.com/preview/explore/linear-scalability/sharding-rebalancing/)).

To give it a try, update the package configuration for your existing YugaByte-based application:  
**Java/Maven:**  
Add the following snippet to your `pom.xml`

```auto
<dependency>
<groupId>com.yugabyte.spark</groupId>
 <artifactId>spark-cassandra-connector_2.10</artifactId>
 <version>2.0.5-yb-1</version>
</dependency>

```

**Scala/sbt:**  
Add the following library dependency to your project configuration:

```auto
libraryDependencies += "com.yugabyte.spark" %% "spark-cassandra-connector" % "2.0.5-yb-1"

```

**Python:**  
Start [PySpark](https://spark.apache.org/docs/0.9.0/python-programming-guide.html) with:

```auto
$ pyspark --packages com.yugabyte.spark:spark-cassandra-connector_2.10:2.0.5-yb-1

```

If you don’t have an existing app, you can get started quickly by [installing YugaByte](https://docs.yugabyte.com/quick-start/install/) and trying out our [Spark sample apps](https://docs.yugabyte.com/preview/integrations/apache-spark/).

---

<div class="post-metadata">

### Author: ![dorian\_yugabyte](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.yugabyte.com/dorian_yugabyte/32/206_2.png) [@dorian\_yugabyte](https://forum.yugabyte.com/u/dorian_yugabyte)
#### Post date: [March 8, 2023, 9:13am UTC](https://forum.yugabyte.com/t/yugabyte-spark-connector-now-supports-query-locality-with-apache-spark/107/2 "2023-03-08T09:13:41Z")

</div>


