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

[Bug] Variant Automatic type inference error #32070

Open
2 of 3 tasks
15767714253 opened this issue Mar 11, 2024 · 3 comments
Open
2 of 3 tasks

[Bug] Variant Automatic type inference error #32070

15767714253 opened this issue Mar 11, 2024 · 3 comments

Comments

@15767714253
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Version

2.1

What's Wrong?

我使用了variant这种数据类型,新增一条数据,'{
"create_time": "2024-03-10 09:31:12",
"device_inst_code": "c_18_1_4_8_52",
"rval": "0.200000",
"soc": "99.500000",
"soh": "99.400000",
"temperature": "21.500000",
"time": "1710034260801",
"voltage": "3.341000"
}'
一开始desc 自动推断为text;
当我再插入一条数据为:
'{
"create_time": "2024-03-10 09:31:12",
"device_inst_code": "c_18_1_4_8_52",
"rval": 0.200000,
"soc": 99.500000,
"soh": 99.400000,
"temperature": 21.500000,
"time": 1710034260801,
"voltage": 3.341000
}'
值类型不同
类型冲突,自动类型推断为json
此时无论我删除掉不同类型的数据,或者删除后再插入一条相同类型的数据,自动类型推断还是json
image

What You Expected?

是不是Bug,如果不是该如何规避,如果是,希望有大佬修复

How to Reproduce?

No response

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@eldenmoon
Copy link
Member

eldenmoon commented Mar 28, 2024

当前是符合预期的,删除后自动去掉类型信息这个我们正在讨论怎么做,尽可能保证类型一致,double和string属于不互相兼容的类型,所以会变成JSON类型

@eldenmoon
Copy link
Member

当前只有truncate表,或者写新的分区,这类列才会消失

@eldenmoon
Copy link
Member

可以在https://ask.selectdb.com 提问,问题会更快解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants