Example SQL Snapshot command to create Kafka topic with sales orders JSON events

Here’s an SQL Snapshot example of creating Sales Order JSON topic and schema in Lenses:

CREATE TABLE VBAK_VBAP_JSON (

    _key STRING

    , OrderID STRING

    , OrderDate STRING

    , Customer.CustomerID STRING

    , Customer.Name STRING

    , Customer.Email STRING

    , Status STRING

    , Currency STRING

    , TotalAmount STRING

)

FORMAT (STRING, JSON)

PROPERTIES (

    partitions=5,

    replication=1

);

Here’s the command to insert some sample data:

-- Insert 5 sample sales order events

INSERT INTO VBAK_VBAP_2_JSON (

    _key

    , OrderID

    , OrderDate

    , Customer.CustomerID

    , Customer.Name

    , Customer.Email

    , Status

    , Currency

    , TotalAmount

)

VALUES

('salesorder1', '1001', '2025-10-20T09:30:00Z', 'C001', 'John Doe', 'john.doe@example.com', 'Confirmed', 'USD', '299.99'),

('salesorder2', '1002', '2025-10-20T10:15:00Z', 'C002', 'Jane Smith', 'jane.smith@example.com', 'Processing', 'USD', '1250.50'),

('salesorder3', '1003', '2025-10-20T11:00:00Z', 'C003', 'Bob Johnson', 'bob.johnson@example.com', 'Shipped', 'EUR', '850.75'),

('salesorder4', '1004', '2025-10-20T12:30:00Z', 'C004', 'Alice Williams', 'alice.williams@example.com', 'Delivered', 'GBP', '445.20'),

('salesorder5', '1005', '2025-10-20T14:45:00Z', 'C005', 'Charlie Brown', 'charlie.brown@example.com', 'Confirmed', 'USD', '670.00');