fix: 解析sql报错

This commit is contained in:
taojinlong 2023-11-29 12:13:47 +08:00
parent 5a1451be55
commit f337c73c11

View File

@ -1123,7 +1123,9 @@ public class DataSetTableService {
Select subSelectTmp = (Select) CCJSqlParserUtil.parse(removeVariables(selectBody.toString(), dsType));
subSelect.setSelectBody(subSelectTmp.getSelectBody());
if (dsType.equals(DatasourceTypes.oracle.getType())) {
if(fromItem.getAlias() != null){
subSelect.setAlias(new Alias(fromItem.getAlias().toString(), false));
}
} else {
if (fromItem.getAlias() == null) {
throw new Exception("Failed to parse sql, Every derived table must have its own alias");