Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Map Operator Example

Example of how to use the map operator. In this example, the map operator transforms masks SSN numbers in a user record.

Run DataFlow

With the dataflow.yaml file in the current directory, run the following commands:

sdf run

Test DataFlow

Produce to users:

fluvio produce users
{"name": "Alice", "ssn": "222-333-5555"}
{"name": "Bob", "ssn": "444-666-7777"}

Consume from users-public to see them transformed:

fluvio consume users-public -Bd
{"name":"Alice","ssn":"***-***-****"}
{"name":"Bob","ssn":"***-***-****"}

Display the stateful dataflow stats in the sdf runtime >> terminal:

show state map-service/mask-ssn/metrics --table
Key    Window  succeeded  failed
stats  *       2          0

Clean-up

Exit sdf terminal and remove the topics:

fluvio topic delete users
fluvio topic delete users-public