jiayuasu opened a new pull request, #848:
URL: https://github.com/apache/sedona/pull/848

   
   ## Did you read the Contributor Guide?
   
   - Yes, I have read [Contributor 
Rules](https://sedona.apache.org/latest-snapshot/community/rule/) and 
[Contributor Development 
Guide](https://sedona.apache.org/latest-snapshot/community/develop/)
   
   ## Is this PR related to a JIRA ticket?
   
   - Yes, the URL of the associated JIRA ticket is 
https://issues.apache.org/jira/browse/SEDONA-287. The PR name follows the 
format `[SEDONA-287] my subject`.
   
   ## What changes were proposed in this PR?
   
   Introduce a new entry point called SedonaContext to unify all Sedona entry 
points in different compute engines and deprecate old Sedona register entry 
points. Note that: this does not affect any existing Sedona users to upgrade to 
the new version. We can remove the deprecated entry pointss after several major 
releases.
   
   ### Sedona Spark
   
   #### Scala
   
   ```
   import org.apache.sedona.spark.SedonaContext
   
   val sedona = 
SedonaContext.create(SedonaContext.config().master("local[*]").getOrCreate())
   
   sedona.sql("SELECT ST_GeomFromWKT(XXX) FROM")
   ```
   
   #### Python
   
   ```
   from sedona.spark import *
   
   config = SedonaContext.config() .\
       config('spark.jars.packages',
              'org.apache.sedona:sedona-spark-shaded-3.0_2.12:1.4.1,'
              'org.datasyslab:geotools-wrapper:1.4.0-28.2'). \
       getOrCreate()
   
   sedona = SedonaContext.create(config)
   
   sedona.sql("SELECT ST_GeomFromWKT(XXX) FROM")
   ```
   ### Sedona Flink
   
   ```
   import org.apache.sedona.flink.SedonaContext
   
   StreamTableEnvironment sedona = SedonaContext.create(env, tableEnv);
   
   sedona.sqlQuery("SELECT ST_GeomFromWKT(XXX) FROM")
   ```
   ## How was this patch tested?
   
   Passed existing unit tests
   
   ## Did this PR include necessary documentation updates?
   
   - Yes, I am adding a new API. I am using the [current SNAPSHOT version 
number](https://github.com/apache/sedona/blob/master/pom.xml#L29) in since 
`vX.Y.Z` format.
   


-- 
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]

Reply via email to