INSERT INTO ENTITY

Syntax

INSERT INTO ENTITY entity_name [IN STORE store_name] [KEY(json_string)] VALUE (json_string);

Description

For an existing entity, INSERT INTO ENTITY inserts a JSON string provided in the VALUE clause into the the entity's value field, and optionally writes the JSON string in the KEY clause into its key field. The command processes and inserts exactly one JSON record per execution.

INSERT INTO ENTITY supports only Kafka topics and Kinesis data stream as the sink entity.

Arguments

entity_name

This specifies the name of the entity to add the json string to. For case-sensitive names, the name must be wrapped in double quotes; otherwise, the lowercase name will be used.

store_name

The Kafka or Kinesis store (topic/stream) to which the record will be published.

json_string

The JSON string to be inserted into the entity.

Examples

Insert into an entity in a given Store

INSERT INTO ENTITY users IN STORE kafkaStroe  KEY('{"userid": "User_7"}') VALUE('{"registertime": 1753311127306,"userid": "User_7","regionid": "Region_1","gender": "OTHER","interests": ["News","Travel"],"contactinfo": {"phone": "6502215368","city": "San Carlos","state": "CA","zipcode": "94070"}') ;    

Insert only into the "value" of a topic in the default Kafka store

INSERT INTO ENTITY users VALUE('{"registertime": 1753311127306,"userid": "User_7","regionid": "Region_1","gender": "OTHER","interests": ["News","Travel"],"contactinfo": {"phone": "6502215368","city": "San Carlos","state": "CA","zipcode": "94070"}') ;    

Last updated