Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
LiuHao0606 opened this issue Jul 13, 2022 · 0 comments
Open

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

LiuHao0606 opened this issue Jul 13, 2022 · 0 comments

Comments

@LiuHao0606
Copy link

LiuHao0606 commented Jul 13, 2022

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");  //修改后
}`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant