changxue created IOTDB-4976: ------------------------------- Summary: [UDF]no error return when the datatype of input timeseries and the UDF are not match in nested query Key: IOTDB-4976 URL: https://issues.apache.org/jira/browse/IOTDB-4976 Project: Apache IoTDB Issue Type: Improvement Reporter: changxue Assignee: Yuan Tian
[UDF]no error return when the datatype of input timeseries and the UDF are not match in nested query description: my_max is a function of getting the max value of int values and only processing int value. my_sum is a function equals the native function of sum, it outputs double value. when the double result of my_sum is given to my_max as inputing value, it would be error in method transform or terminate. But the exception may be catched, the logs of datanode show nothing. *That's the problem.* It's not convenient to find the reason for users. reproduction: {code:sql} create database root.udf.non_aligned; create timeseries root.udf.non_aligned.cl01.temp with datatype=int32; create timeseries root.udf.non_aligned.cl01.pressure with datatype=int32; insert into root.udf.non_aligned.cl01(time, temp,pressure) values (1, 1850, 1800), (3, 2600, 2600), (4, 2300,null),(5, null, 4800),(6, 3500,2300); CREATE FUNCTION my_max AS 'Max'; CREATE FUNCTION my_sum AS "com.timecho.udf.normal.MySum"; -- this would return 0 select my_max(my_sum(temp)) from root.udf.non_aligned.cl01;{code} messages: {code:sql} IoTDB> select my_max(my_sum(temp)) from root.udf.non_aligned.cl01; +-----------------------------+----------------------------------------------+ | Time|my_max(my_sum(root.udf.non_aligned.cl01.temp))| +-----------------------------+----------------------------------------------+ |1970-01-01T08:00:00.001+08:00| 0| +-----------------------------+----------------------------------------------+ Total line number = 1 It costs 0.163s IoTDB> select my_sum(temp) from root.udf.non_aligned.cl01; +-----------------------------+--------------------------------------+ | Time|my_sum(root.udf.non_aligned.cl01.temp)| +-----------------------------+--------------------------------------+ |1970-01-01T08:00:00.001+08:00| 10250.0| +-----------------------------+--------------------------------------+ Total line number = 1 It costs 0.018s {code} -- This message was sent by Atlassian Jira (v8.20.10#820010)