Skip to content

[Bug] ipv4/ipv6 udf 开发遇到问题 #56229

Description

@KONEONE

Search before asking

  • I had searched in the issues and found no similar issues.

Version

3.0.7

What's Wrong?

这是我的Java函数:

importorg.apache.hadoop.hive.ql.exec.UDF;
importjava.net.InetAddress;
publicclassIsReservedIpUDFextendsUDF {
publicStringevaluate(InetAddressipNum){
return"";
}
}

这是我的sql

CREATEFUNCTIONis_reserved_ip(IPV4) RETURNS STRING PROPERTIES(
"file"="file:///opt/manager_udf/is_reserved_ip_udf.jar",
"symbol"="com.xxxx.doris.udf.IsReservedIpUDF",
"always_nullable"="true",
"type"="JAVA_UDF"
);

报错信息为:

errCode = 2, detailMessage = UDF class 'com.xxxx.doris.udf.IsReservedIpUDF' method 'evaluate' arg0[java.net.InetAddress] type is not supported!

What You Expected?

我知道ipv4会隐射为一个int类型,我尝试使用integer类型,确是常见成功了。但是我使用如下测试:

select is_reserved_ip(to_ipv4('192.168.1.20')) as col;

很不幸,在be节点出现 无法创建这个jar的实例。

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions