TSCreateTimeseriesReq(sessionId, "root.group1.s5", TSDataType['BOOLEAN'], TSEncoding['PLAIN'], Compressor['UNCOMPRESSED'])) print(status.statusType) status = client.createTimeseries( TSCreateTimeseriesReq(sessionId, "root.group1.s6", TSDataType['TEXT'], TSEncoding['PLAIN'], Compressor['UNCOMPRESSED'])) print(status.statusType) deviceId = "root.group1" measurements = ["s1", "s2", "s3", "s4", "s5", "s6"] # insert a single row values = ["1", "11", "1.1", "11.1", "TRUE", "\'text0\'"] timestamp = 1 status = client.insert( TSInsertionReq(sessionId, deviceId, measurements, values, timestamp)) print(status.status) # insert multiple rows, this interface is more efficient values = bytearray() times = bytearray() rowCnt = 3 dataTypes = [ TSDataType['INT64'], TSDataType['INT32'], TSDataType['DOUBLE'], TSDataType['FLOAT'], TSDataType['BOOLEAN'], TSDataType['TEXT'] ] # the first 3 belong to 's1', the second 3 belong to 's2'... the last 3 # belong to 's6' # to transfer a string, you must first send its length and then its bytes # (like the last 3 'i7s'). Text values should start and end with ' or ".
status = client.createTimeseries( TSCreateTimeseriesReq("root.group1.s5", TSDataType['BOOLEAN'], TSEncoding['PLAIN'], Compressor['UNCOMPRESSED'])) print(status.statusType) status = client.createTimeseries( TSCreateTimeseriesReq("root.group1.s6", TSDataType['TEXT'], TSEncoding['PLAIN'], Compressor['UNCOMPRESSED'])) print(status.statusType) deviceId = "root.group1" measurements = ["s1", "s2", "s3", "s4", "s5", "s6"] # insert a single row values = ["1", "11", "1.1", "11.1", "TRUE", "\'text0\'"] timestamp = 1 status = client.insert( TSInsertionReq(deviceId, measurements, values, timestamp, stmtId)) print(status.status) # insert multiple rows, this interface is more efficient values = bytearray() times = bytearray() rowCnt = 3 dataTypes = [ TSDataType['INT64'], TSDataType['INT32'], TSDataType['DOUBLE'], TSDataType['FLOAT'], TSDataType['BOOLEAN'], TSDataType['TEXT'] ] # the first 3 belong to 's1', the second 3 belong to 's2'... the last 3 # belong to 's6' # to transfer a string, you must first send its length and then its bytes # (like the last 3 'i7s'). Text values should start and end with ' or ".