This is an automated email from the ASF dual-hosted git repository. nju_yaho pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kylin.git
The following commit(s) were added to refs/heads/master by this push: new 108765e KYLIN-2972 CacheKey from SQLRequest should ignore the case of project name 108765e is described below commit 108765e3080366e32a336475eb1e149ba3da4585 Author: kyotoYaho <nju_y...@apache.org> AuthorDate: Wed Dec 19 17:57:43 2018 +0800 KYLIN-2972 CacheKey from SQLRequest should ignore the case of project name --- .../main/java/org/apache/kylin/rest/request/SQLRequest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/server-base/src/main/java/org/apache/kylin/rest/request/SQLRequest.java b/server-base/src/main/java/org/apache/kylin/rest/request/SQLRequest.java index 56db745..2672a19 100644 --- a/server-base/src/main/java/org/apache/kylin/rest/request/SQLRequest.java +++ b/server-base/src/main/java/org/apache/kylin/rest/request/SQLRequest.java @@ -105,7 +105,7 @@ public class SQLRequest implements Serializable { return cacheKey; cacheKey = Lists.newArrayList(sql.replaceAll("[ ]", " ") // - , project // + , getNormProject() // , offset // , limit // , acceptPartial // @@ -127,7 +127,7 @@ public class SQLRequest implements Serializable { return false; if (sql != null ? !sql.equals(that.sql) : that.sql != null) return false; - if (project != null ? !project.equals(that.project) : that.project != null) + if (getNormProject() != null ? !getNormProject().equals(that.getNormProject()) : that.getNormProject() != null) return false; if (offset != null ? !offset.equals(that.offset) : that.offset != null) return false; @@ -140,11 +140,15 @@ public class SQLRequest implements Serializable { @Override public int hashCode() { int result = sql != null ? sql.hashCode() : 0; - result = 31 * result + (project != null ? project.hashCode() : 0); + result = 31 * result + (getNormProject() != null ? getNormProject().hashCode() : 0); result = 31 * result + (offset != null ? offset.hashCode() : 0); result = 31 * result + (limit != null ? limit.hashCode() : 0); result = 31 * result + (acceptPartial ? 1 : 0); result = 31 * result + (backdoorToggles != null ? backdoorToggles.hashCode() : 0); return result; } + + private String getNormProject() { + return project == null ? null : project.toUpperCase(); + } }