Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
pomadchin authored May 1, 2022
1 parent 2d0bec1 commit c23a75c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,26 @@ The full list of supported functions can be found [here](./spatial/sql/createUDF

## Spatial Query optimizations

There are two types of supported optimizations: `ST_Intersects` and `ST_Contains`, which help Spark to push down predicates when possible.

To enable optimizations:

```scala
import com.azavea.hiveless.spark.sql.rules.SpatialFilterPushdownRules

val spark: SparkSession = ???
SpatialFilterPushdownRules.registerOptimizations(sparkContext.sqlContext)
```

It is also possible to set it through the Spark configuration via the optimizations injector:

```scala
import com.azavea.hiveless.spark.sql.SpatialFilterPushdownOptimizations

val conf: SparkConfig = ???
config.set("spark.sql.extensions", classOf[SpatialFilterPushdownOptimizations].getName)
```

## License
Code is provided under the Apache 2.0 license available at http://opensource.org/licenses/Apache-2.0,
as well as in the LICENSE file. This is the same license used as Spark.

0 comments on commit c23a75c

Please sign in to comment.