drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "mircoteam (JIRA)" <j...@apache.org>
Subject [jira] [Created] (DRILL-5078) use Custom Functions errors
Date Mon, 28 Nov 2016 10:03:58 GMT
mircoteam created DRILL-5078:

             Summary: use Custom Functions errors
                 Key: DRILL-5078
                 URL: https://issues.apache.org/jira/browse/DRILL-5078
             Project: Apache Drill
          Issue Type: Bug
          Components: Functions - Drill
    Affects Versions: 1.8.0
         Environment: window 7
            Reporter: mircoteam
            Priority: Trivial

I define a function like change encoding from UTF8 to GBK。
when I put it classes and source code into 3rdparty, and use it in query sql like this :
"SELECT encode_translate(columns[0],'UTF-8','GBK') as aaa FROM dfs.`d:/drill_test.csv` LIMIT
it return a error info:
Query Failed: An Error Occurred
org.apache.drill.common.exceptions.UserRemoteException: SYSTEM ERROR: CompileException: Line
92, Column 42: Cannot determine simple type name "UnsupportedEncodingException" Fragment 0:0
[Error Id: 599d0e39-f05a-4ecd-a539-b5338239d63b on XXX.XXXX.com:31010]。

this is resource code of evel :

public void eval() {
        // get the value and replace with
        String stringValue = org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.toStringFromUTF8(input.start,
input.end, input.buffer);
        String fromEncodeValue = org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.getStringFromVarCharHolder(fromEncode);
        String toEncodeValue = org.apache.drill.exec.expr.fn.impl.StringFunctionHelpers.getStringFromVarCharHolder(toEncode);

        try {
            String toEncodeStringValue = new String(stringValue.getBytes(fromEncodeValue),toEncodeValue);
            out.buffer = buffer;
            out.start = 0;
            out.end = toEncodeStringValue.getBytes().length;
            buffer.setBytes(0, toEncodeStringValue.getBytes());
        } catch (UnsupportedEncodingException e) {


please help me,thank your.

This message was sent by Atlassian JIRA

View raw message