Skip to content

edp/davinci/core/utils/SqlParseUtils.java have a bug #119

@LiuHao0606

Description

@LiuHao0606

English:

I find that there is a problem with the return value of this method under this class. When the version of [apache.links.version] is 1.1.2, an error will be reported here. You should comment out [_2] and modify it as follows:

` // Apache Linkis variable CustomVariableUtils
private static String linkisVariabelReplace(String sql, String username) {
JobRequest jobRequest = new JobRequest();

    jobRequest.setExecutionCode(sql);
    jobRequest.setExecuteUser(username);
    CodeLanguageLabel codeLabel = new CodeLanguageLabel();
    codeLabel.setCodeType("sql");
    Map<String, Object> configMap = new HashMap<>();
    jobRequest.setParams(configMap);

    jobRequest.setLabels(Arrays.asList(codeLabel));
    //return CustomVariableUtils.replaceCustomVar(jobRequest, "sql")._2; //Before modification
    return CustomVariableUtils.replaceCustomVar(jobRequest, "sql");     //After modification
}`

Chinese:
我发现在这个类下,这个方法返回值有问题,当[apache.linkis.version]版本是1.1.2时,这里会报错,应该注释掉 [_2],修改如下:

` // Apache Linkis variable CustomVariableUtils
private static String linkisVariabelReplace(String sql, String username) {
JobRequest jobRequest = new JobRequest();

    jobRequest.setExecutionCode(sql);
    jobRequest.setExecuteUser(username);
    CodeLanguageLabel codeLabel = new CodeLanguageLabel();
    codeLabel.setCodeType("sql");
    Map<String, Object> configMap = new HashMap<>();
    jobRequest.setParams(configMap);

    jobRequest.setLabels(Arrays.asList(codeLabel));
    //return CustomVariableUtils.replaceCustomVar(jobRequest, "sql")._2; //修改前
    return CustomVariableUtils.replaceCustomVar(jobRequest, "sql");  //修改后
}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions