From 4786827f503ff297f86a466a62abb0b68ce87348 Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 6 Aug 2024 10:28:13 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E8=B0=83=E6=95=B4SQL=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E7=BA=A7=E5=88=AB=E4=B8=BAdebug=20#11315?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/charts/impl/DefaultChartHandler.java | 2 +- .../chart/charts/impl/YoyChartHandler.java | 2 +- .../chart/charts/impl/bar/BarHandler.java | 2 +- .../chart/charts/impl/line/LineHandler.java | 2 +- .../chart/charts/impl/line/StackAreaHandler.java | 2 +- .../charts/impl/map/SymbolicMapHandler.java | 4 ++-- .../chart/charts/impl/mix/MixHandler.java | 2 +- .../impl/numeric/NumericalChartHandler.java | 2 +- .../charts/impl/table/TableInfoHandler.java | 4 ++-- .../dataease/chart/manage/ChartDataManage.java | 2 +- .../dataease/copilot/manage/CopilotManage.java | 14 +++++++------- .../dataset/manage/DatasetDataManage.java | 16 ++++++++-------- .../dataset/manage/DatasetSQLManage.java | 2 +- .../extensions/datasource/provider/Provider.java | 2 +- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/DefaultChartHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/DefaultChartHandler.java index e889d79a3b..448c10e224 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/DefaultChartHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/DefaultChartHandler.java @@ -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 data = (List) provider.fetchResultField(datasourceRequest).get("data"); //自定义排序 data = ChartDataUtil.resultCustomSort(xAxis, data); diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/YoyChartHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/YoyChartHandler.java index 4e3acc664f..1b2cb55999 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/YoyChartHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/YoyChartHandler.java @@ -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) provider.fetchResultField(request).get("data"); List resultData = new ArrayList<>(); diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/bar/BarHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/bar/BarHandler.java index 985c85307a..6e6a8beed6 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/bar/BarHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/bar/BarHandler.java @@ -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) provider.fetchResultField(req).get("data"); result.setAssistData(assistData); result.setDynamicAssistFields(dynamicAssistFields); diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/line/LineHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/line/LineHandler.java index 4d6e814c2c..653ee6a928 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/line/LineHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/line/LineHandler.java @@ -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) provider.fetchResultField(req).get("data"); result.setAssistData(assistData); result.setDynamicAssistFields(dynamicAssistFields); diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/line/StackAreaHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/line/StackAreaHandler.java index 598c5f570c..a2df5f4627 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/line/StackAreaHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/line/StackAreaHandler.java @@ -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) provider.fetchResultField(req).get("data"); result.setAssistData(assistData); result.setDynamicAssistFields(dynamicAssistFields); diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/map/SymbolicMapHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/map/SymbolicMapHandler.java index 7641a5e66f..a477fcce74 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/map/SymbolicMapHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/map/SymbolicMapHandler.java @@ -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 data = (List) provider.fetchResultField(datasourceRequest).get("data"); // 获取所有字段数据作为数据详情返回 List 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); diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/MixHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/MixHandler.java index 8514343bd0..7989cb3a1a 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/MixHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/mix/MixHandler.java @@ -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) provider.fetchResultField(req).get("data"); leftResult.setAssistData(assistData); leftResult.setDynamicAssistFields(leftAssistFields); diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/numeric/NumericalChartHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/numeric/NumericalChartHandler.java index 1774d0694b..fe558dd171 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/numeric/NumericalChartHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/numeric/NumericalChartHandler.java @@ -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 data = (List) provider.fetchResultField(datasourceRequest).get("data"); boolean isdrill = filterResult .getFilterList() diff --git a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/table/TableInfoHandler.java b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/table/TableInfoHandler.java index cf465f3aed..ac7116a81b 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/charts/impl/table/TableInfoHandler.java +++ b/core/core-backend/src/main/java/io/dataease/chart/charts/impl/table/TableInfoHandler.java @@ -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 tmpData = (List) 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 data = (List) provider.fetchResultField(datasourceRequest).get("data"); //自定义排序 data = ChartDataUtil.resultCustomSort(xAxis, data); diff --git a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java index 324f560fb5..d0bf82adf6 100644 --- a/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java +++ b/core/core-backend/src/main/java/io/dataease/chart/manage/ChartDataManage.java @@ -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) provider.fetchResultField(datasourceRequest).get("data"); } diff --git a/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java b/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java index ef986b8dcd..5af29a5318 100644 --- a/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java +++ b/core/core-backend/src/main/java/io/dataease/copilot/manage/CopilotManage.java @@ -119,7 +119,7 @@ public class CopilotManage { datasetDataManage.buildFieldName(sqlMap, allFields); List 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 { diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java index e5628c7da9..3cb3b7b3f8 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetDataManage.java @@ -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 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 diff --git a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLManage.java b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLManage.java index a80441c48c..62069e2157 100644 --- a/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLManage.java +++ b/core/core-backend/src/main/java/io/dataease/dataset/manage/DatasetSQLManage.java @@ -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 map = new HashMap<>(); map.put("sql", sql); map.put("field", checkedFields); diff --git a/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/provider/Provider.java b/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/provider/Provider.java index 84da2cf3dc..da431d3a75 100644 --- a/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/provider/Provider.java +++ b/sdk/extensions/extensions-datasource/src/main/java/io/dataease/extensions/datasource/provider/Provider.java @@ -112,7 +112,7 @@ public abstract class Provider { } public String rebuildSQL(String sql, SQLMeta sqlMeta, boolean crossDs, Map dsMap) { - logger.info("calcite sql: " + sql); + logger.debug("calcite sql: " + sql); if (crossDs) { return sql; }