{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/21571","repository_url":"https://api.github.com/repos/apache/spark","labels_url":"https://api.github.com/repos/apache/spark/issues/21571/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/21571/comments","events_url":"https://api.github.com/repos/apache/spark/issues/21571/events","html_url":"https://github.com/apache/spark/pull/21571","id":332594191,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1MDQwODI4","number":21571,"title":"[SPARK-24565][SS] Add API for in Structured Streaming for exposing output rows of each microbatch as a DataFrame","user":{"login":"tdas","id":663212,"node_id":"MDQ6VXNlcjY2MzIxMg==","avatar_url":"https://avatars1.githubusercontent.com/u/663212?v=4","gravatar_id":"","url":"https://api.github.com/users/tdas","html_url":"https://github.com/tdas","followers_url":"https://api.github.com/users/tdas/followers","following_url":"https://api.github.com/users/tdas/following{/other_user}","gists_url":"https://api.github.com/users/tdas/gists{/gist_id}","starred_url":"https://api.github.com/users/tdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdas/subscriptions","organizations_url":"https://api.github.com/users/tdas/orgs","repos_url":"https://api.github.com/users/tdas/repos","events_url":"https://api.github.com/users/tdas/events{/privacy}","received_events_url":"https://api.github.com/users/tdas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-06-14T23:06:04Z","updated_at":"2018-06-15T21:08:19Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/21571","html_url":"https://github.com/apache/spark/pull/21571","diff_url":"https://github.com/apache/spark/pull/21571.diff","patch_url":"https://github.com/apache/spark/pull/21571.patch"},"body":"## What changes were proposed in this pull request?\r\n\r\nCurrently, the micro-batches in the MicroBatchExecution is not exposed to the user through any public API. This was because we did not want to expose the micro-batches, so that all the APIs we expose, we can eventually support them in the Continuous engine. But now that we have better sense of buiding a ContinuousExecution, I am considering adding APIs which will run only the MicroBatchExecution. I have quite a few use cases where exposing the microbatch output as a dataframe is useful. \r\n- Pass the output rows of each batch to a library that is designed only the batch jobs (example, uses many ML libraries need to collect() while learning).\r\n- Reuse batch data sources for output whose streaming version does not exists (e.g. redshift data source).\r\n- Writer the output rows to multiple places by writing twice for each batch. This is not the most elegant thing to do for multiple-output streaming queries but is likely to be better than running two streaming queries processing the same data twice.\r\n\r\nThe proposal is to add a method `foreachBatch(f: Dataset[T] => Unit)` to Scala/Java/Python `DataStreamWriter`.\r\n\r\n## How was this patch tested?\r\nNew unit tests.\r\n"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/397742808","html_url":"https://github.com/apache/spark/pull/21571#issuecomment-397742808","issue_url":"https://api.github.com/repos/apache/spark/issues/21571","id":397742808,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Nzc0MjgwOA==","user":{"login":"SparkQA","id":8108735,"node_id":"MDQ6VXNlcjgxMDg3MzU=","avatar_url":"https://avatars1.githubusercontent.com/u/8108735?v=4","gravatar_id":"","url":"https://api.github.com/users/SparkQA","html_url":"https://github.com/SparkQA","followers_url":"https://api.github.com/users/SparkQA/followers","following_url":"https://api.github.com/users/SparkQA/following{/other_user}","gists_url":"https://api.github.com/users/SparkQA/gists{/gist_id}","starred_url":"https://api.github.com/users/SparkQA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SparkQA/subscriptions","organizations_url":"https://api.github.com/users/SparkQA/orgs","repos_url":"https://api.github.com/users/SparkQA/repos","events_url":"https://api.github.com/users/SparkQA/events{/privacy}","received_events_url":"https://api.github.com/users/SparkQA/received_events","type":"User","site_admin":false},"created_at":"2018-06-15T21:08:19Z","updated_at":"2018-06-15T21:08:19Z","author_association":"NONE","body":"**[Test build #91940 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/91940/testReport)** for PR 21571 at commit [`0763a44`](https://github.com/apache/spark/commit/0763a44ff24de9ad2285c82954e6f8670f9cbc9b)."}}
{"actor":{"display_login":"SparkQA"}}