TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

use InfluxDB line protocol to write to TDengine. VARCHAR fields contain garbled characters

Open wild-River2016 opened this issue 9 months ago • 5 comments

问题描述 TDengine通过docker安装 使用restful基于influxdb行协议通过无模式写入,自动创建数据表和字段。相同方式有些表内容正常,没有乱码。有些表的字段部分内容为乱码。

复现过程: Steps to reproduce the behavior:

  1. 调用restful接口,通过无模式写入,自动建表与字段 数据内容: device_log_8111729689050682011,deviceId=7565654654545 content="{"headers":{"deviceName":"网关子设备-数据乱码测试","productId":"8111729689050682011","_uid":"1784458041063751681"},"messageType":"REPORT_PROPERTY","deviceId":"7565654654545","properties":{"temp":36.8},"timestamp":1714282925207}",createTime=1714282925488.0,id="1784458041965527040",timestamp=1714282925207.0,type="reportProperty" 1714282939917000000 image

  2. 查看数据字段类型与内容。第一条数据写入时,数据正常。开始写入第二条之后,数据中首部出现乱码。 image image

相关排查说明: TDengine配置文件中已经配置 image 通过手动指定字段类型为VARCHAR,然后通过相同方式写入数据,数据没有乱码。 image image

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: [] CentOS Linux release 7.9.2009 (Core)

  • Memory, CPU, current Disk Space 内存如下: image 磁盘如下: image

  • TDengine Version 3.2.3.0

wild-River2016 avatar Apr 29 '24 07:04 wild-River2016

请问在TDengine 的shell中也是一样的情况吗?可以截图发在这里吗

yu285 avatar May 06 '24 07:05 yu285

@yu285 您说的是这个截图嘛。 DBeaver可视化工具,数据乱码,如下: image TDengine 客户端工具查询数据乱码,如下: image

wild-River2016 avatar May 06 '24 08:05 wild-River2016

我猜测,是不是你没有对content的内容中的"进行转义?比如:

...content="{\"headers\":{\"deviceName\"...

freemine avatar May 07 '24 14:05 freemine

@freemine 测试的数据是带转义符号的,只是github给处理了,我截图里发送数据的时候也是带转义符号的。 image

wild-River2016 avatar May 08 '24 03:05 wild-River2016

https://github.com/jetlinks/jetlinks-community/issues/515 我也遇到了,降低版本就正常,第一行数据正常,后面的数据开头的乱码,估计是docker最新镜像bug

becage avatar Jun 04 '24 06:06 becage