Browse Source

[improve-#13665] improve datax parser if sql contain * (#13680)

* [improve-#13665] improve datax parser if sql contain *

* Update dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java

Co-authored-by: fuchanghai <‘2875334588@qq.com’>
Co-authored-by: Aaron Wang <wangweirao16@gmail.com>
3.2.0-release
fuchanghai 2 years ago committed by GitHub
parent
commit
6218f818c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java

10
dolphinscheduler-task-plugin/dolphinscheduler-task-datax/src/main/java/org/apache/dolphinscheduler/plugin/task/datax/DataxTask.java

@ -90,6 +90,11 @@ public class DataxTask extends AbstractTask {
*/ */
private static final String DATAX_PYTHON = "python2.7"; private static final String DATAX_PYTHON = "python2.7";
private static final Pattern PYTHON_PATH_PATTERN = Pattern.compile("/bin/python[\\d.]*$"); private static final Pattern PYTHON_PATH_PATTERN = Pattern.compile("/bin/python[\\d.]*$");
/**
* select all
*/
private static final String SELECT_ALL_CHARACTER = "*";
/** /**
* datax path * datax path
*/ */
@ -538,6 +543,11 @@ public class DataxTask extends AbstractTask {
String.format("grammatical analysis sql column [ %s ] failed", item)); String.format("grammatical analysis sql column [ %s ] failed", item));
} }
if (SELECT_ALL_CHARACTER.equals(item.toString())) {
log.info("sql contains *, grammatical analysis failed");
return new String[0];
}
if (columnName == null) { if (columnName == null) {
throw new RuntimeException( throw new RuntimeException(
String.format("grammatical analysis sql column [ %s ] failed", item)); String.format("grammatical analysis sql column [ %s ] failed", item));

Loading…
Cancel
Save