(improvement)(headless)Normalize space SQL strings in the log messages.

This commit is contained in:
jerryjzhang
2024-07-04 18:23:55 +08:00
parent fa5abc58a5
commit bb4cd880b0
9 changed files with 21 additions and 22 deletions

View File

@@ -33,7 +33,7 @@ public class DefaultQueryCache implements QueryCache {
log.warn("exception:", exception);
return null;
});
log.info("put to cache, key:{}", cacheKey);
log.debug("put to cache, key: {}", cacheKey);
return true;
}
return false;

View File

@@ -12,8 +12,6 @@ import org.springframework.stereotype.Component;
import java.util.Objects;
;
@Component("JdbcExecutor")
@Slf4j
public class JdbcExecutor implements QueryExecutor {
@@ -40,7 +38,7 @@ public class JdbcExecutor implements QueryExecutor {
log.warn("data base id is empty");
return null;
}
log.info("query SQL: {}", queryStatement.getSql());
log.info("executing SQL: {}", StringUtils.normalizeSpace(queryStatement.getSql()));
Database database = queryStatement.getSemanticModel().getDatabase();
SemanticQueryResp queryResultWithColumns = new SemanticQueryResp();
SqlUtils sqlUtil = sqlUtils.init(database);

View File

@@ -27,6 +27,7 @@ import org.apache.calcite.sql.SqlNode;
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
import org.apache.calcite.sql.parser.SqlParserPos;
import org.apache.calcite.sql.validate.SqlValidatorScope;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Triple;
import org.springframework.util.CollectionUtils;
@@ -106,7 +107,7 @@ public class JoinRender extends Renderer {
addZipperField(dataSource, dataSourceWhere);
TableView tableView = SourceRender.renderOne("", dataSourceWhere, queryMetrics, queryDimension,
metricCommand.getWhere(), dataSources.get(i), scope, schema, true);
log.info("tableView {}", tableView.getTable().toString());
log.info("tableView {}", StringUtils.normalizeSpace(tableView.getTable().toString()));
String alias = Constants.JOIN_TABLE_PREFIX + dataSource.getName();
tableView.setAlias(alias);
tableView.setPrimary(primary);