JamesIsHuang opened a new issue, #57753: URL: https://github.com/apache/doris/issues/57753
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version ### 现象 ```sql INSERT INTO doris_unique_types_test (id, variant_value) VALUES (15, 'null'), -- 字符串 "null" (2, NULL), -- SQL NULL (3, 'true'), -- 布尔值 (7, '""'), -- 空字符串(双引号) (11, ''), -- 空字符串(无引号) (8, '[-1, 12, false]'), -- 数组 (9, '{ "x": "abc", "y": false, "z": 10 }'); -- 对象 ``` **问题**:插入**空字符串** `''` 时,查询id为15的数据variant_value列的结果不一致: - 有时返回 `0` - 有时返回 `{}` - 有时返回 `[]` --- ### What's Wrong? ### 现象 ```sql 建表语句: CREATE TABLE `doris_unique_types_test` ( `id` int NOT NULL COMMENT "主键ID", `bool_value` boolean NULL COMMENT "BOOLEAN类型: 布尔值, 0表示false, 1表示true", `tinyint_value` tinyint NULL COMMENT "TINYINT类型: -128 到 127", `smallint_value` smallint NULL COMMENT "SMALLINT类型: -32768 到 32767", `int_value` int NULL COMMENT "INT类型: -2147483648 到 2147483647", `bigint_value` bigint NULL COMMENT "BIGINT类型: -9223372036854775808 到 9223372036854775807", `largeint_value` largeint NULL COMMENT "LARGEINT类型: -2^127 到 2^127-1", `float_value` float NULL COMMENT "FLOAT类型: 单精度浮点数", `double_value` double NULL COMMENT "DOUBLE类型: 双精度浮点数", `decimal_value` decimal(27,9) NULL COMMENT "DECIMAL类型: 高精度定点数", `date_value` date NULL COMMENT "DATE类型: 日期, 范围 0000-01-01 到 9999-12-31", `datetime_value` datetime NULL COMMENT "DATETIME类型: 日期时间, 范围 0000-01-01 00:00:00 到 9999-12-31 23:59:59", `datev2_val ue` date NULL COMMENT "DATEV2类型: 日期(v2版本), 范围 0000-01-01 到 9999-12-31", `datetimev2_value` datetime(3) NULL COMMENT "DATETIMEV2类型: 日期时间(v2版本), 支持微秒精度, (3)表示毫秒", `char_value` char(50) NULL COMMENT "CHAR类型: 定长字符串", `varchar_value` varchar(200) NULL COMMENT "VARCHAR类型: 变长字符串", `string_value` text NULL COMMENT "STRING类型: 字符串, 最大长度2147483643字节", `text_value` text NULL COMMENT "TEXT类型: 文本类型", `json_value` json NULL COMMENT "JSON类型: JSON数据", `array_value` array<int> NULL COMMENT "ARRAY类型: 整型数组", `map_value` map<text,int> NULL COMMENT "MAP类型: 键值对, String到Int的映射", `struct_value` struct<name:text,age:int,city:text> NULL COMMENT "STRUCT类型: 结构体", `variant_value` variant NULL COMMENT "VARIANT类型:不限定结构", `ipv4_value` ipv4 NULL COMMENT "IPV4类型: IPv4地址", `ipv6_value` ipv6 NULL COMMENT "IPV6类型: IPv6地址", `cre ate_time` datetime NULL DEFAULT CURRENT_TIMESTAMP COMMENT "创建时间", `update_time` datetime NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT "更新时间" ) ENGINE=OLAP UNIQUE KEY(`id`) COMMENT 'Doris基础数据类型测试表 - UNIQUE KEY模型 - 支持更新操作' DISTRIBUTED BY HASH(`id`) BUCKETS 10 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "min_load_replica_num" = "-1", "is_being_synced" = "false", "storage_medium" = "hdd", "storage_format" = "V2", "inverted_index_storage_format" = "V2", "enable_unique_key_merge_on_write" = "true", "light_schema_change" = "true", "disable_auto_compaction" = "false", "enable_single_replica_compaction" = "false", "group_commit_interval_ms" = "10000", "group_commit_data_bytes" = "134217728", "enable_mow_light_delete" = "false" ); 写入语句: INSERT INTO doris_unique_types_test (id, variant_value) VALUES (15, 'null'), -- 字符串 "null" (2, NULL), -- SQL NULL (3, 'true'), -- 布尔值 (7, '""'), -- 空字符串(双引号) (11, ''), -- 空字符串(无引号) (8, '[-1, 12, false]'), -- 数组 (9, '{ "x": "abc", "y": false, "z": 10 }'); -- 对象 ``` **问题**:插入**空字符串** `''` 时,查询结果**不一致**: id为 15的数据的variant_value列的值 - 有时返回 `0` - 有时返回 `{}` - 有时返回 `[]` --- ### What You Expected? 应该返回: 'null' ### 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 - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
