Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wild-River2016 opened this issue Apr 29, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@wild-River2016
Copy link

wild-River2016 commented Apr 29, 2024

问题描述
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 wild-River2016 added the bug Something isn't working label Apr 29, 2024
@yu285 yu285 self-assigned this Apr 29, 2024
@yu285 yu285 changed the title 基于InfluxDB 行协议通过无模式写入,VARCHAR类型字段,部分内容乱码 use InfluxDB line protocol to write to TDengine. VARCHAR fields contain garbled characters Apr 29, 2024
@yu285
Copy link
Contributor

yu285 commented May 6, 2024

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

@wild-River2016
Copy link
Author

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

@freemine
Copy link
Contributor

freemine commented May 7, 2024

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

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

@wild-River2016
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants