MCPcopy Create free account
hub / github.com/apache/iotdb-client-go / createTablet

Function createTablet

test/e2e/e2e_test.go:344–384  ·  view source on GitHub ↗
(rowCount int)

Source from the content-addressed store, hash-verified

342}
343
344func createTablet(rowCount int) (*client.Tablet, error) {
345 tablet, err := client.NewTablet("root.ln.device1", []*client.MeasurementSchema{
346 {
347 Measurement: "restart_count",
348 DataType: client.INT32,
349 }, {
350 Measurement: "price",
351 DataType: client.DOUBLE,
352 }, {
353 Measurement: "tick_count",
354 DataType: client.INT64,
355 }, {
356 Measurement: "temperature",
357 DataType: client.FLOAT,
358 }, {
359 Measurement: "description",
360 DataType: client.TEXT,
361 },
362 {
363 Measurement: "status",
364 DataType: client.BOOLEAN,
365 },
366 }, rowCount)
367
368 if err != nil {
369 return nil, err
370 }
371 ts := time.Now().UTC().UnixNano() / 1000000
372 for row := 0; row < int(rowCount); row++ {
373 ts++
374 tablet.SetTimestamp(ts, row)
375 tablet.SetValueAt(rand.Int31(), 0, row)
376 tablet.SetValueAt(rand.Float64(), 1, row)
377 tablet.SetValueAt(rand.Int63(), 2, row)
378 tablet.SetValueAt(rand.Float32(), 3, row)
379 tablet.SetValueAt(fmt.Sprintf("Test Device %d", row+1), 4, row)
380 tablet.SetValueAt(bool(ts%2 == 0), 5, row)
381 tablet.RowSize++
382 }
383 return tablet, nil
384}
385
386func (s *e2eTestSuite) Test_InsertAlignedTablets() {
387 var timeseries = []string{"root.ln.device1.**"}

Callers 3

Test_FetchMoreDataMethod · 0.70

Calls 3

SetTimestampMethod · 0.95
SetValueAtMethod · 0.95
NewTabletFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…