Skip to content

[SPARK-17631] [SQL] Add HttpStreamSink for structured streaming. - #15197

Closed
zhangxinyu1 wants to merge 3 commits into
apache:masterfrom
zhangxinyu1:feature-http-stream-sink-for-structured-streaming
Closed

[SPARK-17631] [SQL] Add HttpStreamSink for structured streaming. #15197
zhangxinyu1 wants to merge 3 commits into
apache:masterfrom
zhangxinyu1:feature-http-stream-sink-for-structured-streaming

Conversation

@zhangxinyu1

@zhangxinyu1zhangxinyu1 commented Sep 22, 2016

Copy link
Copy Markdown

What changes were proposed in this pull request?

Add a class HttpStreamSink for structured streaming. This class extends StreamSinkProvider and DataSourceRegister. Streaming query results can be sinked to http server if we configure DataStreamWrite with .format("http").option("url", yourHttpUrl).
e.g.

val query = counts.writeStream
.outputMode("append")
.format("http")
.option("url", "yourHttpUrl")
.start()

How was this patch tested?

Use HttpStreamSinkSuite to test

@AmplabJenkins

Copy link
Copy Markdown

Can one of the admins verify this patch?

@zhangxinyu1

Copy link
Copy Markdown
Author

@marmbrus
I propose this feature mainly because we require output streaming query results via http api. One of use cases is real-time alarm. It's essential to send alarm messages in real time via Http Api, when we use structured streaming to analyze logs and find some Exceptions in logs.
What do you think about it?

@zhangxinyu1zhangxinyu1 changed the title [SPARK-17631] [SQL] Add HttpStreamSink for structured streaming. Streaming query results can be sinked to http server [SPARK-17631] [SQL] Add HttpStreamSink for structured streaming. Sep 22, 2016
@marmbrus

Copy link
Copy Markdown
Contributor

Thanks for working on this, it does seem like it could be useful. I'm not sure if this should go into Spark or into a separate package. It really depends on how many people want this feature.

Regardless, a few high level comments on this PR:

  • Check out the contributing to Spark guide. Patches need to have tests and follow the style guide.
  • I would not define a new HttpDataFormat interface. Instead I would mandate that the input is a single string column (similar to what we do for df.write.text). Users can use all of the existing DataFrame/Dataset operations to convert their data into a string.
  • It would be good to write up a short design on JIRA and debate there. A few things that I can think of off the top of my head:
    • should we support https too?
    • do we need to set any headers (i.e. maybe the batch id?)
  • We'd also need to add docs for this feature.

zhangxinyu1 added 2 commits September 26, 2016 18:54
@zhangxinyu1

zhangxinyu1 commented Sep 26, 2016

Copy link
Copy Markdown
Author

@marmbrus
Thanks for all your sugguestion! I have done the following things:

  • Write a short design on JIRA
  • I replace HttpDataFormat with the input which only has one string column. I like this idea very much! thanks again.
  • Complete HttpStreamSinkSuite to test. It's my first time to write this, could you please help me test it?

@maropumaropu mentioned this pull request Apr 23, 2017
peter-toth pushed a commit to peter-toth/spark that referenced this pull request Oct 6, 2018
This pr proposed to close stale PRs. Currently, we have 400+ open PRs and there are some stale PRs whose JIRA tickets have been already closed and whose JIRA tickets does not exist (also, they seem not to be minor issues).
// Open PRs whose JIRA tickets have been already closed
Closesapache#11785Closesapache#13027Closesapache#13614Closesapache#13761Closesapache#15197Closesapache#14006Closesapache#12576Closesapache#15447Closesapache#13259Closesapache#15616Closesapache#14473Closesapache#16638Closesapache#16146Closesapache#17269Closesapache#17313Closesapache#17418Closesapache#17485Closesapache#17551Closesapache#17463Closesapache#17625
// Open PRs whose JIRA tickets does not exist and they are not minor issues
Closesapache#10739Closesapache#15193Closesapache#15344Closesapache#14804Closesapache#16993Closesapache#17040Closesapache#15180Closesapache#17238
N/A
Author: Takeshi Yamamuro <yamamuro@apache.org>
Closesapache#17734 from maropu/resolved_pr.
Change-Id: Id2e590aa7283fe5ac01424d30a40df06da6098b5
zifeif2 pushed a commit to zifeif2/spark that referenced this pull request Nov 22, 2025
## What changes were proposed in this pull request?
This pr proposed to close stale PRs. Currently, we have 400+ open PRs and there are some stale PRs whose JIRA tickets have been already closed and whose JIRA tickets does not exist (also, they seem not to be minor issues).
// Open PRs whose JIRA tickets have been already closed
Closesapache#11785Closesapache#13027Closesapache#13614Closesapache#13761Closesapache#15197Closesapache#14006Closesapache#12576Closesapache#15447Closesapache#13259Closesapache#15616Closesapache#14473Closesapache#16638Closesapache#16146Closesapache#17269Closesapache#17313Closesapache#17418Closesapache#17485Closesapache#17551Closesapache#17463Closesapache#17625
// Open PRs whose JIRA tickets does not exist and they are not minor issues
Closesapache#10739Closesapache#15193Closesapache#15344Closesapache#14804Closesapache#16993Closesapache#17040Closesapache#15180Closesapache#17238
## How was this patch tested?
N/A
Author: Takeshi Yamamuro <yamamuro@apache.org>
Closesapache#17734 from maropu/resolved_pr.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@zhangxinyu1@AmplabJenkins@marmbrus