Skip to content

[Bug] #56235

@KONEONE

Description

@KONEONE

Search before asking

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

Version

3.0.7

What's Wrong?

这是我的Java函数:

import org.apache.hadoop.hive.ql.exec.UDF;
import java.net.InetAddress;

public class IsReservedIpUDF extends UDF {
    public String evaluate(InetAddress ipNum){
        return "";
    }
}

这是我的sql

CREATE FUNCTION is_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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions