changxue created IOTDB-4949:
-------------------------------
Summary: [UDF]the same qualified class name is in different jar,
create function should return error
Key: IOTDB-4949
URL: https://issues.apache.org/jira/browse/IOTDB-4949
Project: Apache IoTDB
Issue Type: Bug
Affects Versions: 0.14.0-SNAPSHOT
Reporter: changxue
Assignee: Yuan Tian
Attachments: SameNameTest.java, normla-udf-0.14-SNAPSHOT.jar,
same-name-test-0.14-SNAPSHOT.jar
[UDF]the same qualified class name is in different jar, create function should
return error
There is a class name "SameNameTest", it both in normla-udf-0.14-SNAPSHOT.jar
and
same-name-test-0.14-SNAPSHOT.jar. But they are not the same, the first one is
for boolean value and later one is for int32.
I create my UDF with "SameNameTest" class successfully and it uses the one in
normla-udf-0.14-SNAPSHOT.jar.
reproduction:
# put the attachment jars in $IOTDB_HOME/ext/udf
# execute sql command below:
{code:sql}
drop function my_test;
create function my_test as "SamNameTest";
create database root.same;
create timeseries root.same.test.s1 with datatype=boolean;
create timeseries root.same.test.s2 with datatype=int32;
insert into root.same.test(time, s1, s2) values (1,true,32),(2,false,12);
-- 使用的是normal-udf内的而不是 same-name-test内的
select my_test(s1) from root.same.test;
select my_test(s2) from root.same.test;
drop function my_test;
drop database root.**;{code}
message in command window:
{code:sql}
select my_test(s1) from root.same.test
Time(TIME) |my_test(root.same.test.s1)(INT32) |
总数目:0
select my_test(s2) from root.same.test
SQLSTATE : 416: Error occurred during inferring UDF data type:
org.apache.iotdb.udf.api.exception.UDFInputSeriesDataTypeNotValidException: the
data type of the input series (index: 0) is not valid. expected: BOOLEAN.
actual: INT32.
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)