[jira] [Commented] (KYLIN-3258) No check for duplicate cube name when creating a hybrid cube

2018-09-10 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/KYLIN-3258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16610065#comment-16610065
 ] 

ASF subversion and git services commented on KYLIN-3258:


Commit 3e6307473d60036feb8c8497379eb4841d82d093 in kylin's branch 
refs/heads/2.5.x-hadoop3.1 from GinaZhai
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=3e63074 ]

KYLIN-3258 No check for duplicate cube name when creating a hybrid cube


> No check for duplicate cube name when creating a hybrid cube
> 
>
> Key: KYLIN-3258
> URL: https://issues.apache.org/jira/browse/KYLIN-3258
> Project: Kylin
>  Issue Type: Bug
>  Components: Metadata
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Assignee: Shaofeng SHI
>Priority: Minor
> Fix For: v2.5.0
>
>
> When loading hybrid cube definitions via REST API, there is no check for 
> duplicate cube names is the list. If due to a user error or incorrectly 
> generated list of cubes by an external application/script the same cube name 
> is listed more than once, new or updated hybrid cube will contain the same 
> cube listed multiple times.
> It does not seem to cause any immediate issues with querying, but it's just 
> not right. REST API should throw and exception, when the same cube name is 
> listed multiple times.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (KYLIN-3258) No check for duplicate cube name when creating a hybrid cube

2018-09-10 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/KYLIN-3258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16610060#comment-16610060
 ] 

ASF subversion and git services commented on KYLIN-3258:


Commit 3e6307473d60036feb8c8497379eb4841d82d093 in kylin's branch 
refs/heads/2.5.x from GinaZhai
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=3e63074 ]

KYLIN-3258 No check for duplicate cube name when creating a hybrid cube


> No check for duplicate cube name when creating a hybrid cube
> 
>
> Key: KYLIN-3258
> URL: https://issues.apache.org/jira/browse/KYLIN-3258
> Project: Kylin
>  Issue Type: Bug
>  Components: Metadata
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Assignee: Shaofeng SHI
>Priority: Minor
> Fix For: v2.5.0
>
>
> When loading hybrid cube definitions via REST API, there is no check for 
> duplicate cube names is the list. If due to a user error or incorrectly 
> generated list of cubes by an external application/script the same cube name 
> is listed more than once, new or updated hybrid cube will contain the same 
> cube listed multiple times.
> It does not seem to cause any immediate issues with querying, but it's just 
> not right. REST API should throw and exception, when the same cube name is 
> listed multiple times.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (KYLIN-3258) No check for duplicate cube name when creating a hybrid cube

2018-09-09 Thread ASF subversion and git services (JIRA)


[ 
https://issues.apache.org/jira/browse/KYLIN-3258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16608626#comment-16608626
 ] 

ASF subversion and git services commented on KYLIN-3258:


Commit 7a7714175a9d479678abb70740977c46e8507247 in kylin's branch 
refs/heads/master from GinaZhai
[ https://gitbox.apache.org/repos/asf?p=kylin.git;h=7a77141 ]

KYLIN-3258 No check for duplicate cube name when creating a hybrid cube


> No check for duplicate cube name when creating a hybrid cube
> 
>
> Key: KYLIN-3258
> URL: https://issues.apache.org/jira/browse/KYLIN-3258
> Project: Kylin
>  Issue Type: Bug
>  Components: Metadata
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Assignee: Shaofeng SHI
>Priority: Minor
> Fix For: v2.5.0
>
>
> When loading hybrid cube definitions via REST API, there is no check for 
> duplicate cube names is the list. If due to a user error or incorrectly 
> generated list of cubes by an external application/script the same cube name 
> is listed more than once, new or updated hybrid cube will contain the same 
> cube listed multiple times.
> It does not seem to cause any immediate issues with querying, but it's just 
> not right. REST API should throw and exception, when the same cube name is 
> listed multiple times.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (KYLIN-3258) No check for duplicate cube name when creating a hybrid cube

2018-09-09 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/KYLIN-3258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16608625#comment-16608625
 ] 

ASF GitHub Bot commented on KYLIN-3258:
---

shaofengshi closed pull request #223: KYLIN-3258 No check for duplicate cube 
name when creating a hybrid cube
URL: https://github.com/apache/kylin/pull/223
 
 
   

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/job/HybridCubeCLI.java 
b/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java
index 48e7f40973..e332e1d7d7 100644
--- a/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java
+++ b/server-base/src/main/java/org/apache/kylin/rest/job/HybridCubeCLI.java
@@ -20,11 +20,14 @@
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
 import java.util.List;
 
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.OptionBuilder;
 import org.apache.commons.cli.Options;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.kylin.common.KylinConfig;
 import org.apache.kylin.common.persistence.ResourceStore;
@@ -145,6 +148,17 @@ protected void execute(OptionsHelper optionsHelper) throws 
Exception {
 
realizationEntries.add(RealizationEntry.create(RealizationType.CUBE, 
cube.getName()));
 }
 
+int realizationEntriesLen = realizationEntries.size();
+HashSet hashSet = new HashSet<>();
+for (int i = 0; i < realizationEntriesLen; i++) {
+hashSet.add(realizationEntries.get(i));
+}
+int hashSetLen = hashSet.size();
+if (realizationEntriesLen != hashSetLen) {
+Collection duplicateCubes = 
CollectionUtils.subtract(realizationEntries, hashSet);
+throw new IllegalArgumentException("The Cubes name does duplicate, 
could not create: " + duplicateCubes);
+}
+
 if ("create".equals(action)) {
 if (hybridInstance != null) {
 throw new IllegalArgumentException("The Hybrid Cube does 
exist, could not create: " + hybridName);


 


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:
us...@infra.apache.org


> No check for duplicate cube name when creating a hybrid cube
> 
>
> Key: KYLIN-3258
> URL: https://issues.apache.org/jira/browse/KYLIN-3258
> Project: Kylin
>  Issue Type: Bug
>  Components: Metadata
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Assignee: Shaofeng SHI
>Priority: Minor
> Fix For: v2.5.0
>
>
> When loading hybrid cube definitions via REST API, there is no check for 
> duplicate cube names is the list. If due to a user error or incorrectly 
> generated list of cubes by an external application/script the same cube name 
> is listed more than once, new or updated hybrid cube will contain the same 
> cube listed multiple times.
> It does not seem to cause any immediate issues with querying, but it's just 
> not right. REST API should throw and exception, when the same cube name is 
> listed multiple times.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (KYLIN-3258) No check for duplicate cube name when creating a hybrid cube

2018-09-06 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/KYLIN-3258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16606670#comment-16606670
 ] 

ASF GitHub Bot commented on KYLIN-3258:
---

asfgit commented on issue #223: KYLIN-3258 No check for duplicate cube name 
when creating a hybrid cube
URL: https://github.com/apache/kylin/pull/223#issuecomment-419312486
 
 
   Can one of the admins verify this patch?


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:
us...@infra.apache.org


> No check for duplicate cube name when creating a hybrid cube
> 
>
> Key: KYLIN-3258
> URL: https://issues.apache.org/jira/browse/KYLIN-3258
> Project: Kylin
>  Issue Type: Bug
>  Components: Metadata
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Assignee: Shaofeng SHI
>Priority: Minor
> Fix For: v2.5.0
>
>
> When loading hybrid cube definitions via REST API, there is no check for 
> duplicate cube names is the list. If due to a user error or incorrectly 
> generated list of cubes by an external application/script the same cube name 
> is listed more than once, new or updated hybrid cube will contain the same 
> cube listed multiple times.
> It does not seem to cause any immediate issues with querying, but it's just 
> not right. REST API should throw and exception, when the same cube name is 
> listed multiple times.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (KYLIN-3258) No check for duplicate cube name when creating a hybrid cube

2018-09-06 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/KYLIN-3258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16606669#comment-16606669
 ] 

ASF GitHub Bot commented on KYLIN-3258:
---

GinaZhai opened a new pull request #223: KYLIN-3258 No check for duplicate cube 
name when creating a hybrid cube
URL: https://github.com/apache/kylin/pull/223
 
 
   Fix 2.5.0 bug


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:
us...@infra.apache.org


> No check for duplicate cube name when creating a hybrid cube
> 
>
> Key: KYLIN-3258
> URL: https://issues.apache.org/jira/browse/KYLIN-3258
> Project: Kylin
>  Issue Type: Bug
>  Components: Metadata
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Assignee: Shaofeng SHI
>Priority: Minor
> Fix For: v2.5.0
>
>
> When loading hybrid cube definitions via REST API, there is no check for 
> duplicate cube names is the list. If due to a user error or incorrectly 
> generated list of cubes by an external application/script the same cube name 
> is listed more than once, new or updated hybrid cube will contain the same 
> cube listed multiple times.
> It does not seem to cause any immediate issues with querying, but it's just 
> not right. REST API should throw and exception, when the same cube name is 
> listed multiple times.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (KYLIN-3258) No check for duplicate cube name when creating a hybrid cube

2018-02-17 Thread Billy Liu (JIRA)

[ 
https://issues.apache.org/jira/browse/KYLIN-3258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16368219#comment-16368219
 ] 

Billy Liu commented on KYLIN-3258:
--

Nice found. 

> No check for duplicate cube name when creating a hybrid cube
> 
>
> Key: KYLIN-3258
> URL: https://issues.apache.org/jira/browse/KYLIN-3258
> Project: Kylin
>  Issue Type: Bug
>  Components: Metadata
>Affects Versions: v2.2.0
> Environment: HDP 2.5.6, Kylin 2.2
>Reporter: Vsevolod Ostapenko
>Priority: Minor
>
> When loading hybrid cube definitions via REST API, there is no check for 
> duplicate cube names is the list. If due to a user error or incorrectly 
> generated list of cubes by an external application/script the same cube name 
> is listed more than once, new or updated hybrid cube will contain the same 
> cube listed multiple times.
> It does not seem to cause any immediate issues with querying, but it's just 
> not right. REST API should throw and exception, when the same cube name is 
> listed multiple times.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)