featzhang created FLINK-39361:
---------------------------------
Summary: [connector-http] Add Quick Start section to Table/SQL
HTTP connector documentation
Key: FLINK-39361
URL: https://issues.apache.org/jira/browse/FLINK-39361
Project: Flink
Issue Type: New Feature
Components: Connectors / HTTP
Reporter: featzhang
h2. Motivation
The Table/SQL HTTP connector documentation currently jumps straight into
detailed
configuration options without any introductory examples. New users have no
quick
reference for the most common usage patterns.
h2. Changes
* Add a *Quick Start* section to
{{docs/content/docs/connectors/table/http.md}} with:
** SQL example for HTTP Sink ({{CREATE TABLE}} + {{INSERT INTO}})
** SQL example for HTTP Lookup Source (temporal join pattern)
** DataStream API (Java) example for {{HttpSink}}
* Add a *Quick Start* section (Chinese) to
{{docs/content.zh/docs/connectors/table/http.md}}:
** SQL example for HTTP Sink
** SQL example for HTTP Lookup Source
* Add {{Quick Start}} entry to the Table of Contents in both files
h2. Examples
h3. HTTP Sink
{code:sql}
CREATE TABLE http_sink (
id BIGINT,
name STRING,
status STRING
) WITH (
'connector' = 'http-sink',
'url' = 'https://api.example.com/events',
'format' = 'json',
'insert-method' = 'POST'
);
INSERT INTO http_sink SELECT id, name, status FROM source_table;
{code}
h3. HTTP Lookup Source
{code:sql}
CREATE TABLE http_lookup (
id STRING,
payload STRING
) WITH (
'connector' = 'http',
'url' = 'https://api.example.com/data',
'format' = 'json'
);
SELECT s.event_id, h.payload
FROM stream_table AS s
JOIN http_lookup FOR SYSTEM_TIME AS OF s.proc_time AS h
ON s.event_id = h.id;
{code}
h2. Verifying this change
This is a documentation-only change.
* SQL connector name {{'connector' = 'http'}} verified against
{{HttpLookupTableSourceFactory.IDENTIFIER = "http"}}
* SQL connector name {{'connector' = 'http-sink'}} consistent with existing
documentation in the same file
* No code changes, no test changes required
--
This message was sent by Atlassian Jira
(v8.20.10#820010)