acezen commented on code in PR #448:
URL: https://github.com/apache/incubator-graphar/pull/448#discussion_r1560609249
##########
docs/libraries/pyspark/how-to.md:
##########
@@ -0,0 +1,212 @@
+---
+id: how-to
+title: How to use GraphAr PySpark package
+sidebar_position: 1
+---
+
+
+## GraphAr PySpark
+
+``graphar_pyspark`` is implemented as bindings to GraphAr spark scala
+library. You should have ``graphar-0.1.0-SNAPSHOT.jar`` in your
+Apache Spark JVM classpath. Otherwise you will get an exception. To
+add it spceify ``config("spark.jars", "path-to-graphar-jar")`` when
+you create a SparkSession:
+
+```python
+from pyspark.sql import SparkSession
+
+spark = (
+ SparkSession
+ .builder
+ .master("local[1]")
+ .appName("graphar-local-tests")
+ .config("spark.jars", "../../spark/target/graphar-0.1.0-SNAPSHOT.jar")
+ .config("spark.log.level", "INFO")
+ .getOrCreate()
+)
+```
+
+
+ .. rubric:: GraphAr PySpark initialize
+ :name: graphar-pyspark-initialize
+
+## GraphAr PySpark initialize
+
+PySpark bindings are heavily relying on JVM-calls via ``py4j``. To
+initiate all the neccessary things for it just call
+``graphar_pyspark.initialize()``:
+
+```python
+from graphar_pyspark import initialize
+
+initialize(spark)
+```
+
+## GraphAr objects
+
+Now you can import, create and modify all the classes you can work
+call from [scala API of
GraphAr](https://graphar.apache.org/docs/libraries/spark).
+For simplify using of graphar from python constants, like GAR-types,
+supported file-types, etc. are placed in ``graphar_pyspark.enums``.
+
+```python
+from graphar_pyspark.info import Property, PropertyGroup, AdjList,
AdjListType, VertexInfo, EdgeInfo, GraphInfo
+from graphar_pyspark.enums import GarType, FileType
+```
+
+Main objects of GraphAr are the following:
+
+- GraphInfo
+- VertexInfo
+- EdgeInfo
+
+You can check [Scala library
documentation](https://graphar.apache.org/docs/spark#information-classes)
Review Comment:
yes, we can replace with relative path
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]