forked from github/dataease
chore: 调整SQL日志级别为debug #11315
This commit is contained in:
parent
48592ccccb
commit
4786827f50
@ -110,7 +110,7 @@ public class DefaultChartHandler extends AbstractChartPlugin {
|
||||
String querySql = SQLProvider.createQuerySQL(sqlMeta, true, needOrder, view);
|
||||
querySql = provider.rebuildSQL(querySql, sqlMeta, crossDs, dsMap);
|
||||
datasourceRequest.setQuery(querySql);
|
||||
logger.info("calcite chart sql: " + querySql);
|
||||
logger.debug("calcite chart sql: " + querySql);
|
||||
List<String[]> data = (List<String[]>) provider.fetchResultField(datasourceRequest).get("data");
|
||||
//自定义排序
|
||||
data = ChartDataUtil.resultCustomSort(xAxis, data);
|
||||
|
@ -87,7 +87,7 @@ public class YoyChartHandler extends DefaultChartHandler {
|
||||
var request = new DatasourceRequest();
|
||||
request.setDsList(dsMap);
|
||||
request.setQuery(originSql);
|
||||
logger.info("calcite yoy sql: " + originSql);
|
||||
logger.debug("calcite yoy sql: " + originSql);
|
||||
// 实际过滤后的数据
|
||||
var originData = (List<String[]>) provider.fetchResultField(request).get("data");
|
||||
List<String[]> resultData = new ArrayList<>();
|
||||
|
@ -55,7 +55,7 @@ public class BarHandler extends YoyChartHandler {
|
||||
req.setDsList(dsMap);
|
||||
var assistSql = assistSQL(originSql, assistFields);
|
||||
req.setQuery(assistSql);
|
||||
logger.info("calcite assistSql sql: " + assistSql);
|
||||
logger.debug("calcite assistSql sql: " + assistSql);
|
||||
var assistData = (List<String[]>) provider.fetchResultField(req).get("data");
|
||||
result.setAssistData(assistData);
|
||||
result.setDynamicAssistFields(dynamicAssistFields);
|
||||
|
@ -66,7 +66,7 @@ public class LineHandler extends YoyChartHandler {
|
||||
req.setDsList(dsMap);
|
||||
var assistSql = assistSQL(originSql, assistFields);
|
||||
req.setQuery(assistSql);
|
||||
logger.info("calcite assistSql sql: " + assistSql);
|
||||
logger.debug("calcite assistSql sql: " + assistSql);
|
||||
var assistData = (List<String[]>) provider.fetchResultField(req).get("data");
|
||||
result.setAssistData(assistData);
|
||||
result.setDynamicAssistFields(dynamicAssistFields);
|
||||
|
@ -102,7 +102,7 @@ public class StackAreaHandler extends YoyChartHandler {
|
||||
req.setDsList(dsMap);
|
||||
var assistSql = assistSQL(originSql, assistFields);
|
||||
req.setQuery(assistSql);
|
||||
logger.info("calcite assist sql: " + assistSql);
|
||||
logger.debug("calcite assist sql: " + assistSql);
|
||||
var assistData = (List<String[]>) provider.fetchResultField(req).get("data");
|
||||
result.setAssistData(assistData);
|
||||
result.setDynamicAssistFields(dynamicAssistFields);
|
||||
|
@ -79,7 +79,7 @@ public class SymbolicMapHandler extends GroupChartHandler {
|
||||
String querySql = SQLProvider.createQuerySQL(sqlMeta, true, needOrder, view);
|
||||
querySql = provider.rebuildSQL(querySql, sqlMeta, crossDs, dsMap);
|
||||
datasourceRequest.setQuery(querySql);
|
||||
logger.info("calcite chart sql: " + querySql);
|
||||
logger.debug("calcite chart sql: " + querySql);
|
||||
List<String[]> data = (List<String[]>) provider.fetchResultField(datasourceRequest).get("data");
|
||||
// 获取所有字段数据作为数据详情返回
|
||||
List<String[]> detailData = new ArrayList<>();
|
||||
@ -98,7 +98,7 @@ public class SymbolicMapHandler extends GroupChartHandler {
|
||||
String querySQL;
|
||||
querySQL = SQLProvider.createQuerySQL(sqlMeta2, false, needOrder, false);
|
||||
querySQL = provider.rebuildSQL(querySQL, sqlMeta2, crossDs, dsMap);
|
||||
logger.info("calcite data preview sql: " + querySQL);
|
||||
logger.debug("calcite data preview sql: " + querySQL);
|
||||
// 调用数据源的calcite获得data
|
||||
DatasourceRequest datasourceRequest1 = new DatasourceRequest();
|
||||
datasourceRequest1.setQuery(querySQL);
|
||||
|
@ -86,7 +86,7 @@ public class MixHandler extends YoyChartHandler {
|
||||
req.setDsList(dsMap);
|
||||
var assistSql = assistSQL(originSql, assistFields);
|
||||
req.setQuery(assistSql);
|
||||
logger.info("calcite assistSql sql: " + assistSql);
|
||||
logger.debug("calcite assistSql sql: " + assistSql);
|
||||
var assistData = (List<String[]>) provider.fetchResultField(req).get("data");
|
||||
leftResult.setAssistData(assistData);
|
||||
leftResult.setDynamicAssistFields(leftAssistFields);
|
||||
|
@ -41,7 +41,7 @@ public class NumericalChartHandler extends DefaultChartHandler {
|
||||
String querySql = SQLProvider.createQuerySQL(sqlMeta, true, needOrder, view);
|
||||
querySql = provider.rebuildSQL(querySql, sqlMeta, crossDs, dsMap);
|
||||
datasourceRequest.setQuery(querySql);
|
||||
logger.info("calcite chart sql: " + querySql);
|
||||
logger.debug("calcite chart sql: " + querySql);
|
||||
List<String[]> data = (List<String[]>) provider.fetchResultField(datasourceRequest).get("data");
|
||||
boolean isdrill = filterResult
|
||||
.getFilterList()
|
||||
|
@ -95,7 +95,7 @@ public class TableInfoHandler extends DefaultChartHandler {
|
||||
totalPageSql = provider.rebuildSQL(totalPageSql, sqlMeta, crossDs, dsMap);
|
||||
datasourceRequest.setQuery(totalPageSql);
|
||||
datasourceRequest.setTotalPageFlag(true);
|
||||
logger.info("calcite total sql: " + totalPageSql);
|
||||
logger.debug("calcite total sql: " + totalPageSql);
|
||||
List<String[]> tmpData = (List<String[]>) provider.fetchResultField(datasourceRequest).get("data");
|
||||
var totalItems = ObjectUtils.isEmpty(tmpData) ? 0 : Long.valueOf(tmpData.get(0)[0]);
|
||||
if (StringUtils.equalsIgnoreCase(view.getResultMode(), "custom")) {
|
||||
@ -108,7 +108,7 @@ public class TableInfoHandler extends DefaultChartHandler {
|
||||
|
||||
querySql = provider.rebuildSQL(querySql, sqlMeta, crossDs, dsMap);
|
||||
datasourceRequest.setQuery(querySql);
|
||||
logger.info("calcite chart sql: " + querySql);
|
||||
logger.debug("calcite chart sql: " + querySql);
|
||||
List<String[]> data = (List<String[]>) provider.fetchResultField(datasourceRequest).get("data");
|
||||
//自定义排序
|
||||
data = ChartDataUtil.resultCustomSort(xAxis, data);
|
||||
|
@ -721,7 +721,7 @@ public class ChartDataManage {
|
||||
|
||||
querySql = provider.rebuildSQL(querySql, sqlMeta, crossDs, dsMap);
|
||||
datasourceRequest.setQuery(querySql);
|
||||
logger.info("calcite chart get field enum sql: " + querySql);
|
||||
logger.debug("calcite chart get field enum sql: " + querySql);
|
||||
|
||||
data = (List<String[]>) provider.fetchResultField(datasourceRequest).get("data");
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ public class CopilotManage {
|
||||
datasetDataManage.buildFieldName(sqlMap, allFields);
|
||||
List<String> strings = transCreateTableFields(allFields);
|
||||
String createSql = "CREATE TABLE de_tmp_table (" + StringUtils.join(strings, ",") + ")";
|
||||
logger.info("Copilot Schema SQL: " + createSql);
|
||||
logger.debug("Copilot Schema SQL: " + createSql);
|
||||
|
||||
// PerMsgDTO perMsgDTO = new PerMsgDTO();
|
||||
msgDTO.setDatasetGroupId(dto.getId());
|
||||
@ -178,7 +178,7 @@ public class CopilotManage {
|
||||
// Order2SQLObj.getOrders(sqlMeta, dto.getSortFields(), allFields, crossDs, dsMap);
|
||||
// String querySQL = SQLProvider.createQuerySQL(sqlMeta, false, false, needOrder);
|
||||
// querySQL = provider.rebuildSQL(querySQL, sqlMeta, crossDs, dsMap);
|
||||
// logger.info("preview sql: " + querySQL);
|
||||
// logger.debug("preview sql: " + querySQL);
|
||||
|
||||
// 无法加行权限的情况下,直接用sql
|
||||
String querySQL = sql;
|
||||
@ -197,7 +197,7 @@ public class CopilotManage {
|
||||
s = copilotSQL
|
||||
.replaceAll(SqlPlaceholderConstants.KEYWORD_PREFIX_REGEX + "de_tmp_table" + SqlPlaceholderConstants.KEYWORD_SUFFIX_REGEX, "(" + querySQL + ")")
|
||||
.replaceAll(SqlPlaceholderConstants.KEYWORD_PREFIX_REGEX + "DE_TMP_TABLE" + SqlPlaceholderConstants.KEYWORD_SUFFIX_REGEX, "(" + querySQL + ")");
|
||||
logger.info("copilot sql: " + s);
|
||||
logger.debug("copilot sql: " + s);
|
||||
datasourceRequest.setQuery(s);
|
||||
data = provider.fetchResultField(datasourceRequest);
|
||||
} catch (Exception e) {
|
||||
@ -205,7 +205,7 @@ public class CopilotManage {
|
||||
s = copilotSQL
|
||||
.replaceAll(SqlPlaceholderConstants.KEYWORD_PREFIX_REGEX + "de_tmp_table" + SqlPlaceholderConstants.KEYWORD_SUFFIX_REGEX, "(" + querySQL + ") tmp")
|
||||
.replaceAll(SqlPlaceholderConstants.KEYWORD_PREFIX_REGEX + "DE_TMP_TABLE" + SqlPlaceholderConstants.KEYWORD_SUFFIX_REGEX, "(" + querySQL + ") tmp");
|
||||
logger.info("copilot sql: " + s);
|
||||
logger.debug("copilot sql: " + s);
|
||||
datasourceRequest.setQuery(s);
|
||||
data = provider.fetchResultField(datasourceRequest);
|
||||
} catch (Exception e1) {
|
||||
@ -293,8 +293,8 @@ public class CopilotManage {
|
||||
if (!receiveDTO.getSqlOk() || !receiveDTO.getChartOk()) {
|
||||
DEException.throwException((String) JsonUtil.toJSONString(receiveDTO));
|
||||
}
|
||||
logger.info("Copilot Service SQL: " + receiveDTO.getSql());
|
||||
logger.info("Copilot Service Chart: " + JsonUtil.toJSONString(receiveDTO.getChart()));
|
||||
logger.debug("Copilot Service SQL: " + receiveDTO.getSql());
|
||||
logger.debug("Copilot Service Chart: " + JsonUtil.toJSONString(receiveDTO.getChart()));
|
||||
return receiveDTO;
|
||||
}
|
||||
|
||||
@ -461,7 +461,7 @@ public class CopilotManage {
|
||||
SqlNode sqlNode = parser.parseStmt();
|
||||
return sqlNode.toSqlString(dialect).toString().toLowerCase();
|
||||
} catch (Exception e) {
|
||||
logger.info("calcite trans copilot SQL error");
|
||||
logger.debug("calcite trans copilot SQL error");
|
||||
return receiveDTO.getSql();
|
||||
}
|
||||
} else {
|
||||
|
@ -122,7 +122,7 @@ public class DatasetDataManage {
|
||||
}
|
||||
datasourceRequest.setQuery(sql.replaceAll("\r\n", " ")
|
||||
.replaceAll("\n", " "));
|
||||
logger.info("calcite data table field sql: " + datasourceRequest.getQuery());
|
||||
logger.debug("calcite data table field sql: " + datasourceRequest.getQuery());
|
||||
// 获取数据源表的原始字段
|
||||
if (StringUtils.equalsIgnoreCase(type, DatasetTableType.DB)) {
|
||||
datasourceRequest.setTable(tableInfoDTO.getTable());
|
||||
@ -144,7 +144,7 @@ public class DatasetDataManage {
|
||||
sql = Utils.replaceSchemaAlias(sql, datasourceRequest.getDsList());
|
||||
sql = provider.transSqlDialect(sql, datasourceRequest.getDsList());
|
||||
datasourceRequest.setQuery(sql);
|
||||
logger.info("calcite data table field sql: " + datasourceRequest.getQuery());
|
||||
logger.debug("calcite data table field sql: " + datasourceRequest.getQuery());
|
||||
tableFields = provider.fetchTableField(datasourceRequest);
|
||||
}
|
||||
return transFields(tableFields, true);
|
||||
@ -228,7 +228,7 @@ public class DatasetDataManage {
|
||||
querySQL = SQLProvider.createQuerySQLWithLimit(sqlMeta, false, needOrder, false, start, count);
|
||||
}
|
||||
querySQL = provider.rebuildSQL(querySQL, sqlMeta, crossDs, dsMap);
|
||||
logger.info("calcite data preview sql: " + querySQL);
|
||||
logger.debug("calcite data preview sql: " + querySQL);
|
||||
|
||||
// 通过数据源请求数据
|
||||
// 调用数据源的calcite获得data
|
||||
@ -276,7 +276,7 @@ public class DatasetDataManage {
|
||||
sql = s;
|
||||
}
|
||||
String querySQL = "SELECT COUNT(*) FROM (" + sql + ") t_a_0";
|
||||
logger.info("calcite data count sql: " + querySQL);
|
||||
logger.debug("calcite data count sql: " + querySQL);
|
||||
|
||||
// 通过数据源请求数据
|
||||
// 调用数据源的calcite获得data
|
||||
@ -373,7 +373,7 @@ public class DatasetDataManage {
|
||||
// replace placeholder
|
||||
sql = provider.replaceTablePlaceHolder(sql, originSql);
|
||||
|
||||
logger.info("calcite data preview sql: " + sql);
|
||||
logger.debug("calcite data preview sql: " + sql);
|
||||
datasourceRequest.setQuery(sql);
|
||||
Map<String, Object> data = provider.fetchResultField(datasourceRequest);
|
||||
// 重新构造data
|
||||
@ -519,7 +519,7 @@ public class DatasetDataManage {
|
||||
querySQL = SQLProvider.createQuerySQL(sqlMeta, false, needOrder, true);
|
||||
}
|
||||
querySQL = provider.rebuildSQL(querySQL, sqlMeta, crossDs, dsMap);
|
||||
logger.info("calcite data enum sql: " + querySQL);
|
||||
logger.debug("calcite data enum sql: " + querySQL);
|
||||
|
||||
// 通过数据源请求数据
|
||||
// 调用数据源的calcite获得data
|
||||
@ -767,7 +767,7 @@ public class DatasetDataManage {
|
||||
querySQL = SQLProvider.createQuerySQL(sqlMeta, false, needOrder, sortDistinct && ids.size() == 1);
|
||||
}
|
||||
querySQL = provider.rebuildSQL(querySQL, sqlMeta, crossDs, dsMap);
|
||||
logger.info("calcite data enum sql: " + querySQL);
|
||||
logger.debug("calcite data enum sql: " + querySQL);
|
||||
|
||||
// 通过数据源请求数据
|
||||
// 调用数据源的calcite获得data
|
||||
@ -898,7 +898,7 @@ public class DatasetDataManage {
|
||||
querySQL = SQLProvider.createQuerySQL(sqlMeta, false, needOrder, false);
|
||||
}
|
||||
querySQL = provider.rebuildSQL(querySQL, sqlMeta, crossDs, dsMap);
|
||||
logger.info("filter tree sql: " + querySQL);
|
||||
logger.debug("filter tree sql: " + querySQL);
|
||||
|
||||
// 通过数据源请求数据
|
||||
// 调用数据源的calcite获得data
|
||||
|
@ -260,7 +260,7 @@ public class DatasetSQLManage {
|
||||
}
|
||||
sql = MessageFormat.format("SELECT {0} FROM {1}", f, TableUtils.getTableAndAlias(tableName, getDatasourceType(dsMap, currentDs.getDatasourceId()), isCross));
|
||||
}
|
||||
logger.info("calcite origin sql: " + sql);
|
||||
logger.debug("calcite origin sql: " + sql);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("sql", sql);
|
||||
map.put("field", checkedFields);
|
||||
|
@ -112,7 +112,7 @@ public abstract class Provider {
|
||||
}
|
||||
|
||||
public String rebuildSQL(String sql, SQLMeta sqlMeta, boolean crossDs, Map<Long, DatasourceSchemaDTO> dsMap) {
|
||||
logger.info("calcite sql: " + sql);
|
||||
logger.debug("calcite sql: " + sql);
|
||||
if (crossDs) {
|
||||
return sql;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user