kyotoYaho closed pull request #409: KYLIN-2972 CacheKey from SQLRequest should
ignore the case of project…
URL: https://github.com/apache/kylin/pull/409
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
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 56db74551c..2672a193d1 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 Object getCacheKey() {
return cacheKey;
cacheKey = Lists.newArrayList(sql.replaceAll("[ ]", " ") //
- , project //
+ , getNormProject() //
, offset //
, limit //
, acceptPartial //
@@ -127,7 +127,7 @@ public boolean equals(Object o) {
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 boolean equals(Object o) {
@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();
+ }
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services