Skip to content

Commit

Permalink
branch-2.1: [opt](cache) enhance cache key computation by removing co…
Browse files Browse the repository at this point in the history
…mments and trimming SQL input #46099 (#46472)

Cherry-picked from #46099

Co-authored-by: York Cao <[email protected]>
  • Loading branch information
github-actions[bot] and Baymine authored Jan 7, 2025
1 parent 5962dce commit 52455ed
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.apache.doris.mysql.FieldInfo;
import org.apache.doris.mysql.privilege.DataMaskPolicy;
import org.apache.doris.mysql.privilege.RowFilterPolicy;
import org.apache.doris.nereids.parser.NereidsParser;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.Variable;
import org.apache.doris.nereids.util.Utils;
Expand Down Expand Up @@ -349,7 +350,7 @@ public PUniqueId getOrComputeCacheKeyMd5() {

/** doComputeCacheKeyMd5 */
public synchronized PUniqueId doComputeCacheKeyMd5(Set<Variable> usedVariables) {
StringBuilder cacheKey = new StringBuilder(originSql);
StringBuilder cacheKey = new StringBuilder(NereidsParser.removeCommentAndTrimBlank(originSql.trim()));
for (Entry<FullTableName, String> entry : usedViews.entrySet()) {
cacheKey.append("|")
.append(entry.getKey())
Expand Down

0 comments on commit 52455ed

Please sign in to comment.