【TDengine 使用环境】
测试
【TDengine 版本】
3.3.8.8
【操作系统以及版本】
MacOS
【部署方式】容器/非容器部署
Docker
【集群节点数】
单节点
【集群副本数】
【描述业务影响】
问题一:TSWSPreparedStatement 区操作数据插入使用官网提供的tswsPreparedStatement.columnDataAddBatch();
tswsPreparedStatement.columnDataExecuteBatch();
会报出 Exception in thread “main” java.sql.SQLException: column data is not empty 这样的异常,使用 tswsPreparedStatement.addBatch(); tswsPreparedStatement.executeBatch(); 就没有问题,但是官方示例使用 tswsPreparedStatement.columnDataAddBatch();
tswsPreparedStatement.columnDataExecuteBatch();是可以的。
问题二:在写入的场景下,第一次写 INSERT INTO oneths.logger_message_subscribe_18764521652465 USING oneths.logger_message_subscribe TAGS (‘http://127.0.0.1:13200’, false, 0, 2, ‘18764521652465’, 1850785932467634176, 1635181216120438785, 1765577363955253251, 1712029883699822592, 1767718971333017600, ‘2’, ‘1825802683232419839,1753344780810977280’) VALUES (‘2025-12-25 16:10:47.789’, ‘2004102509827850240’, ‘2004102511249719296’, ‘推送异常Failed to connect to /192.168.110.15:13200’, ‘{“details”:“在线”,“type”:0,“content”:“在线”}’)
第二次写 INSERT INTO oneths.logger_message_subscribe_18764521652465 USING oneths.logger_message_subscribe TAGS (‘http://192.168.110.15:13200’, false, 0, 1, ‘18764521652465’, 1850785932467634176, 1635181216120438785, 1765577363955253251, 1712029883699822592, 1767718971333017600, ‘2’, ‘1825802683232419839,1753344780810977280’) VALUES (‘2025-12-25 16:10:47.893’, ‘2004102509827850240’, ‘2004102511631400960’, ‘推送异常Failed to connect to /192.168.110.15:13200’, ‘{“events”:[{“event_level”:3,“event_content”:“设备正常”,“event_details”:“设备正常”}],“properties”:,“telemetries”:[{“electric_c_phase_voltage”:226.2,“electric_c_phase_current”:17.19,“electric_leakage_current”:0,“electric_b_phase_power”:-60,“electric_c_phase_power”:-3400,“electric_b_phase_current”:1.15,“electric_3_temperature”:21.9,“electric_1_temperature”:21.6,“electric_2_temperature”:21.7,“electric_b_phase_voltage”:233.2,“electric_4_temperature”:0,“electric_a_phase_voltage”:234.8,“electric_a_phase_power”:-50}]}’)
写入的数据 TAGS 里的内容很多没有变化,例如我提条写 SQL 是插入的tag是2 第二次插入的是1 ,但查询出来 两个都是 2
表结构是这样的
CREATE STABLE IF NOT EXISTS logger_message_subscribe (
timeseries TIMESTAMP,
trace_id BINARY(64),
message_id BINARY(64),
response_content BINARY(128),
data_content BINARY(4096)
) TAGS (
address BINARY(255),
response_status BOOL,
retries INT,
data_type SMALLINT,
unique_id BINARY(64),
device_id BIGINT,
product_id BIGINT,
channel_id BIGINT,
connector_id BIGINT,
subscribe_id BIGINT,
organization_id BINARY(64),
device_group_ids BINARY(512)
);
【问题复现路径/shan】做过哪些操作出现的问题
【遇到的问题:问题现象及影响】
【资源配置】
【报错完整截图】(不要大段的粘贴报错代码,论坛直接看报错代码不直观)