Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
Update 01-ug-quick-start-guide.md
Browse files Browse the repository at this point in the history
  • Loading branch information
paryoja authored Nov 4, 2021
1 parent 661df17 commit fcdff6b
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions docs/_docs/01-ug-quick-start-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,44 @@ hs.explain(query, verbose = True)
#### Enable Hyperspace

Now that you have created an index that your query can utilize, you can enable Hyperspace and execute your query:
There is two ways of enabling Hyperspace.

1. Using Hyperspace extension.

You can start a session with Hyperspace extension.
The follows are examples to use Spark™ with Hyperspace.

Spark-submit:
```
spark-submit -c spark.sql.extensions=com.microsoft.hyperspace.HyperspaceSparkSessionExtension ...
```

Scala:
```scala
val spark = SparkSession
.builder()
.appName("...")
.master("...")
.config("spark.sql.extensions", "com.microsoft.hyperspace.HyperspaceSparkSessionExtension")
.getOrCreate()
```

Python:
```python
from pyspark.sql import SparkSession

spark = SparkSession \
.builder \
.appName("...") \
.master("...") \
.config("spark.sql.extensions", "com.microsoft.hyperspace.HyperspaceSparkSessionExtension") \
.getOrCreate()
```


2. Calling enableHyperspace function explicitly.

By explicitly calling enableHyperspace (for scala) or Hyperspace.enable (for python), Spark will use Hyperspace indexes when it is applicable.

Scala:
```scala
Expand Down

0 comments on commit fcdff6b

Please sign in to comment.