Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id CFF59200BF4 for ; Fri, 23 Dec 2016 02:46:39 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id CE6B2160B35; Fri, 23 Dec 2016 01:46:39 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CC76B160B26 for ; Fri, 23 Dec 2016 02:46:38 +0100 (CET) Received: (qmail 51569 invoked by uid 500); 23 Dec 2016 01:46:38 -0000 Mailing-List: contact commits-help@atlas.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@atlas.incubator.apache.org Delivered-To: mailing list commits@atlas.incubator.apache.org Received: (qmail 51557 invoked by uid 99); 23 Dec 2016 01:46:38 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Dec 2016 01:46:38 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 9DB1318C4B2 for ; Fri, 23 Dec 2016 01:46:37 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.219 X-Spam-Level: X-Spam-Status: No, score=-6.219 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id rg7fSMvRRgFQ for ; Fri, 23 Dec 2016 01:46:35 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id F300C5FDC4 for ; Fri, 23 Dec 2016 01:46:31 +0000 (UTC) Received: (qmail 48598 invoked by uid 99); 23 Dec 2016 01:46:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Dec 2016 01:46:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id E655BDFC15; Fri, 23 Dec 2016 01:46:30 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: madhan@apache.org To: commits@atlas.incubator.apache.org Date: Fri, 23 Dec 2016 01:47:13 -0000 Message-Id: <8d1d763532ed4ddfaf7be1eb2bd6c214@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [44/50] [abbrv] incubator-atlas git commit: ATLAS-1098 Atlas allows creation of tag with name isa which causes exceptions during search (apoorvnaik via shwethags) archived-at: Fri, 23 Dec 2016 01:46:40 -0000 ATLAS-1098 Atlas allows creation of tag with name isa which causes exceptions during search (apoorvnaik via shwethags) (cherry picked from commit c1081a49da3553f55b33edecb416de99c90d10b4) Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/f0e58eda Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/f0e58eda Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/f0e58eda Branch: refs/heads/0.7-incubating Commit: f0e58eda035a5f9b80e7447e84a592a17f1659df Parents: a8307be Author: Shwetha GS Authored: Mon Sep 19 11:13:08 2016 +0530 Committer: Madhan Neethiraj Committed: Thu Dec 22 15:33:43 2016 -0800 ---------------------------------------------------------------------- pom.xml | 2 +- release-log.txt | 1 + .../atlas/services/DefaultMetadataService.java | 52 -------------------- .../org/apache/atlas/query/QueryParser.scala | 12 +++-- .../org/apache/atlas/BaseRepositoryTest.java | 5 +- .../GraphBackedDiscoveryServiceTest.java | 3 ++ 6 files changed, 16 insertions(+), 59 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f0e58eda/pom.xml ---------------------------------------------------------------------- diff --git a/pom.xml b/pom.xml index e46d7e0..df4d6d2 100755 --- a/pom.xml +++ b/pom.xml @@ -1782,7 +1782,7 @@ **/users-credentials.properties **/public/css/animate.min.css **/public/css/bootstrap-sidebar.css - **/public/js/require-handlebars-plugin/** + **/public/js/external_lib/** **/node_modules/** **/public/js/libs/** http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f0e58eda/release-log.txt ---------------------------------------------------------------------- diff --git a/release-log.txt b/release-log.txt index 0419f19..079ced4 100644 --- a/release-log.txt +++ b/release-log.txt @@ -30,6 +30,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags) ALL CHANGES: +ATLAS-1098 Atlas allows creation of tag with name "isa" which causes exceptions during search (apoorvnaik via shwethags) ATLAS-1142 Lineage UI Improvement (kevalbhatt via shwethags) ATLAS-712 Support getTrait() API (svimal2106 via shwethags) ATLAS-1173 Doc: Minor editorial bug in the example given for property atlas.server.ha.zookeeper.auth (yhemanth via shwethags) http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f0e58eda/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java ---------------------------------------------------------------------- diff --git a/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java b/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java index fdb749a..3550492 100755 --- a/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java +++ b/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java @@ -241,9 +241,6 @@ public class DefaultMetadataService implements MetadataService, ActiveStateChang typeDefinition = ParamChecker.notEmpty(typeDefinition, "type definition"); TypesDef typesDef = validateTypeDefinition(typeDefinition); - // Also validate if the types being created are not keywords - validateIfNotKeyword(typesDef); - try { final TypeSystem.TransientTypeSystem transientTypeSystem = typeSystem.createTransientTypeSystem(typesDef, isUpdate); final Map typesAdded = transientTypeSystem.getTypesAdded(); @@ -289,55 +286,6 @@ public class DefaultMetadataService implements MetadataService, ActiveStateChang } } - private void validateIfNotKeyword(TypesDef typesDef) throws AtlasException { - List enumDefs = typesDef.enumTypesAsJavaList(); - List structDefs = typesDef.structTypesAsJavaList(); - List> classDefs = typesDef.classTypesAsJavaList(); - List> traitDefs = typesDef.traitTypesAsJavaList(); - - // QueryParser has it's own set of keywords that should be avoided - Set keywords = QueryParser.keywordCache().keySet(); - boolean keywordCacheNotEmpty = null != keywords && !keywords.isEmpty(); - - if (keywordCacheNotEmpty) { - if (CollectionUtils.isNotEmpty(enumDefs)) { - // Check if any enum name is a keyword - for (EnumTypeDefinition enumDef : enumDefs) { - if (keywords.contains(enumDef.name)) { - throw new AtlasException("Enum definition name \"" + enumDef.name + "\" is a keyword"); - } - } - } - - if (CollectionUtils.isNotEmpty(classDefs)){ - // Check if any class name is a keyword - for (HierarchicalTypeDefinition classDef : classDefs) { - if (keywords.contains(classDef.typeName)) { - throw new AtlasException("Class definition name \"" + classDef.typeName + "\" is a keyword"); - } - } - } - - if (CollectionUtils.isNotEmpty(structDefs)){ - // Check if any struct name is a keyword - for (StructTypeDefinition structDef : structDefs) { - if (keywords.contains(structDef.typeName)) { - throw new AtlasException("StructType definition name \"" + structDef.typeName + "\" is a keyword"); - } - } - } - - if (CollectionUtils.isNotEmpty(traitDefs)){ - // Check if any trait name is a keyword - for (HierarchicalTypeDefinition traitDef : traitDefs) { - if (keywords.contains(traitDef.typeName)) { - throw new AtlasException("TraitType definition name \"" + traitDef.typeName + "\" is a keyword"); - } - } - } - } - } - /** * Return the definition for the given type. * http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f0e58eda/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala ---------------------------------------------------------------------- diff --git a/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala b/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala index 4d2429e..7074d74 100755 --- a/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala +++ b/repository/src/main/scala/org/apache/atlas/query/QueryParser.scala @@ -387,6 +387,7 @@ class QueryLexer(val keywords: Seq[String], val delims: Seq[String]) extends Std | floatConstant ^^ FloatLiteral | dubConstant ^^ DoubleLiteral | identifier ^^ processIdent + | quotedIdentifier ^^ Identifier | string ^^ StringLit | EofCh ^^^ EOF | '\'' ~> failure("unclosed string literal") @@ -398,10 +399,11 @@ class QueryLexer(val keywords: Seq[String], val delims: Seq[String]) extends Std override def identChar = letter | elem('_') - def identifier = identChar ~ (identChar | digit).* ^^ { case first ~ rest => (first :: rest).mkString} | - '`' ~> chrExcept('`', '\n', EofCh).* <~ '`' ^^ { - _ mkString "" - } + def identifier = identChar ~ (identChar | digit).* ^^ { case first ~ rest => (first :: rest).mkString} + + def quotedIdentifier = '`' ~> chrExcept('`', '\n', EofCh).* <~ '`' ^^ { + _ mkString "" + } override def whitespace: Parser[Any] = (whitespaceChar @@ -477,4 +479,4 @@ class QueryLexer(val keywords: Seq[String], val delims: Seq[String]) extends Std allCaseVersions(s.tail, prefix + s.head.toUpper) } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f0e58eda/repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java b/repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java index 01c4bfa..500a305 100644 --- a/repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java +++ b/repository/src/test/java/org/apache/atlas/BaseRepositoryTest.java @@ -174,8 +174,11 @@ public class BaseRepositoryTest { HierarchicalTypeDefinition logTraitDef = TypesUtil.createTraitTypeDef("Log Data", null); + HierarchicalTypeDefinition isaKeywordTraitDef = TypesUtil.createTraitTypeDef("isa", null); + return TypesUtil.getTypesDef(ImmutableList.of(), ImmutableList.of(), - ImmutableList.of(dimTraitDef, factTraitDef, piiTraitDef, metricTraitDef, etlTraitDef, jdbcTraitDef, logTraitDef), + ImmutableList.of(dimTraitDef, factTraitDef, piiTraitDef, metricTraitDef, etlTraitDef, jdbcTraitDef, logTraitDef, + isaKeywordTraitDef), ImmutableList.of(dbClsDef, storageDescClsDef, columnClsDef, tblClsDef, loadProcessClsDef, viewClsDef, partClsDef, datasetSubTypeClsDef)); } http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f0e58eda/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java ---------------------------------------------------------------------- diff --git a/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java b/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java index 74438cd..7b7010c 100755 --- a/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java +++ b/repository/src/test/java/org/apache/atlas/discovery/GraphBackedDiscoveryServiceTest.java @@ -368,6 +368,9 @@ public class GraphBackedDiscoveryServiceTest extends BaseRepositoryTest { {"Metric", 9}, {"PII", 8}, {"`Log Data`", 4}, + // Not sure what the expected rows should be, but since we didn't assign or do anything with the created + // I assume it'll be zero + {"`isa`", 0}, /* Lineage queries are fired through ClosureQuery and are tested through HiveLineageJerseyResourceIt in webapp module. Commenting out the below queries since DSL to Gremlin parsing/translation fails with lineage queries when there are array types