(session client.ITableSession)
| 66 | } |
| 67 | |
| 68 | func insertRelationalTablet(session client.ITableSession) { |
| 69 | tablet, err := client.NewRelationalTablet("t1", []*client.MeasurementSchema{ |
| 70 | { |
| 71 | Measurement: "tag1", |
| 72 | DataType: client.STRING, |
| 73 | }, |
| 74 | { |
| 75 | Measurement: "tag2", |
| 76 | DataType: client.STRING, |
| 77 | }, |
| 78 | { |
| 79 | Measurement: "s1", |
| 80 | DataType: client.TEXT, |
| 81 | }, |
| 82 | { |
| 83 | Measurement: "s2", |
| 84 | DataType: client.TEXT, |
| 85 | }, |
| 86 | }, []client.ColumnCategory{client.TAG, client.TAG, client.FIELD, client.FIELD}, 1024) |
| 87 | if err != nil { |
| 88 | log.Fatal("Failed to create relational tablet {}", err) |
| 89 | } |
| 90 | ts := time.Now().UTC().UnixNano() / 1000000 |
| 91 | for row := 0; row < 16; row++ { |
| 92 | ts++ |
| 93 | tablet.SetTimestamp(ts, row) |
| 94 | tablet.SetValueAt("tag1_value_"+strconv.Itoa(row), 0, row) |
| 95 | tablet.SetValueAt("tag2_value_"+strconv.Itoa(row), 1, row) |
| 96 | tablet.SetValueAt("s1_value_"+strconv.Itoa(row), 2, row) |
| 97 | tablet.SetValueAt("s2_value_"+strconv.Itoa(row), 3, row) |
| 98 | tablet.RowSize++ |
| 99 | } |
| 100 | checkError(session.Insert(tablet)) |
| 101 | |
| 102 | tablet.Reset() |
| 103 | |
| 104 | for row := 0; row < 16; row++ { |
| 105 | ts++ |
| 106 | tablet.SetTimestamp(ts, row) |
| 107 | tablet.SetValueAt("tag1_value_1", 0, row) |
| 108 | tablet.SetValueAt("tag2_value_1", 1, row) |
| 109 | tablet.SetValueAt("s1_value_"+strconv.Itoa(row), 2, row) |
| 110 | tablet.SetValueAt("s2_value_"+strconv.Itoa(row), 3, row) |
| 111 | |
| 112 | nullValueColumn := rand.Intn(4) |
| 113 | tablet.SetValueAt(nil, nullValueColumn, row) |
| 114 | tablet.RowSize++ |
| 115 | } |
| 116 | checkError(session.Insert(tablet)) |
| 117 | } |
| 118 | |
| 119 | func showTables(session client.ITableSession) { |
| 120 | timeout := int64(2000) |
no test coverage detected
searching dependent graphs…