BiteTheDDDDt opened a new pull request, #31787:
URL: https://github.com/apache/doris/pull/31787
## Proposed changes
fix wrong data in mv when routine load with function mapping
```sql
CREATE TABLE `test` (
`event_id` varchar(50) NULL COMMENT '',
`time_stamp` datetime NULL COMMENT '',
`device_id` varchar(150) NULL DEFAULT "" COMMENT ''
) ENGINE=OLAP
DUPLICATE KEY(`event_id`)
DISTRIBUTED BY HASH(`device_id`) BUCKETS AUTO
PROPERTIES (
"replication_allocation" = "tag.location.default: 1"
);
insert into test(event_id,time_stamp,device_id)
values('ad_sdk_request','2024-03-04 00:00:00','a');
create materialized view m_view as select time_stamp, count(device_id) from
test group by time_stamp;
CREATE ROUTINE LOAD test.test ON test
COLUMNS(event_id,time_stamp,device_id,time_stamp=from_unixtime(`time_stamp`))
PROPERTIES
(
"desired_concurrent_number" = "10",
"max_error_number" = "200000",
"max_filter_ratio" = "1.0",
"max_batch_interval" = "10",
"max_batch_rows" = "200000",
"max_batch_size" = "104857600",
"format" = "json",
"strip_outer_array" = "false",
"num_as_string" = "false",
"fuzzy_parse" = "false",
"strict_mode" = "false",
"timezone" = "Asia/Shanghai",
"exec_mem_limit" = "2147483648"
)
FROM KAFKA
(
"kafka_broker_list" = "localhost:9092",
"kafka_topic" = "test"
);
mysql [test]>select * from com_haixingyd_home;
+----------------+---------------------+-----------+
| event_id | time_stamp | device_id |
+----------------+---------------------+-----------+
| ad_sdk_request | 2024-03-04 00:00:00 | a |
| ad_sdk_request | 2007-12-01 00:30:19 | a |
+----------------+---------------------+-----------+
2 rows in set (0.02 sec)
mysql [test]>select * from com_haixingyd_home index m_view;
+---------------------+----------------------------------------------------------+
| mv_time_stamp | mva_SUM__CASE WHEN `device_id` IS NULL THEN 0 ELSE 1
END |
+---------------------+----------------------------------------------------------+
| NULL |
1 |
| 2024-03-04 00:00:00 |
1 |
+---------------------+----------------------------------------------------------+
2 rows in set (0.02 sec)
```
## Further comments
If this is a relatively large or complex change, kick off the discussion at
[[email protected]](mailto:[email protected]) by explaining why you
chose the solution you did and what alternatives you considered, etc...
--
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]