firebinhuo commented on issue #15480:
URL: https://github.com/apache/iotdb/issues/15480#issuecomment-2865569117
> 可以提供一下完整复现代码吗
def insert_tablet(self, dev_id, measurement, data: list, tt: list):
np_values = [
np.array(data, TSDataType.FLOAT.np_dtype())
]
np_tt = np.array(tt, TSDataType.INT64.np_dtype())
bk_size = 500
if len(data) < bk_size:
bk_size = len(data)
for i in range(0,len(tt),bk_size):
tem_value = np_values[0][i:i+bk_size]
tem_tt = np_tt[i:i+bk_size]
np_tablet = NumpyTablet(dev_id, [measurement],
[TSDataType.FLOAT], [tem_value], tem_tt)
try:
self.session.insert_tablet(np_tablet)
except Exception as e:
print(e)
`self.mqtt2iot.insert_tablet(f"root.mqtt.{str(msg.topic).split('/')[2]}.ch{index}",
'voltage',
self.data_list[index],
self.tt_list[index])`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]