lamber-ken commented on a change in pull request #1526: [HUDI-1526] Add pyspark
example in quickstart
URL: https://github.com/apache/incubator-hudi/pull/1526#discussion_r410501516
##########
File path: docs/_docs/1_1_quick_start_guide.md
##########
@@ -148,6 +203,31 @@
tripsIncrementalDF.createOrReplaceTempView("hudi_trips_incremental")
spark.sql("select `_hoodie_commit_time`, fare, begin_lon, begin_lat, ts from
hudi_trips_incremental where fare > 20.0").show()
```
+{% highlight python %}
+# reload data
+spark. \
+ read. \
+ format("hudi"). \
+ load(basePath + "/*/*/*/*"). \
+ createOrReplaceTempView("hudi_trips_snapshot")
+
+commits = list(map(lambda row: row[0], spark.sql("select
distinct(_hoodie_commit_time) as commitTime from hudi_trips_snapshot order by
commitTime").limit(50).collect()))
+beginTime = commits[len(commits) - 2] # commit time we are interested in
+
+# incrementally query data
+incremental_read_options = {
+'hoodie.datasource.query.type': 'incremental',
+'hoodie.datasource.read.begin.instanttime': 'beginTime',
Review comment:
Add two spaces before each line
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services