Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-36533][SS][FOLLOWUP] Support Trigger.AvailableNow in PySpark
### What changes were proposed in this pull request? This PR proposes to add Trigger.AvailableNow in PySpark on top of #33763. ### Why are the changes needed? We missed adding Trigger.AvailableNow in PySpark in #33763. ### Does this PR introduce _any_ user-facing change? Yes, Trigger.AvailableNow will be available in PySpark as well. ### How was this patch tested? Added simple validation in PySpark doc. Manually tested as below: ``` >>> spark.readStream.format("text").load("/WorkArea/ScalaProjects/spark-apache/dist/inputs").writeStream.format("console").trigger(once=True).start() <pyspark.sql.streaming.StreamingQuery object at 0x118dff6d0> ------------------------------------------- Batch: 0 ------------------------------------------- +-----+ |value| +-----+ | a| | b| | c| | d| | e| +-----+ >>> spark.readStream.format("text").load("/WorkArea/ScalaProjects/spark-apache/dist/inputs").writeStream.format("console").trigger(availableNow=True).start() <pyspark.sql.streaming.StreamingQuery object at 0x118dffe50> >>> ------------------------------------------- Batch: 0 ------------------------------------------- +-----+ |value| +-----+ | a| | b| | c| | d| | e| +-----+ >>> spark.readStream.format("text").option("maxfilespertrigger", "2").load("/WorkArea/ScalaProjects/spark-apache/dist/inputs").writeStream.format("console").trigger(availableNow=True).start() <pyspark.sql.streaming.StreamingQuery object at 0x118dff820> >>> ------------------------------------------- Batch: 0 ------------------------------------------- +-----+ |value| +-----+ | a| | b| +-----+ ------------------------------------------- Batch: 1 ------------------------------------------- +-----+ |value| +-----+ | c| | d| +-----+ ------------------------------------------- Batch: 2 ------------------------------------------- +-----+ |value| +-----+ | e| +-----+ >>> ``` Closes #34592 from HeartSaVioR/SPARK-36533-FOLLOWUP-pyspark. Authored-by: Jungtaek Lim <[email protected]> Signed-off-by: Jungtaek Lim <[email protected]>
- Loading branch information