Skip to content

Commit

Permalink
add example link
Browse files Browse the repository at this point in the history
  • Loading branch information
nicecui committed Nov 12, 2024
1 parent a919b57 commit ffdd904
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
6 changes: 4 additions & 2 deletions docs/user-guide/ingest-data/for-iot/grpc-sdks/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ attributes := Attributes{ Location: "factory-1" }
jsonData, err := json.Marshal(attributes)
sensorReadings.AddRow(<other-column-values>... , string(jsonData))

// Write data
// The following code for writing data is omitted
// ...
```

Expand All @@ -266,10 +266,12 @@ sensor := SensorReadings{
Attributes: string(jsonData),
}

// Write data
// The following code for writing data is omitted
// ...
```

For the executable code for inserting JSON data, please refer to the [example](https://github.com/GreptimeTeam/greptimedb-ingester-go/tree/main/examples/jsondata) in the SDK repository.

</div>

<div id="ingester-lib-reference">
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/ingest-data/for-iot/grpc-sdks/java.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ TableSchema sensorReadings = TableSchema.newBuilder("sensor_readings")
// Add JSON data as a string value
sensorReadings.addRow(<other-column-values>... , "{\"location\":\"factory-1\"}");

// Insert data
// The following code for writing data is omitted
// ...
```

Expand All @@ -346,7 +346,7 @@ Sensor sensor = new Sensor();
sensor.setAttributes("{\"action\":\"running\"}");


// Insert data
// The following code for writing data is omitted
// ...
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ attributes := Attributes{ Location: "factory-1" }
jsonData, err := json.Marshal(attributes)
sensorReadings.AddRow(<other-column-values>... , string(jsonData))

// 写入数据
// 以下省略了写入数据的代码
// ...
```

Expand All @@ -243,10 +243,12 @@ sensor := SensorReadings{
Attributes: string(jsonData),
}

// 写入数据
// 以下省略了写入数据的代码
// ...
```

请参考 SDK 仓库中的[示例](https://github.com/GreptimeTeam/greptimedb-ingester-go/tree/main/examples/jsondata) 获取插入 JSON 数据的可执行代码。

</div>

<div id="ingester-lib-reference">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ TableSchema sensorReadings = TableSchema.newBuilder("sensor_readings")
// 使用字符串值添加 JSON 数据
sensorReadings.addRow(<other-column-values>... , "{\"location\":\"factory-1\"}");

// 插入数据
// 以下省略了写入数据的代码
// ...
```

Expand All @@ -336,7 +336,7 @@ Sensor sensor = new Sensor();
// 使用字符串值添加 JSON 数据
sensor.setAttributes("{\"action\":\"running\"}");

// 插入数据
// 以下省略了写入数据的代码
// ...
```

Expand Down

0 comments on commit ffdd904

Please sign in to comment.