mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-15 14:36:47 +00:00
[improvement][headless]Clean code logic of headless translator.
This commit is contained in:
@@ -528,7 +528,7 @@ public class SqlReplaceHelper {
|
||||
}
|
||||
}
|
||||
|
||||
private static Select replaceAggAliasOrderItem(Select selectStatement) {
|
||||
private static Select replaceAggAliasOrderbyField(Select selectStatement) {
|
||||
if (selectStatement instanceof PlainSelect) {
|
||||
PlainSelect plainSelect = (PlainSelect) selectStatement;
|
||||
if (Objects.nonNull(plainSelect.getOrderByElements())) {
|
||||
@@ -564,15 +564,15 @@ public class SqlReplaceHelper {
|
||||
if (plainSelect.getFromItem() instanceof ParenthesedSelect) {
|
||||
ParenthesedSelect parenthesedSelect = (ParenthesedSelect) plainSelect.getFromItem();
|
||||
parenthesedSelect
|
||||
.setSelect(replaceAggAliasOrderItem(parenthesedSelect.getSelect()));
|
||||
.setSelect(replaceAggAliasOrderbyField(parenthesedSelect.getSelect()));
|
||||
}
|
||||
return selectStatement;
|
||||
}
|
||||
return selectStatement;
|
||||
}
|
||||
|
||||
public static String replaceAggAliasOrderItem(String sql) {
|
||||
Select selectStatement = replaceAggAliasOrderItem(SqlSelectHelper.getSelect(sql));
|
||||
public static String replaceAggAliasOrderbyField(String sql) {
|
||||
Select selectStatement = replaceAggAliasOrderbyField(SqlSelectHelper.getSelect(sql));
|
||||
return selectStatement.toString();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.tencent.supersonic.common.pojo.Constants;
|
||||
import com.tencent.supersonic.common.pojo.DateConf;
|
||||
import com.tencent.supersonic.common.pojo.ItemDateResp;
|
||||
import com.tencent.supersonic.common.pojo.enums.DatePeriodEnum;
|
||||
import com.tencent.supersonic.common.pojo.enums.TimeDimensionEnum;
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -32,14 +33,9 @@ import static com.tencent.supersonic.common.pojo.Constants.MONTH_FORMAT;
|
||||
@Data
|
||||
public class DateModeUtils {
|
||||
|
||||
@Value("${s2.query.parameter.sys.date:sys_imp_date}")
|
||||
private String sysDateCol;
|
||||
|
||||
@Value("${s2.query.parameter.sys.month:sys_imp_month}")
|
||||
private String sysDateMonthCol;
|
||||
|
||||
@Value("${s2.query.parameter.sys.month:sys_imp_week}")
|
||||
private String sysDateWeekCol;
|
||||
private final String sysDateCol = TimeDimensionEnum.DAY.getName();
|
||||
private final String sysDateMonthCol = TimeDimensionEnum.MONTH.getName();
|
||||
private final String sysDateWeekCol = TimeDimensionEnum.WEEK.getName();
|
||||
|
||||
@Value("${s2.query.parameter.sys.zipper.begin:start_}")
|
||||
private String sysZipperDateColBegin;
|
||||
|
||||
Reference in New Issue
Block a user