Webhook example
This example writes the results of a query to a webhook table. Create the webhook table first, then run the INSERT statement.
Create a webhook table named my_webhook_sink, as described in Creating a
webhook sink. Use this request template:
{
"transactionId": "${transactionId}",
"ts": "${ts}",
"accountId": "${accountId}",
"amount": "${amount}"
}
Each placeholder is a STRING column. Cast the values in the query.
Write to the table:
INSERT INTO my_webhook_sink
SELECT
CAST(transactionId AS STRING),
CAST(ts AS STRING),
CAST(accountId AS STRING),
CAST(amount * 3 AS STRING)
FROM my_source_table
WHERE amount % 2 != 0;
The query sends one request for every row of my_source_table with an odd
amount.
To check the output of this job, look at the job status and the logs, or read the receiving system. For more information, see Viewing logs for Cloudera Streaming Analytics.
