This is an automated email from the ASF dual-hosted git repository. lihaopeng pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 6fee498e011 [fix](function) fix the function elt (#48701) 6fee498e011 is described below commit 6fee498e01133342a988155b2ca3390e64e3b511 Author: Sun Chenyang <suncheny...@selectdb.com> AuthorDate: Thu Mar 6 00:19:26 2025 +0800 [fix](function) fix the function elt (#48701) --- be/src/vec/functions/function_string.h | 3 +- regression-test/data/variant_p0/rqg/rqg6.out | Bin 0 -> 236 bytes regression-test/suites/variant_p0/rqg/rqg6.sql | 66 +++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 1 deletion(-) diff --git a/be/src/vec/functions/function_string.h b/be/src/vec/functions/function_string.h index 8a4f42058be..cb994235344 100644 --- a/be/src/vec/functions/function_string.h +++ b/be/src/vec/functions/function_string.h @@ -1233,8 +1233,9 @@ public: auto& target_column = block.get_by_position(arguments[pos]).column; if (auto target_const_column = check_and_get_column<ColumnConst>(*target_column)) { auto target_data = target_const_column->get_data_at(0); + // return NULL, no target data if (target_data.data == nullptr) { - null_map = ColumnUInt8::create(input_rows_count, is_null); + null_map = ColumnUInt8::create(input_rows_count, true); res->insert_many_defaults(input_rows_count); } else { res->insert_data_repeatedly(target_data.data, target_data.size, diff --git a/regression-test/data/variant_p0/rqg/rqg6.out b/regression-test/data/variant_p0/rqg/rqg6.out new file mode 100644 index 00000000000..e3b65b456bb Binary files /dev/null and b/regression-test/data/variant_p0/rqg/rqg6.out differ diff --git a/regression-test/suites/variant_p0/rqg/rqg6.sql b/regression-test/suites/variant_p0/rqg/rqg6.sql new file mode 100644 index 00000000000..dd9adcb148a --- /dev/null +++ b/regression-test/suites/variant_p0/rqg/rqg6.sql @@ -0,0 +1,66 @@ +-- MySQL dump 10.13 Distrib 8.0.41, for Linux (x86_64) +-- +-- Host: 127.0.0.1 Database: column_data_type_string_data_id_1000056 +-- ------------------------------------------------------ +-- Server version 5.7.99 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!50503 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `table_200_undef_partitions2_keys3_properties4_distributed_by55` +-- + +DROP TABLE IF EXISTS `table_200_undef_partitions2_keys3_properties4_distributed_by55`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!50503 SET character_set_client = utf8mb4 */; +CREATE TABLE `table_200_undef_partitions2_keys3_properties4_distributed_by55` ( + `pk` int NULL, + `var` variant NULL +) ENGINE=OLAP +DUPLICATE KEY(`pk`) +DISTRIBUTED BY HASH(`pk`) 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", +"light_schema_change" = "true", +"disable_auto_compaction" = "false", +"enable_single_replica_compaction" = "false", +"group_commit_interval_ms" = "10000", +"group_commit_data_bytes" = "134217728" +);; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `table_200_undef_partitions2_keys3_properties4_distributed_by55` +-- + +LOCK TABLES `table_200_undef_partitions2_keys3_properties4_distributed_by55` WRITE; +/*!40000 ALTER TABLE `table_200_undef_partitions2_keys3_properties4_distributed_by55` DISABLE KEYS */; +INSERT INTO `table_200_undef_partitions2_keys3_properties4_distributed_by55` VALUES (3,'{\"col_char_100__undef_signed\":\"I\'ll\",\"col_char_100__undef_signed_not_null\":\"w\",\"col_char_255__undef_signed\":\"v\",\"col_char_255__undef_signed_not_null\":\"did\",\"col_string_undef_signed\":\"0\",\"col_string_undef_signed_not_null\":\"0\",\"col_varchar_1000__undef_signed\":\"it\",\"col_varchar_1000__undef_signed_not_null\":\"r\",\"col_varchar_1001__undef_signed\":\"that\'s\",\"col_varchar_1 [...] +/*!40000 ALTER TABLE `table_200_undef_partitions2_keys3_properties4_distributed_by55` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2025-03-05 14:26:07 +select bit_length( CAST(var['col_string_undef_signed'] AS string) ) col_alias25753 , md5sum( CAST(var['col_varchar_1000__undef_signed_not_null'] AS varchar(1000)) , CAST(var['col_char_255__undef_signed_not_null'] AS char(255)) ) AS col_alias25754 , ELT(1, CAST(var['col_varchar_1000__undef_signed'] AS varchar(1000)) , CAST(var['col_varchar_1000__undef_signed_not_null'] AS varchar(1000)) , CAST(var['col_string_undef_signed_not_null'] AS string) ) AS col_alias25755 , approx_count_distinc [...] --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org