spark sow_delete
The sow_delete command is used to remove records from the SOW topic in AMPS. If a filter is specified, only messages which match the filter will be removed. If a file is provided, the command reads messages from the file and sends those messages to AMPS. AMPS will delete the matching messages from the SOW. If no filter or file is specified, the command reads messages from standard input (one per line) and sends those messages to AMPS for deletion.
It can be useful to test a filter by first using the desired filter in a sow command and making sure the records returned match what is expected. If that is successful, then it is safe to use the filter for a sow_delete. Once records are deleted from the SOW, they are not recoverable.
Common Options - spark sow_delete
| Option | Definition |
|---|---|
| AMPS server to connect to. |
| Topic to delete records from. |
file | File from which to read messages to be deleted. |
filter | Content filter to use. Notice that a filter of |
proto | Protocol to use. In this release, AMPS spark CLI supports Defaults to |
| Specifies whether to use an SSL-secured connection ( Values: Default: |
type | For protocols and transports that accept multiple message types on a given transport, specifies the message type to use. |
uriopts | Custom connection URI parameters to be passed in the URI query string. For example: |
| Allows a custom URI scheme to be specified. When both |
Examples
%> ./spark sow_delete -server localhost:9007 \
-topic chaos -type json -filter "/name = 'cup'"
Deleted 1 records in 10ms.
With the sow_delete command above, we are asking for AMPS to delete records in the topic chaos which match the filter /name = 'cup'. In this example, we delete the record queried in the SOW and Subscribe example. AMPS spark CLI reports that one matching message was removed from the SOW topic.
For the full range of options, run spark help sow_delete. See AMPS spark CLI Authentication and AMPS spark CLI Support for TCPS for shared connection settings.